How do I get the same results as I have in regular Google Search through Api Google Search?

0

When I search Chris Brown through api I get these results:

ButinGooglesearchbybrowsertheresultsaredifferent:

Assumptions:

  • Throughthesearchinthesite,eventhoughIamnotloggedin,thesearchoccursbasedonsomeadditionalinformationextractedfromthebrowser.Ipandlanguage,forexample...
  • ThinkinginthiswayIfiguredtheremightbesomeparametersthatwouldallowmetousetheapiinthesamewayasthebrowser.

DoesanyonehaveadeeperideaofthedifferencesinthesearchforeachandhowcanImakethemthesameorsimilar?

Code:

<?php$query=urlencode('ChrisBrown');$url="http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=".$query;
    $body = file_get_contents($url);
    $json = json_decode($body);


    for($x=0; $x < count($json->responseData->results); $x++){
        echo "<b>Resultado ".($x+1)."</b>";
        echo "<br>URL: ";
        echo $json->responseData->results[$x]->url;
        echo "<br>VisibleURL: ";
        echo $json->responseData->results[$x]->visibleUrl;
        echo "<br>Título: ";
        echo $json->responseData->results[$x]->title;
        echo "<br><br>";
    }
?>
    
asked by anonymous 14.08.2015 / 19:09

1 answer

0

There is no way I was using an old API to the Google Web Seach API, which is obsolete.

I'll switch to the current Google Custom Search API to try to get the results I need.

    
18.08.2015 / 20:34