when i try to use Shodan API in pure php with curl for searching , nothing happen . my php code with curl:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.shodan.io/shodan/host/search?key=myapikey&query=apache&facets={}');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
$do = curl_exec($ch);
$do1 = json_decode($do,true);
curl_close($ch);
print_r($do1);
}
- So what is the problem ? and it is always possible to use API with curl ?