Useful for example in PHP bots
<?php
// GsearchResultClass, unescapedUrl, url, visibleUrl, cacheUrl, title, titleNoFormatting, content
function gfind ($search) {
$json = json_decode(file_get_contents("http://ajax.googleapis.com/ajax/services/search/web?v=1.0&rsz=large&q=".str_replace(" ", "+", $search).""));
$answer = $json->responseData->results[0];
print_r($answer);
if ($answer->title != '') { return $answer; } else { return 0; }
}
$m = gfind("dog");
echo $m->title;
?>
This is the old api and has been depreciated : http://developers.google.com/web-search/docs/
I'm glad it's still working for now. This is what I used for my advanced google scripts.
stdClass Object
(
[GsearchResultClass] => GwebSearch
[unescapedUrl] => http://en.wikipedia.org/wiki/Dog
[url] => http://en.wikipedia.org/wiki/Dog
[visibleUrl] => en.wikipedia.org
[cacheUrl] => http://www.google.com/search?q=cache:dIBIpaJI7JgJ:en.wikipedia.org
[title] => Dog - Wikipedia, the free encyclopedia
[titleNoFormatting] => Dog - Wikipedia, the free encyclopedia
[content] => The domestic dog (Canis lupus familiaris), is a subspecies of the gray wolf (Canis lupus), a member of the Canidae family of the mammilian order Carnivora.
)