I'm working on a website using the Google Maps Javascript API v3.
The free version of the API is limited by 25000 requests a day. But what happens if this limit is reached?
Is there a way to detect that the request limit has been reached so a fallback Google Maps Image API map can be displayed instead?
I'm working on a website using the Google Maps Javascript API v3.
The free version of the API is limited by 25000 requests a day. But what happens if this limit is reached?
Is there a way to detect that the request limit has been reached so a fallback Google Maps Image API map can be displayed instead?
Share Improve this question asked Dec 29, 2011 at 8:53 Guillaume FlandreGuillaume Flandre 8,9808 gold badges47 silver badges55 bronze badges 4- Isn't this limit through the client IP? – JohnP Commented Dec 29, 2011 at 8:55
- Yes, but what's the API's behaviour? – Guillaume Flandre Commented Dec 29, 2011 at 15:28
- Not sure. Unless you're proxying the request through your server, I don't see what the problem is. Since the map load request es through the client machine, it's essentially 25,000 unique map loads per day per user (I think this is the case). According to their FAQ, you'd have to hit this 90 days in a row. – JohnP Commented Dec 29, 2011 at 19:27
- "25,000 unique map loads per day per user" If only that were true ... – Beetroot-Beetroot Commented Oct 7, 2013 at 12:13
3 Answers
Reset to default 11The usage limit is based on site or application, not the client IP address.
You can use the Google API console to monitor your usage if you add an API key to each of your map requests. I have not seen a way to query the usage programmatically. https://code.google./apis/console
Per the ment below by @alds, it does appear that JS Maps API v3 and Static Maps API are separate services, therefore having separate request limits. Falling back to a static Google map image could help.
This also explains the usage limits in better detail: http://googlegeodevelopers.blogspot./2011/11/understanding-how-maps-api-usage-limits.html
You cannot detect via the API that the request limit has been reached. There are no events that are fired and the API does not expose a function or property to determine that the API quota has been reached.
Google has decided that this is not a feature they will implement.
https://issuetracker.google./issues/35830575#ment12
@kilogauss I would disagree that falling back to static Google Map is not an option.
According to https://developers.google./maps/faq#usagelimits
"Web sites and applications using the Google Maps API may at no cost generate up to 25,000 map loads per day FOR EACH service" (capitalization and boldface mine).
And on https://developers.google./maps/faq#usage_pricing, you can see that JS Maps API v3 and Static Maps API are separate services.