I'm using Google autocomplete on my site.
I read that: Applications that submit requests with an API key are allowed 1 000 requests per 24 hour period.
Today 100 people have submitted the autocomplete form, how the daily request quota for the API been exceeded?
When users are typing a text in the autocomplete element each new symbol in the text input will trigger requests similar to
https://maps.googleapis.com/maps/api/place/js/AutocompletionService.GetPredictions?parameters
When the user selects an address from the list of suggestions this might trigger another request for place details similar to
https://maps.googleapis.com/maps/api/place/js/PlaceService.GetPlaceDetails?parameters
You can see all these requests in the network activity tab of your browser as shown in my screenshot
Each autocomplete request and each place details request that you see in network activity tab consumes the Places API quota. By default it is 1000 daily requests, but you can enable billing and get 150K daily requests for Places API free of charge:
https://developers.google.com/places/web-service/usage
I hope this helps!
Related
So I'm trying to implement a simple location autocompletion with the google places api. I'm using the autocomplete service for this (see: https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service).
What I'm doing right now is, creating an autocomplete token and renewing it if either 3 Minutes ran out (according to How long do the new Places API session tokens last?) or a place detail request was set (according to https://developers.google.com/places/web-service/session-tokens).
Now, I want to debug this and want to know if I did it properly.The dashboard on the google developer console counts every single request made though.
How do I know if it has an effect?|
If you implemented session tokens correctly in your application, in your billing report within the Google Cloud Platform Console you should see one or both of the following SKUs:
Autocomplete without Places Details – Per Session Autocomplete
(included with Places Details) – Per Session
If you didn't, you'll see this instead:
Autocomplete – Per Request
Note that this only applies if you use getPlacePredictions(). There are no session tokens for getQueryPredictions().
Hope this helps!
Is it possible to access the date of a Gmail snooze through the API? I came accross a hack in stackoverflow that allows users to search for which emails are snoozed via a secret label search “label:snoozed”, but lables dont normally have an associated date, especially one that will return to the inbox in the future.
Im trying to create a web routine that syncs a todo list with emails and want to the due date to automatically update with when the snoozed email will re-appear.
Is this possible with any API or developer resources google offers?
No, you can’t retrieve the date of a Gmail snooze using the API.
There is a Feature Request already reported for this behavior on Issue tracker:
https://issuetracker.google.com/issues/109952618
At the moment you can only list them and retrieve the messages that has this label ‘snoozed’ active on them:
GET https://www.googleapis.com/gmail/v1/users/me/messages?q=label%3Asnoozed
Looking at the Time Zone API quota limit option that says:
"Requests per 100 seconds per user"
Was trying to find a clear definition of user but to no avail.
My intuitive guess it's an IP address... yet would like to avoid unpleasant surprises.
Would be good to know what does user mean exactly. Any ideas?
I believe this is a confusion that comes from the fact that Google Maps APIs share the same developer console with Google Cloud Platform. The "Requests per 100 seconds per user" make sense in Google Cloud Platform, but I don't think they are really supported in Google Maps APIs.
If we check the documentation of Google Cloud Platform we will see the following explanation
To prevent individual users from using up your API quota, limit the number of requests per second per user for an API. Each API includes a default per-user limit, but you can modify that value as described in the previous section.
Individual users are identified by a unique string; if you're creating a server-side application (where the calling code is hosted on a server that you own) that makes requests on behalf of users, your requests must include the quotaUser parameter, as described below.
To identify a user, use the quotaUser=userID parameter. This value is for short term quota enforcement only, so you don't need to use a real user ID. You can choose any arbitrary string under forty characters long that uniquely identifies a user.
The quotaUser parameter is only used for capping requests per user per second. If you don't send the quotaUser parameter, then all calls are attributed to your server machines, in which case calls can't be capped by user.
source: https://cloud.google.com/apis/docs/capping-api-usage#limiting_requests_per_second_per_user
As far as I know none of Google Maps APIs support a quotaUser parameter, so this value doesn't make sense for Google Maps web services and as mentioned in the last paragraph Google Maps web services will attribute usage to server machines. In other words to IP addresses of your backend servers.
I hope this clarifies your doubt.
I am hitting below URL to test my key
https://maps.googleapis.com/maps/api/geocode/json?latlng=20.0041,73.7175&key=$key
it show this an error after one hit
{
error_message: "You have exceeded your daily request quota for this API. If you did not set a custom daily request quota, verify your project has an active billing account: http://g.co/dev/maps-no-account",
results:[],
status: "OVER_QUERY_LIMIT"
}
Please help me why it is happening, anything to do with enable billing?
As stated in the comments to the question, you need to enable billing, even if you are only using the free quota. See the docs about this change for more information.
I have a website that uses address autocomplete on multiple pages--address book, shipping address, billing address. With the billing changes releasing next month, we can convert the Autocomplete process to use sessions instead of individual keystrokes. (https://cloud.google.com/maps-platform/user-guide/pricing-changes/#billing-changes)
How long is an AutocompleteSessionToken good for? The current page? An hour? Twelve? Permanently, with it counting against the limit each time it shows up in a new month?
If a session token does expire, and we send that token with a request, what's the result going to be? If the customer leaves a webpage open for a day and comes back to pick up, and our session data hasn't expired, how do we make sure they don't get autocomplete errors?
As far as I can see there is no official documentation regarding session duration for Places API in Google Maps Platform. I can share some information about sessions obtained from the technical support, however, it doesn't provide exact value for session duration and it looks like Google won't reveal the exact value.
First of all, if you use the built-in Autocomplete widget of Maps JavaScript API, it generates sessions for you automatically, so no need to worry about it.
If you create your own widget, you should be aware that sessions do not last very long. An autocomplete session includes some Autocomplete requests (to retrieve suggestions on a place as the user types), and at most one Places Details request (to retrieve details about the place selected by the user).
The same session token is passed to the Autocomplete and the subsequent Place Detail request.
A session starts with the first Autocomplete request (which typically happens when the user starts typing). Typically, a Places Details call is made after the user has selected one of the Autocomplete suggestions.
After a user has selected a place (for example, a Places Details call is made), a new session must be started, with a new session token.
A session token cannot be used for more than one user session. If a token is reused, the session will be considered invalid and the requests will be charged as if no session token was provided.
If session token is expired or invalidated you will be charged on the per keystroke basis. So each autocomplete request will be charged.
I hope you find this information useful.
As a customer of Google Maps, when we contacted their support team, an agent that worked with us told us that the timeout is 3 minutes.