Google slutade ju att ge bort nycklar till deras SOAP API för några år sedan men nu rekommenderar Google istället deras nya REST API.
Mycket trevligt måste jag säga:
http://code.google.com/apis/ajaxsear...ntation/#fonje
En sökfråga i PHP görs på följande sätt:
PHP-kod:
$url = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Paris%20Hilton"
// sendRequest
// note how referer is set manually
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_REFERER, "http://www.mysite.com/index.html");
$body = curl_exec($ch);
curl_close($ch);
// now, process the JSON string
$json = json_decode($body);
// now have some fun with the results...