1
When I search Chris Brown through the api I get these results:
But in Google search by browser the results are different:
Assumptions:
- Through the site search, even if I am not logged in, the search occurs based on some additional information extracted from the browser. Ip and language, for example...
- Thinking about this way I imagined that maybe there could be parameters that allow me to use the api in the same way as the browser.
Does anyone have any deeper idea of each other’s search differences and how I can make them equal or similar?
Code:
<?php
$query = urlencode('Chris Brown');
$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>";
}
?>
At the beginning of the question I can already see that it has something to do with localization. See if the API has any location/country/language settings/etc..
– KaduAmaral
If possible put the API documentation link in the question.
– KaduAmaral