SDK for integrating with the CheckHim API to verify active phone numbers.

dev-main 2025-09-15 11:00 UTC

This package is auto-updated.

Last update: 2025-09-15 11:01:19 UTC


README

Latest Stable Version Packagist: checkhim/php

Official SDK for integrating with the CheckHim API (https://checkhim.tech) to verify if a phone number is active.

Installation

Via Composer:

composer require checkhim/php

Basic Usage

require 'vendor/autoload.php';

use CheckHim\CheckHim;

$client = new CheckHim('ch_test_your_api_key');

try {
    $r = $client->verify('+5511984339000');
    echo "Valid: " . ($r['valid'] ? 'yes' : 'no') . " Carrier: " . $r['carrier'] . PHP_EOL;
} catch (Exception $e) {
    echo "Error: {$e->getMessage()}" . PHP_EOL;
}

Response Example

{
  "carrier": "TIM",
  "valid": true
}

If the API returns an error, the response will be:

{
  "error": "verification failed: Network is forbidden (code: 6)",
  "code": "REJECTED_NETWORK",
  "http_status": 400
}

Documentation

Contributing

Contributions are welcome! To contribute:

  1. Fork this repository and create your branch from main.
  2. Install dependencies with composer install.
  3. Write clear, tested code and add/adjust tests in the tests/ directory.
  4. Run tests locally with:
    php vendor/bin/phpunit --testdox
    
  5. Open a Pull Request with a clear description of your changes.

For bug reports or feature requests, please open an issue.

License

MIT