Why do some results show up in Google Maps but not in Places API results?

故事扮演 提交于 2019-12-10 19:05:43

问题


Ok, so when I search for "Dobry" on Google Maps I get this result: http://maps.google.de/maps/place?q=dobry&hl=de&cid=15804306880695571087

But when I try to retrieve that same restaurant from the Places API, https://maps.googleapis.com/maps/api/place/search/json?location=48.1321091,11.366&radius=500&types=establishment&sensor=false&name=Dobry&key=ABCDEF1234, I get ZERO_RESULTS.

How can I retrieve the id (not cid) Tag of that establishment? And why do the results differ? The lat/long location should be right. What am I doing wrong?


回答1:


I have the exact same issue:

Restaurant "Da Bruno" shows up in Google maps:

http://maps.google.com/maps/place?cid=6903340902649387066

But cannot be found in Places API:

https://maps.googleapis.com/maps/api/place/search/json?location=20.550509,-91.40625&radius=500&types=establishment&sensor=false&name=Da+Bruno&key=YOUR_ID_HERE

My theory here is that Places API does not query the same database as Google Maps, but if certain conditions are satisfied, POIs from the Google Maps database are also copied to the Places API database, which is why the original poster's POI is now in both.

Will update if I find more.




回答2:


The search box uses the Query Autocomplete endpoint, it will give the same result, use the location parameter to bias the results



来源:https://stackoverflow.com/questions/9274768/why-do-some-results-show-up-in-google-maps-but-not-in-places-api-results

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!