0

I need to know how to reset the query limit for the Google Maps API v3. I know that I exceeded it more than three days ago, but it has not reset and I am still hitting it if I send more then 5 requests. How do I restore it completely to be able to get that 2500 (or whatever the request limit is) again?

I need to geocode some addresses and put them (lat, lon) into a database. I have done so far 2500 addresses. I need to do another 1000 and then it will be just one request on page load.

Kara
  • 6,115
  • 16
  • 50
  • 57
XFaktor
  • 167
  • 1
  • 2
  • 12

2 Answers2

6

According to the Google Geocoding API documentation, there are actually two limits. First of all, there is the 2,500 request per day limit, which you say you triggered a few days ago. However, there is also a separate rate limit, which is probably what you are hitting here.

The rate limit will prevent you from making many successive geocoding requests in a short time, which it seems is what you're trying to do. There is no way around this, since making 1,000 requests on a single pageload is not the intended use of the Google Geocoding API.

Additional, according to Google:

Note: the Geocoding API may only be used in conjunction with a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.

This probably means that your overall plan to use the Google geocoder and store the results in a database is a violation of Google's terms of service.

Rohan Singh
  • 20,497
  • 1
  • 41
  • 48
  • I was not able to think of other way to use geolocation for 5000 markers every request, so i stored them and just just putted them on the google map by one request of geolocation. hmmm ... fcuk,, what to do what to do ... – XFaktor Jan 24 '12 at 08:45
  • I mean how it is possible then to do it ? to upgrade to premium of google maps ? to use different domain and api key? :D (solution is not live it is just some test site for university).. – XFaktor Jan 24 '12 at 08:52
  • If you look at section 10.1.3 of their terms, they clearly prohibit bulk geocoding, pre-fetching, and storage. However, you could try contacting Google for a premium account and get specific provisions waived. Your mileage will obviously vary. – Rohan Singh Jan 24 '12 at 08:57
  • Personally, I would use a different geocoding service that is open to this sort of usage. MapQuest has a couple API's for this. Nominatim (http://developer.mapquest.com/web/products/open/nominatim) is the completely open one, and the licensed Geocoding API (http://developer.mapquest.com/web/products/dev-services/geocoding-ws) is available for community use as well. Both of them support bulk geocoding. – Rohan Singh Jan 24 '12 at 09:01
  • hmm i will be hard for me , and very time consumption to find out everything in this new service, maybe you have some kind of example how to get lat and lng from address by geocoding service you suggested ? i would be very appreciated. – XFaktor Jan 24 '12 at 09:19
  • I have tried to look at examples of that page but it has a lot of unnecessary code and etc. what i need is just function that i pass address to and get lat and lng inside it, google maps api seems to be more easier to understand then this. Can you give me some example of your ? :D thatnks – XFaktor Jan 24 '12 at 09:25
  • There are number of general samples at http://www.mapquestapi.com/geocoding/. However, I'm not an expert in the language I believe you're using (PHP?), so I can't provide you with any specific code for that. You may want to open a new question along the lines of "How do I do bulk geocoding against the MapQuest geocoder using PHP?", or something similar. Here is a similar question: http://stackoverflow.com/questions/396819/geocode-multiple-addresses – Rohan Singh Jan 24 '12 at 09:27
1

If (and only if) you are going to show the results & marker on a Google Map (required by ToS), then these articles would probably help you:

  1. Geocoding Strategies to make the right decision as to whether you need to use PHP (server-side) or JavaScript (client-side). It sounds like you're right to use PHP.
  2. Geocoding Addresses with PHP/MySQL to do the batch geocoding, provided your use case complies with the Terms of Use ;) -- mind the paragraph about Timing the Geocode Requests as Rohan points out your issue is likely that you're sending requests too fast.
miguev
  • 4,481
  • 21
  • 41