Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools

function PhishTank($url)
    $apikey='YOUR API KEY HERE';
    $fields=array('url'=>$url, 'format'=>'json', 'api_key'=>$apikey);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, "");
    curl_setopt($ch, CURLOPT_TIMEOUT, 10);
    curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    $response = (array) json_decode($curldata, true);
    return $response['results']['in_database'];

To use the function simply pass a url e.g.


$response will be boolean, indicating if the site is listed (true) or not (false).

/data/webs/external/dokuwiki/data/pages/php/looking_url_in_phishtank_via_the_api.txt · Last modified: 2019/05/20 10:17 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki