Google maps api v3, query limit exceeded more then

2019-08-26 19:18发布

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.

2条回答
Anthone
2楼-- · 2019-08-26 19:50

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.

查看更多
再贱就再见
3楼-- · 2019-08-26 19:53

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.
查看更多
登录 后发表回答