Search all places in given city name

2020-02-09 16:38发布

问题:

Right now i am using Google Places API for fetching Restaurant list in particular city, query like

https://maps.googleapis.com/maps/api/place/textsearch/xml?query=restaurants+in+Sydney&sensor=true&key=AddYourOwnKeyHere

But the problem here is that we can only have 20 result and with help of next_page_token in the response we can again fetch 20 more, by this we can only have 60 result.

Mention on Google Places API page

The maximum number of results that can be returned is 60

So is there any other authentic way to fetch all the Restaurant details.

Just for information : I am implementing this in android application.

回答1:

Searches are performed by looking within a radius of a given set of coordinates (you can't search just by city name). The maximum search radius is 50km. If there's more than 60 results in that area, you could reduce your search radius, then split up the query into multiple calls. I'm not sure if it would be appropriate to have the user fetch that much data on a mobile device all at once, though.



回答2:

Can you use a different location api like MapQuest's or Bing's? As far as I know MapQuest does not have a transactional limit for the community license (open data). I don't think there's a limit to the number of results returned other than the ones you impose in your query.