how to get result for api connecting to whoapi?

244 views Asked by At

As according to the mention documentation at whoapi.com i have gone through as mention according to instruction and tried implementing the api but the variable doesn't pass from one page to other.For example i have one page which have input type and submit button then when i click submit button it should redirect to who api url and display result

http://api.whoapi.com/?domain=whoapi.com&apikey=demokey&r=blacklist

whoapi.com = name of url,demokey = key assigned by who api & blacklist = name of service of who api

guide me through the connecting protocol.

1

There are 1 answers

0
Edi Budimilic On

Not sure I understand the question. Using the API should be straight simple as any REST request is.

PHP example:

$domain    = "whoapi.com";
$r         = "blacklist";
$apikey    = "demokey";
$request   = "http://api.whoapi.com/?domain=$domain&r=$r&apikey=$apikey";
$output    = json_decode(file_get_contents($request), true); 

Resulting array with print_r($output) looks like this:

[status] => 0
[ip] => 88.198.98.181
[blacklisted] => 0
[blacklists] => Array
    (
        [0] => Array
            (
                [tracker] => invaluement.com
                [blacklisted] => 0
            )
        [1] => Array
            (
                [tracker] => surbl.org
                [blacklisted] => 0
            )
        [2] => Array
            (
                [tracker] => barracudacentral.org
                [blacklisted] => 0
            )
        [3] => Array
            (
                [tracker] => sorbs.net
                [blacklisted] => 0
            )
        [4] => Array
            (
                [tracker] => spamhaus.org
                [blacklisted] => 0
            )
    )

Hope this helps.