Regarding Places Library for Google Maps API Quota limits - google-maps

Quick question, just to clarify the wording and meaning (because it's changed a couple of times for Map loading...)
There are the two following statements in the Places API FAQs:
The Google Places API has the following query limits:
Users with an API key are allowed 1 000 requests per 24 hour period.
Users who have verified their identity through the APIs console are
allowed 100 000 requests per 24 hour period. A credit card is required
for verification, by enabling billing in the console. We ask for your
credit card purely to validate your identity. Your card will not be
charged for use of the Places API. While the lower limit is sufficient
for development and testing, we recommend enabling the higher limit
before launching your application. It is possible to request an
additional quota. If granted, the additional quota is free of charge.
If, at some stage in the future, an option becomes available to pay
for an additional quota, that quota will be over and above the
existing free quota, and you will need to sign up for it explicitly.
Note that some services may have a multiplier:
The Text Search service is subject to a 10-times multiplier. That is,
each Text Search request that you make will count as 10 requests
against your quota. The Radar Search Service is subject to a 5-times
multiplier. That is, each Radar Search request that you make will
count as 5 requests against your quota. If you've purchased the Google
Places API as part of your Maps API for Business contract, the
multiplier may be different. Please refer to the Google Maps API for
Business documentation for details.
This implies that use of the Google Places API is restricted to 100,000 queries per day, or 10,000 if you're doing a Text Search.
However, on the Uplift page, it says the following:
If you are developing a web based application that only needs to
search for places, and is not submitting new places or Place Bumps,
you should use the Places library of the Maps API rather than using
the Places API web service. The Places library assigns a quota to each
end user rather than to each key. This means that your available quota
increases with your user base rather than being capped at a fixed
amount.
I am using the Places API in the following way:
https://maps.googleapis.com/maps/api/js?key=XXX&libraries=places
...
service = new google.maps.places.PlacesService(map);
service.textSearch(request, callback);
And also for some details searching and photo searching.
Therefore my question is; Given my usage of the Places API, am I subject to the 100,000 queries limit on my app, or am I essentially uncapped at an app level, as my quota is per end-user? (i.e. per unique IP? if I had 10,000 users I have an effective quota for my entire user base of 100,000*10,000?)
EDIT:
For clarity: if I throw my API key into https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=-33.8670522,151.1957362&radius=500&types=food&name=harbour&sensor=false&key=XXXX, it will increment my Places quota count on the Google API console, however if I run queries through my JS app, I see no quota use change. I want to make sure that i'm not suddenly going to be hit with a massive quota result.

Use of the JavaScript API services, like those provided by the Places library, have quota assigned to each end-user. It's a very similar setup as objects like the google.maps.Geocoder, which has been discussed in a bit more detail in this Geocoding Strategies article.

You may apply for an uplift to the quota so that the restriction is taken away and you have unlimited access:
https://docs.google.com/forms/d/18pkOdu0uofeI8tbQoReDVfkbOIAscLvjiKc9ZP06hEM/viewform
This form is applicable to Android, IOS and Web.

Related

Understanding Requests from Google Places API for Web w Place Autocomplete

We are considering using Google Places API for a new web application project and I believe we are vastly underestimating the number of requests we would use.
We would be using place search, Maps JavaScript API map load to grab Place IDs from Google as well as Place Autocomplete to help users find the defined location. So my questions are:
Would the Autocomplete be considered a request on every keystroke?
Would if also be a request when we select the suggestion (Places API)
and update to Map?
I have seen that with the premium Plan autocompletes use 0.1 Maps API Credit, while JavaScript API map load is 1 and Places API is 2 credits. Trying to understand how to count before the 150k limit and after
As mentioned in the comment of your question, Google is making some drastic changes to their collective maps API usage rates. Starting June 11th, the new pricing will go into effect.
Would the Autocomplete be considered a request on every keystroke?
As of now, places autocomplete is counted on every keystroke. Starting June 11th, you have the option to switch to session-based billing. They have different pricing rates which can be see in the pricing sheet link. Depending on your application, you'll want to use the option that minimizes API calls. I think if your use case is one time selecting of location by your users then you're better off with billing by keystroke.
Would if also be a request when we select the suggestion (Places API)
and update to Map?
Selecting a suggestion from Places API would not incur an API request (requesting the suggestions does), but updating a google map using the Map API would use an API request.
The 150k daily limit is going away in favor of the new billing rates, so I would suggest you look into that now. There are some free unlimited services still offered, like the Google Maps Embed API. Loading a map using the Embed API is not counted towards any billing (as of now).

What if I have no results to display on a map after calling Google Distance Matrix API

I would like to develop a service, using Google Distance Matrix API, where a user can enter their current location and a map will be displayed showing how many other users from their group have addresses in the same general area. For privacy reasons, I do not want to show any other details (location, name, address etc.) of those other users just the number of people.
In order to ascertain this information I was intending to make a call to the API and displaying under the map of their area a message like "There are 5 other people within a 3 minute drive of your address".
Can anybody tell me whether this meets the API limitation:
The Google Maps Distance Matrix API may only be used in conjunction with displaying results on a Google map. It is prohibited to use Google Maps Distance Matrix API data without displaying a Google map
If my requirements of the API are not acceptable, could anybody suggest another publicly available API that I could use in its place?
Thanks!
Yournavigation Api gives you distance from given points.
Try this request example.
You can find their usage policy here.
They said that there are no limitations on usage, except those regarding overload:
The routing API is open and freely available for everyone under the condition that you don't overload the server. Overloading the server in this context means: more then 1 request per second for sustained periods of time. Bursting multiple requests for short time-periods is not a problem though

Google Places API Web Service usage 10x as fast as requests made

I may be missing something, but the google places API indicates free usage of 150,000 requests per day (provided you enable billing). https://developers.google.com/maps/pricing-and-plans/
However, every request i place appears to be counting as "10-requests" on certain places on their website. i.e. i was capped today after making 15,000 requests. Specifically, on the billing page, it appears that each request is counted as 10. On the API Manager overview page, each request appears to be counted as 10 on the bar graph of usage, however on the response code overview it is correct. [i.e it indicates i have made 15,000 2xx Success requests within past 24-hours --- which is the case--- (and a bunch of 4xx errors, resulting from me hitting the max limit in the table...) whereas the bar graph indicates usage of 150,000].
My question is, is this a mistake, or is it the case that each request using the places API Web Services does count as 10?
There is a documented 10x multiplier on place Text Search requests:
from that documentation:
The Google Places search services share the same usage limits. However, the Text Search service is subject to a 10-times multiplier. That is, each Text Search request that you make will count as 10 requests against your quota. If you've purchased the Google Places API as part of your Google Maps APIs Premium Plan contract, the multiplier may be different. Please refer to the Google Maps APIs Premium Plan documentation for details.

Reached Limit using Google Geocoding Web Service

We have a page that accepts a city, state combination or a zip code. Upon submit, it passes that information to the Geocode Webservice for Google Maps and returns a list of store location results based on the information passed. We sporadically have issues with bots hitting that page multiple times and then Google shuts down our usage of the geocode webservice for the day. Is there a way to ask Google to restore this more quickly? How should we handle this?
Use the client-side geocoder, the limits there will be based on the client not the server.
Geocoding Strategies
As specified on in the documentation, "Use of the Google Geocoding API is subject to a query limit of 2,500 requests per day (User of Google Maps API for Business may perform up to 100,000 requests per day.)"
There's a nice article on Geocoding Strategies which discusses caching and other options to optimize geocoding. The "Quota Considerations" section should be useful.
Remember to use client-side geocoding if at all possible, so that the quota limit will be counted per client, instead of per service/server. If you're still hitting the limits, you might need to go for the Business version and pay for a larger limit.

How does Google Geocoding API usage limits apply to [Sales]force.com?

The following are the usage limits as specified by Google on their Developer Guide pages:
Google Maps JavaScript API v3 => For-profit web sites are permitted to generate up to 25,000 map loads per day
Google Geocoding API => subject to a query limit of 2,500 geolocation requests per day
Google Maps API for Business => may perform up to 100,000 requests per day
Am trying to evaluate using any one of the above for use with Visualforce on Salesforce.com (SFDC) platform [*]
I understand for a public website the requests are per IP. Now for SFDC, there could be many different Organizations on a particular server (say, NA1). So, two different companies using SFDC and Google Maps API could have an URL at https://na1.salesforce.com/something_here and their requests should be counted separately.
Will it be so? What will happen in case of each API?
[*]SFDC is a SaaS cloud for the purpose of our discussion. All users login through the same page but they could be logged into different "orgs"/"organizations" but their URLs might look similar
It's important to differentiate between the server-side and client-side limits here. The server-side geocoding api would have have the 2500 limit enforced across the shared Salesforce instance based on how many machines the requests come from (I assume NA1 isn't 1 huge server). Multiple organization using the free geocoding API would all share the same server-side geocoding limit. I've actually run into the same limits using Google's own App Engine platform, where a bunch of applications share the same outbound IP address.
For any sort of guaranteed performance you'll need to send the queries from your own server or go the Maps for Business route which lets you authenticate your queries to get those higher limits.
Client-side geocoding via the JavaScript API doesn't have these server-limits, so if users do any sort of action to trigger a geocode or two using the JS API is the best route.
You can already create your own "bucket" to track your 25K map loads per day by signing up for an API Key.
This question on SO addresses the geocoding API specifically being run from a visualforce page directly, Salesforce: Google maps query status 620 G_GEO_TOO_MANY_QUERIES and it does seem to mean that without a key the limits are shared. I would suspect that unless you plan on giving the app away that you are working on, you will pretty much be forced to pick up an upgraded API key. One thing you may want to look at to work around this is hosting the maps portion in another location, and iframing it into Salesforce.