Getting Over Query Limit After One Request with Geocode

Google geocoding API limit after first OVER_QUERY_LIMIT

You are checking the documentation for web service. Indeed the web service has 10 QPS usage limit, but the client side implementation is different.

From JavaScript client side geocoder service you can execute a bucket of 10 requests immediately, after that the bucket refills at a rate 1 request per second. This is designed for human interactions, you cannot execute batch geocoding using client side service.

So this is expected behavior.

Geocode OVER QUERY LIMIT workaround

First a note about Google's Terms of Service

It's easy to not think about stuff like this, but it does matter sometimes. Unless you want to join this group from earlier today which for some reason had their service disabled, make sure that you are showing a map to the user as you geocode these addresses. The TOS also prohibit bulk geocoding and storing the results for anything other than performance caching.

Not accusing! Just bringing to attention.


The programmer answer:

setTimeout's callback and geocode are both asynchronous functions. Right now with your code, while the response is still coming back from the API, you're starting your 1-second timer which also runs asynchronously while your loop continues to iterate immediately with no delay. After one second, the no-op is called once then discarded. This happens each time the loop is run.

So you're shooting off a thousand API requests at once. Then about 1 second later (give or take a few milliseconds), 1,000 no-ops will run.

Your calls to g.geocode need to be inside the callback function of setTimeout, and then the end of the callback function will need to set another timeout with itself inside it, until you are done. No more no-op.

If you want to more correctly "work around" the OVER_QUERY_LIMIT errors and other TOS restrictions (like geocoding en masse), you'll want to consider a commercial service that doesn't have such limits, something like LiveAddress (disclosure: I work at SmartyStreets).

Google Geocoding API OVER_QUERY_LIMIT issue

The Geocoding API has a queries per second (QPS) limit. You cannot send more than 50 QPS.

This limit is documented at

https://developers.google.com/maps/documentation/geocoding/usage-and-billing#other-usage-limits

While you are no longer limited to a maximum number of requests per day (QPD), the following usage limits are still in place for the Geocoding API:

  • 50 requests per second (QPS), calculated as the sum of client-side and server-side queries.

In order to solve your issue I would suggest using the Python client library for Google Maps API Web Services:

https://github.com/googlemaps/google-maps-services-python

This library controls QPS internally, so your requests will be queued properly.

I hope this helps!

Google Maps V3 API - Over Query Limit, but just 1 request

It seems like the reason this is happening is because I have the request as part of my php code, as such it's using my hosting providers (rackspace) ips for the request and they have reached their limit for the day based on what other people are doing.

The solution for avoiding this is to have the request sent by the client side using javascript so it's processed by the users browser and whatever ip they're currently using.

Hopefully the solution can help someone else.

getting OVER_QUERY_LIMIT geocoder.geocode

Since you are encountering an OVER_QUERY_LIMIT response code while using some JS service, you may be encountering the limit per user session. There's a note under the usage limits documentation saying:

Service requests are rate-limited per user session, regardless of how
many users share the same project.

See the Maps Javascript API Services limits.

Try to include a delay such as setTimeout() or consider using Google Maps Geocoding API for batch requests.

For this kind of issue, you can also file it at Google Public Issue Tracker.

Issue Tracker is a tool used internally at Google to track bugs and
feature requests during product development. It is available outside
of Google for use by external public and partner users who need to
collaborate with Google teams on specific projects.

To learn more, you can check Issue Tracker.

Google Maps API OVER QUERY LIMIT per second limit

The geocoder has quota and rate limits. From experience, you can geocode ~10 locations without hitting the query limit (the actual number probably depends on server loading). The best solution is to delay when you get OVER_QUERY_LIMIT errors, then retry. See these similar posts:

  • OVER_QUERY_LIMIT in Google Maps API v3: How do I pause/delay in Javascript to slow it down?

  • How do I Geocode 20 addresses without receiving an OVER_QUERY_LIMIT response?



Related Topics



Leave a reply



Submit