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
You can install the package via composer:
composer require masnathan/domain-api-client
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']);
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']);
composer test
Please see CHANGELOG for more information on what has changed recently.
Please see CONTRIBUTING for details.
Please review our security policy on how to report security vulnerabilities.
The MIT License (MIT). Please see License File for more information.