Google Location APIs and maps: why do identical queries produce different results?

I am currently losing hair over the Google AJAX API. What I'm doing is converting structured location data into a search API request on Google to provide users with an alternative list of results.

eg:.

http://ajax.googleapis.com/ajax/services/search/local?v=1.0&key=XXX&hl=en_US&mrt=localonly&rsz=large&q=pizza+Neustadt+DE

However, the API behaves very strangely at times, often not taking into account certain parameters that I pass to it. For example:

If I search for the “Rome Roma IT term” on Google Maps, it will find all the terms in Rome as expected. If I repeat the same search in the API, I get zero results (I need to remove "Roma" or "Rome" for it to work - here is the administrative region, and Rome is the city).

Why is this?

Another example. In Germany, there are 20 cities, cities and areas called Neustadt. Now, when I search on Google Maps, it finds only one, unless I specify an additional classifier, for example, a region or something else.

Now, at the API level, I expected that when passing lat / lon parameters along with the request for Neustadt, it would then be smart enough to choose the right Neustadt by looking at geocoding. But this does not happen, he always chooses the same Neustadt and ignores the geodata.

q=pizza+Neustadt+DE&sll=48.8053,11.7579

I had similar problems when doing a search in the bounding box. The bounding box seems to be completely ignored, since I am still getting results data for a hundred kilometers:

q=pizza+Neustadt+DE&sll=48.8053,11.7579&sspn=0.00001,0.00001

; - ? BBox , .

API, , , , .

, , , Google Local search?

UPDATE: - . -, , :

http://code.google.com/apis/ajaxsearch/documentation/localsearch/index.html

firebug HTTP- :

test Rome Roma IT

. URL-, AJAX, :

curl "http://www.google.com/uds/GlocalSearch?key=internal-sample&v=1.0&rsz=large&sll=41.97684819454683%2C12.486648559570312&sspn=0.204185%2C0.549316&q=test%20Rome%20Roma%20IT&lssrc=lsc&lscstyle=final&start=0&callback=_callbacks_._5g139yfuc"

ZERO. ? callback, - .

Google , ?

+3
1

, , , , , Google API, , /Google, (, , , ..)

, Google , , API ( ).

. , .

+2

Source: https://habr.com/ru/post/1720753/


All Articles