checkhim / php
SDK for integrating with the CheckHim API to verify active phone numbers.
dev-main
2025-09-15 11:00 UTC
Requires
- php: >=7.4
- guzzlehttp/guzzle: ^7.0
Requires (Dev)
- phpunit/phpunit: ^9.0
This package is auto-updated.
Last update: 2025-09-15 11:01:19 UTC
README
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:
- Fork this repository and create your branch from
main
. - Install dependencies with
composer install
. - Write clear, tested code and add/adjust tests in the
tests/
directory. - Run tests locally with:
php vendor/bin/phpunit --testdox
- Open a Pull Request with a clear description of your changes.
For bug reports or feature requests, please open an issue.
License
MIT