Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Javascript API Geocoding Limits

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)

like image 916
cantaffordavan Avatar asked Nov 20 '13 05:11

cantaffordavan


People also ask

What are the usage limit for the Google Maps geocoding API web service?

While there is no maximum number of requests per day, the following usage limit is still in place for the Geocoding API: 50 requests per second, calculated as the sum of client-side and server-side queries.

What happens when you exceed the Google geocoding API rate limit?

If you exceed the per-day limit or otherwise abuse the service, the Google Maps Geocoding API may stop working for you temporarily. If you continue to exceed this limit, your access to the Google Maps Geocoding API may be blocked.

How many Google API calls are free?

max of 25,000 calls/day in total.

How much does Google Maps JavaScript API cost?

You get the equivalent of 200$ per month for free. The price of each request is stated here: https://cloud.google.com/maps-platform/pricing/. Once you have used 200$ worth of requests, you will have to start paying.


1 Answers

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.

like image 96
lambshaanxy Avatar answered Sep 26 '22 08:09

lambshaanxy