Whois of domains php api in json?

0

I need to query domains, get information about it, dns, ip, responsible, etc. I can do it for registration.br using nicBr api link however I need to .org, .net, .com, etc. domains.  I saw the documentation of rdap = link I read this reference but I did not understand: link

Does anyone know of a webservice / api that does this free?

    
asked by anonymous 31.05.2016 / 23:38

1 answer

1

I found this site: link

It does what you need and is very easy to use. Below PHP code ready for you to test:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://jsonwhoisapi.com/api/v1/whois?identifier=google.com');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_USERPWD, $api_token); // trocar por sua ID:key
$response = curl_exec($ch);
if( curl_getinfo($ch, CURLINFO_HTTP_CODE) !== 200 )
{
    // em caso de erro na request
    die("Erro ao puxar jsonwhoisapi - HTTP_CODE: (". curl_getinfo($ch, CURLINFO_HTTP_CODE) .")". print_r($response, true), 0);
}
curl_close($ch);

$dados = json_decode($response);

print_r($dados);
    
04.03.2017 / 23:41