I have a problem while acessing google maps from my application, when i send more than 10 requests in loop from java script i get the exception as OVER_QUERY_LIMIT from geocoder service. is there any way that i can get rid of this, i tried giving some time delays using setInterval() etc.. .but doesnt work.
-
possible duplicate of [How do I Geocode 20 addresses without receiving a OVER_QUERY_LIMIT response?](http://stackoverflow.com/questions/2419219/how-do-i-geocode-20-addresses-without-receiving-a-over-query-limit-response) – Gilles 'SO- stop being evil' Jun 28 '11 at 09:03
-
In this question I propose an answer which will keep sending requests until they are all successful: http://stackoverflow.com/questions/7649155/avoid-geocode-limit-on-custom-google-map-with-multiple-markers/7651681#7651681 – Jack B Nimble Oct 04 '11 at 17:27
-
Look here: http://stackoverflow.com/questions/16659398/google-maps-over-query-limit – user2403424 May 25 '13 at 22:08
-
Possible duplicate of [How do I Geocode 20 addresses without receiving an OVER\_QUERY\_LIMIT response?](https://stackoverflow.com/questions/2419219/how-do-i-geocode-20-addresses-without-receiving-an-over-query-limit-response) – Haswin Mar 16 '18 at 08:42
6 Answers
Probably you are sending too many requests per second and Google doesn't let you do that.
Read http://code.google.com/apis/maps/faq.html#geocoder_classorhttp

- 730,956
- 141
- 904
- 1,278

- 18,934
- 9
- 36
- 50
Geocoding in the JavaScript API is rate-limited. When you first load the API, you can send 10 requests for address geocoding or 5 for reverse (latlng) geocoding before you get an OVER_QUERY_LIMIT response. When you do, use "exponential backoff" to delay your queries.
You may also want to join the discussion in Issue 4805 (gmaps-api-issues).

- 4,481
- 21
- 41
If you are using an autocomplete, try using Google's Places Autocomplete API. (Even though this isn't exactly what he asked, I assume many will arrive here from this question)

- 1,558
- 1
- 11
- 25
Have a list of API's and use them randomly for each request . For Example in python
like keys = [key1,key1,key3....]
location = Geocoder(random.choice(keys)).geocode(address)
or
location = Geocoder(random.choice(keys)).reverse_geocode(Lat,Long)
Based on your Requirement
We can use ajax queue.
At a time 20 ajax request will get executed and others will wait in the queue.
Create multiple geocode key and keep in an array and use it randomly for each ajax request.
Here I have loaded 2200 markers. It takes around 1 min to add 2200 locations.
<https://jsfiddle.net/suchg/qm1pqunz/11/>

- 3,351
- 10
- 31
- 48

- 177
- 6
-
This solution may be against the ToS, [paragraph 10.4b](https://developers.google.com/maps/terms#10-license-restrictions) – xomena Nov 07 '16 at 11:05
First read this article. https://developers.google.com/maps/premium/previous-licenses/articles/usage-limits
If you are send many request in one second then use delay method.
function sleep(milliSeconds) {
var startTime = new Date().getTime();
while (new Date().getTime() < startTime + milliSeconds);
}
call this method in your loop structure. sleep(2200);

- 107
- 1
- 9