I want to call WHOIS domain lookup services from my CodeIgniter controller and need return array output. I just discussed with WHOIS support team, they said they do not provide API call. Do you have any idea how to do this?
Asked
Active
Viewed 342 times
-1
-
try this api http://freedomainapi.com/free-whois-api.html – Aslam Patel Jul 18 '16 at 11:24
-
Thanks for your Reply. Actually i got the solution . – Harjinder Jul 18 '16 at 11:25
-
2so if you have a solution, update your question or post an answer – moped Jul 18 '16 at 12:31
1 Answers
0
I Got Best way to call WHOIS domain lockup services
<?php
$username="username";
$password="password";
$contents = file_get_contents("http://www.whoisxmlapi.com//whoisserver/WhoisService?domainName=google.com&username=$username&password=$password&outputFormat=JSON");
//echo $contents;
$res=json_decode($contents);
if($res){
if($res->ErrorMessage){
echo $res->ErrorMessage->msg;
}
else{
$whoisRecord = $res->WhoisRecord;
if($whoisRecord){
echo "Domain name: " . print_r($whoisRecord->domainName,1) ."<br/>";
echo "Created date: " .print_r($whoisRecord->createdDate,1) ."<br/>";
echo "Updated date: " .print_r($whoisRecord->updatedDate,1) ."<br/>";
if($whoisRecord->registrant)echo "Registrant: <br/><pre>" . print_r($whoisRecord->registrant->rawText, 1) ."</pre>";
//print_r($whoisRecord);
}
}
}
?>

Harjinder
- 1
- 3