Reputation: 13
I'm using Google geocoding API to geodcode a number of addresses. So what I've done is I make requests sequentially and once I get a OVER_QUERY_LIMIT status I chill for 1.5s and then I continue.
According to the documentation (https://developers.google.com/maps/documentation/geocoding/usage-limits) I should be able to make 10req/s and that is true for the first requests but once i hit the limit for the first time I can only do like 2-3 request before I get OVER_QUERY_LIMIT again. With 10req/s I would have thought I could make 20req/2s, 30req/3s and so on but that does not seem to be the case.
Am I missing something or is this the expected behaviour?
Would I have the same behaviour if I got a premium account? So I get 50req for the first second but then the limit would decrease?
EDIT: This is what my geocoding request looks like
var geocoder = new google.maps.Geocoder();
geocoder.geocode({'address': address}, function(result, status) {
if(status === google.maps.GeocoderStatus.OK) {
// Yippee
} else if (status === google.maps.GeocoderStatus.OVER_QUERY_LIMIT) {
// Wait 1.5s then retry address
} else {
// Crap!
}
}
Upvotes: 1
Views: 887
Reputation: 32158
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.
Upvotes: 2