Modern client library for the db-ip.com API services
First of all, you need to define an add the API client in your project.
composer require scullwm/dbip-client
$dbipClient = new Client('my_secret_token');
$ipDetails = $dbipClient->getIpDetails('8.8.8.8');
$ipDetails->isRisky(); // false
$apiStatus = $dbipClient->getApiStatus();
echo $apiStatus->getQueriesLeft(); // 9996
Once you have all dependencies installed via composer install
, you can run the test suite with:
./vendor/bin/phpunit tests/