Google-maps – Google Javascript API Geocoding Limits

geocodinggoogle mapsgoogle-maps-api-3

What are the limits for client side geocoding with Google Maps JavaScript API v3?


My research:

  1. Google Maps PHP API has a limit of 2500 geocode requests per day (https://developers.google.com/maps/documentation/geocoding/#Limits)
  2. Google Maps Javascript API v3 has a limit of 25000 map loads per day (https://developers.google.com/maps/documentation/javascript/usage)
  3. Google suggests using javascript API for geoocoding to avoid the 2500 limit through the PHP API. It states "running client-side geocoding, you generally don't have to worry about your quota" (https://developers.google.com/maps/articles/geocodestrat#client)

However, nowhere does it state in any of the documentation what the geocoding limits are through the Google Maps JavaScript API v.3.

(This has been bothering me for a while, and I have researched it on more than one occasion and failed to find a solid answer)

Best Answer

I work in Maps for Business support at Google. The following is my personal opinion, not Google's, but let's just say I'm rather familiar with this topic!

First, it's important to distinguish between client-side geocoding (JavaScript calls to google.maps.Geocoder) and server-side geocoding (HTTP requests to /maps/api/geocode). This question and answer are specifically about client-side geocoding; for server-side limits, see here. In particular, the oft-mentioned 2,500 requests per IP per day limit applies only to server-side geocoding, not client-side.

So the short answer is, there is no documented query limit specifically for client-side geocoding. Once a client has loaded the Google Maps JavaScript API library, it can make as many geocode requests as it likes, provided they're done at a sane speed. Two rules of thumb to ensure you don't run into problems:

  1. Initiate geocoding in response to user interaction, and you'll be fine even if there are short request bursts (eg. click a button to geocode several addresses).
  2. Catch any OVER_QUERY_LIMIT errors and handle them gracefully (eg. exponential backoff). Here is some sample code in Python.

But please do not try to busy-loop the geocoder or hammer away at it for hours on end, there are protections against abuse.

UPDATE

As of 2017 the client side quota is calculated against corresponding web service quota. Please have a look at Christophe Roussy's answer.

Related Topic