masnathan / domain-api-client
This is an easy way to check domain details.
Fund package maintenance!
MASNathan
Requires
- php: ^7.4|^8.0
- ext-json: *
- guzzlehttp/guzzle: ^7.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^5.3
- vimeo/psalm: ^4.9
This package is auto-updated.
Last update: 2024-10-29 06:12:58 UTC
README
This is an easy way to check if a domain is valid, if it’s available for purchase, it's age or it's DNS settings
Request your API key here
Installation
You can install the package via composer:
composer require masnathan/domain-api-client
Usage
Whois
use MASNathan\DomainAPI\Domain; $domainClient = new Domain('domain-checker7.p.rapidapi.com', 'super-secret-api-key'); $details = $domainClient->whois('github.com'); var_dump($details); // array:10 [ // "domain" => "github.com" // "sld" => "github" // "tld" => "com" // "valid" => true // "available" => false // "created_at" => "2007-10-09 18:20:50" // "updated_at" => "2020-09-08 09:18:27" // "expires_at" => "2022-10-09 18:20:50" // "registrar" => "MarkMonitor, Inc." // "whois" => "whois.markmonitor.com" // ] // you can also use the batch method to request up to 100 domains $details = $domainClient->whoisBatch(['github.com', 'rapidapi.com', 'google.com']);
DNS
use MASNathan\DomainAPI\Domain; $domainClient = new Domain('domain-checker7.p.rapidapi.com', 'super-secret-api-key'); $details = $domainClient->dns('github.com'); var_dump($details); // array:8 [ // "domain" => "github.com" // "valid" => true // "A" => array:1 [ // 0 => "140.82.121.4" // ] // "AAAA" => [] // "CNAME" => array:1 [...] // "NS" => array:8 [...] // "MX" => array:5 [...] // "TXT" => array:8 [...] // ] // you can also use the batch method to request up to 100 domains $details = $domainClient->dnsBatch(['github.com', 'rapidapi.com', 'google.com']);
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
License
The MIT License (MIT). Please see License File for more information.