I want to develop a map application which will display the banks near a given place.
I use the Places library to search and everytime it just return 20 results. What should I do if I want more results?
In order to have access to more than 5 reviews with the Google API you have to purchase Premium data Access from Google. That premium plan will grant you access to all sorts of additional data points you have to shell out a pretty penny.
Go to the Google Cloud Console. Click the Select a project button, then select the same project you set up for the Maps JavaScript API and click Open. From the list of APIs on the Dashboard, look for Places API. If you see the Places API in the list, it's already enabled.
While there is no maximum number of requests per day, the following usage limits are in place for the Maps JavaScript API: 30,000 requests per minute. 300 requests per minute per IP address. In the Google Cloud Console, this quota is referred to as Map loads per minute per user.
Places API is not free, however, once you set up your billing account, you will be entitled for a one time $300 free credit(usable for Google Cloud Platform products) and a monthly recurring $200 free credit(exclusive for Google Maps Platform products), after consuming the credits, you will receive an OVER_QUERY_LIMIT ...
UPDATE: Since I originally wrote this answer, the API was enhanced, making this answer out of date (or, at least, incomplete). See How to get 20+ result from Google Places API? for more information.
ORIGINAL ANSWER:
The documentation says that the Places API returns up to 20 results. It does not indicate that there is any way to change that limit. So, the short answer seems to be: You can't.
Of course, you might be able to sort of fake it by doing queries for several locations, and then merging/de-duplicating the results. It's kind of a cheap hack, though, and might not work very well. And I'd check first to make sure it doesn't violate the terms of service.
Now it is possible to have more than 20 results (but up to 60), a parameter page_token was added to the API.
Returns the next 20 results from a previously run search. Setting a page_token parameter will execute a search with the same parameters used previously — all parameters other than page_token will be ignored.
Also you can refer to the accessing additional results section to see an example on how to do the pagination.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With