Google Maps Geocoding API Invalid Speed ​​Limit

I am adding a matching function to one of the internal tools used by my company. In short, we have a list of about 50 addresses that need to be placed on the map. I use Google Maps, so this is an interactive map and then the JavaScript API for geocoding and adding markers.

According to Google documentation , I am limited to 10 requests per second. So, I found that my javascript iterates over an array of addresses and puts a delay between each batch.

So, my function is configured with two confif variables that I can set: addressesPerBatch and timeoutPerBatch - it's pretty obvious what everyone should do. You might think that judging by the Google documentation, I would be allowed

addressesPerBatch = 10; timeoutPerBatch = 1000; //That in milliseconds 

I definitely do not. I hit my bid limit very quickly when I submit requests quickly. The sweet spot I found is actually around "

  addressesPerBatch = 2; timeoutPerBatch = 2000; 

So, is this a problem with my javascript or a Google speed limit problem?

I created jsfiddle so you can better understand what exactly I am doing: http://jsfiddle.net/Qt4gV/1/

+4
source share
2 answers

According to the answer to a similar question on the Google code page: "The geocoding API request rate limit should not be disclosed to minimize abuse of services." https://code.google.com/p/gmaps-api-issues/issues/detail?id=3099#c4

Like what @jwegner mentions in the comments, you need to check the returned status code and implement a permanent shutdown for the case of "OVER_QUERY_LIMIT".

+1
source

When I did large batches of geocoding, I did it in serial with a timeout of about 0.25 seconds between each request. This did not cause problems and is still fast enough. The database is updated too far than the geocoding request / response.

Also, if you have a Premier license, make sure that you follow the instructions to add a signature to the request or that your requests will be processed in the same way as you used the free license. I learned this hard way when I maximized my daily limit with a little test run on my development server!

0
source

All Articles