Exceeded usage limits for Geocoding API
Asked Answered
W

5

9

When accessing the below link: http://maps.googleapis.com/maps/api/geocode/json

I get the response:

{
   "error_message" : "You have exceeded your daily request quota for this API.",
   "results" : [],
   "status" : "OVER_QUERY_LIMIT"
}

There are only two APIs listed in the Google Developers Console - both report they are under their usage limits.

Is the geocode service included in either of these and if not is there a way to check the useage or pay to upgrade?

Maps API v3 # of requests Daily quota: 25k 28-day total: 2.37k

Static Maps API # of requests Daily quota: 25k 28-day total: 45.21k

Thanks in advance, Jon

Wifehood answered 10/3, 2015 at 11:39 Comment(6)
Jon, if you are geocoding an address on the server side then the quota is 2500 requests/day. Are you geocoding server side, or client-side? I also hit this when I started with the Maps API V3, so I limited server side requests to the bare minimum and went client side as much as possible. also, are you including your api key in that url request, i.e. &key= ?Reparative
Hi Luke - Yes, server-side and we cache the results. I was under the impression from another discussion that passing the api key was only needed for business accounts?Wifehood
well i would try to eliminate any possibility. so i would type the request you're trying to make in the url bar, with and without the key, and see the response that you get. I'd also setup a new key and test with that one. another thing, are you maybe sending too many requests per second, because I know that google has a limit for that also?Reparative
The key allows google to separate your requests from those of all the other sites on your shared server... (guess, you are using a shared server)Grimbly
Are you accessing via a mobile browser? Relevant questionFunnelform
Hope it might help our developers https://mcmap.net/q/394025/-how-to-fix-error-quot-you-have-exceeded-your-daily-request-quota-for-this-api-quot-in-xml-file-google-mapsWindowpane
W
24

Thanks to luke_mclachlan for the fix.

The URL was missing the parameter for the API key e.g.

https://maps.googleapis.com/maps/api/geocode/json?key=AbCdEfGhIjKlMnOpQrStUvWxYz&address=Dallas&sensor=true

What was throwing us was that without the API key there seems to be a lower limit that we were hitting by about 2:30am which didn't appear in testing.

The API key used can be found in the Google Developers Console here: https://console.developers.google.com/project

Click your project name Then look on the left hand menu and click "Credentials" under "APIs & auth" The value "API KEY" is the same for all usages

Jon

Wifehood answered 11/3, 2015 at 11:12 Comment(1)
Thanks, this put me on the right track. However, it only worked for me when I put "&key=[API_KEY]" at the end of the string (source: developers.google.com/maps/documentation/geocoding/intro?hl=de)Rabelais
M
2

Parameter Key was missing.

https://maps.googleapis.com/maps/api/geocode/json?key=AbCdEfGhIjKlMnOpQrStUvWxYz&address=Dallas&sensor=true

key=AbCdEfGhIjKlMnOpQrStUvWxYz needs to be added .

Massa answered 6/4, 2018 at 6:37 Comment(0)
R
0

Not sure this is just related to the key query param missing. I see the same misleading API response when the &language=GB&region=UK was replaced by my app to instead query &language=GB®ion=uk. This is server based querying and the API access is authorised by API credentials stored with Google. The API returns:

"You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console"

Response seems to be the generic repsonse for a malformed query string than anything else, key parameter or otherwise.

Valid: https://maps.googleapis.com/maps/api/geocode/json?address=St%20Georges%20Avenue%20Sheerness%20ME12%201QU%20United%20Kingdom&language=GB&region=uk

Invalid: https://maps.googleapis.com/maps/api/geocode/json?address=St%20Georges%20Avenue%20Sheerness%20ME12%201QU%20United%20Kingdom&language=GBfoobar=uk

Reamy answered 26/7, 2018 at 12:20 Comment(1)
Looks like "&reg" is being encoded as "®" - try encoding the ampersand as & in that string. Your invalid string looks like it's missing an ampersand before "foobar=uk"Wifehood
R
0

In my case, I was passing '#' char in ?address=#202, Hollywood park. i removed # from the address api. May be google's api is breaking on spacial character especially #

Ritch answered 9/10, 2018 at 2:24 Comment(0)
F
0
ini_set('allow_url_fopen', 'on');
//ini_set('allow_url_fopen', '1');
$address=urlencode($address);


$address = str_replace(" ", "+", $address);
$json = file_get_contents("https://maps.google.com/maps/api/geocode/json?key=AIzaSyDq-gfJDoytQE6gj0iHXEy4IZQhgLS70-8&address=$address&sensor=true");
$json = json_decode($json);

$lat = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lat'};
$lng = $json->{'results'}[0]->{'geometry'}->{'location'}->{'lng'};
Flathead answered 12/10, 2018 at 20:48 Comment(1)
While this code block may answer the question, it would be best if you could provide a little explanation for why it does so. Please edit your answer to include such a description.Temekatemerity

© 2022 - 2024 — McMap. All rights reserved.