Google Maps API daily request limit reached - google-maps

I have enabled pay as you go pricing on my Google account and I am sending an API key with all my Google Maps Geocoding requests however I am still receiving this error message
You have exceeded your daily request quota for this API. We recommend registering for a key at the Google Developers Console
I have checked the quota page on the API dashboard and I am well below the limit of 100,000 per day. My key is only used for this geocoding script and this is not the same as the rate limit error which I sometimes receive.
Is there another limit I am unaware of? Can the quota page of the console be relied upon?

Unless you are doing 50 requests per second, calculated as the sum of client-side and server-side, you shouldn't have this problem.
" My key is only used for this geocoding script and this is not the same as the rate limit error which I sometimes receive."
what do you mean with this? are you using more than one API key?
which APIs are you using? only Geocoding?

Related

Google Maps Javascript API reporting I'm over limit

Google Maps Javascript API is reporting that I'm over the limit, but I'm pretty sure I'm not. I get this error:
You have exceeded your daily request quota for this API. For more information on usage limits and the Google Maps Javascript API services please see: https://developers.google.com/maps/documentation/javascript/usage
My Google API dashboard gives these numbers for the past day:
Google Places API Web Service: 407
Google Maps Geocoding API: 70
Google Maps JavaScript API: 30
What could be causing this? How can I get this up and running again, it is killing my application?
I came across your question because I am in the same position, seemingly well below the quota limits according to the console.
In the developer's console, go to the Dashboard, then click on the Google Places API Web Service. Then in the Quotas tab, scroll to the bottom and you'll see the Requests per Day. Here I was clearly reaching the 1000 requests per day limit, hence explaining the blocking of the requests.
We now count Google Maps JavaScript API client-side requests towards
the daily limit of the associated web service API.*
So it's the libraries=places and associated api usage (e.g. autosuggest in the search box) that is triggering this.

How do I monitor api request quotas or usage?

I am familiar with the Google API Console for monitoring requests quotas, but is there an endpoint or Google API Resource that I can query for poll to get current quota usage information for an enabled API, eg, Google Drive API?
AFAIK, there is no current API endpoint to get/poll the current quota usage information. As I previously mentioned in a related SO question, receiving quota related errors would help you know that you are reaching your quota for the API and that is where your error handling will take over.
To view the quota usage, access your developer console. And you are correct, it is viewable using the console. You can also see traffic ( number of request per seconds), and error ratio of the enabled API of your project.

Google maps GeoLocation API key isn't linking to my Google Developer account

I've looked everywhere to a solution for this, and I guess I've missed something obvious:
My web application (Civicrm 4.6.17) allows me to insert a Google GeoLocation API key for it's mapping and GeoLocation services. I've gone through the process described by Google GeoCoding Developer's guide:
setup a project,
got an API key,
Linked that key to my domain(s)
Even enabled billing for Pay as you go in case of over-limits.
Each step appeared to be successful. We have a project, we have an API key, we have billing enabled for it... all of this is reflected in the Google developer's console.
However, while we are processing 100s of GeoLocation requests per day, none are appearing in my project's Quota information. And we are hitting the 2,500 complementary limit.
What can I do to find out why the API key isn't linking to our Project?
Thanks for your help!
While the Google API has an unauthenticated limit of 2,500 requests per day per IP, using an API key currently gives a quota of 100,000 requests per day.
CiviCRM was not using the API key, but I've just opened an issue to address that here: CRM-18830: Google Geocoding - use SSL, restore API key.
Once that fix is merged (assuming it is), you should be able to geocode a larger number of addresses.

Google map client side(Google Maps JavaScript API) geocoding keep counting quota of all session?

I'm using Google Maps JavaScript API to load and search(geocoding) locations on map. As google suggests to use API key, I'm using the API key in my site so i can monitor the requests too.
Also google says;
Client-side geocoding will not face a quota limit unless you perform a
batch of geocoding requests within a user session. Therefore, running
client-side geocoding, you generally don't have to worry about your
quota.
But when I check the usage via Google Developer console, the request keep counting even i'm accessing and searching the location from different browsers(sessions). it seems that Google count all sessions geocoding requests into one place. is that mean, I get quota limit when it reaches 2500? or no need to warry about it as google says "you generally don't have to worry about your quota." or am I missing something?
Thanks.
From Geocoding Strategies-> Quota Considerations
Client-side geocoding through the browser is rate limited per map session,
so the geocoding is distributed across all your users and scales with your userbase. Geocoding quotas and rate limits drive the strategies outlined in this article.
And from Quota summary
Daily quota resets at midnight Pacific Time (PT).
Free quota 2,500 requests/day
Total quota 2,500 requests/day
Remaining 2,500 requests/day 100% of total
I desume you can use free only 2500 geocoding /day

Reached Limit using Google Geocoding Web Service

We have a page that accepts a city, state combination or a zip code. Upon submit, it passes that information to the Geocode Webservice for Google Maps and returns a list of store location results based on the information passed. We sporadically have issues with bots hitting that page multiple times and then Google shuts down our usage of the geocode webservice for the day. Is there a way to ask Google to restore this more quickly? How should we handle this?
Use the client-side geocoder, the limits there will be based on the client not the server.
Geocoding Strategies
As specified on in the documentation, "Use of the Google Geocoding API is subject to a query limit of 2,500 requests per day (User of Google Maps API for Business may perform up to 100,000 requests per day.)"
There's a nice article on Geocoding Strategies which discusses caching and other options to optimize geocoding. The "Quota Considerations" section should be useful.
Remember to use client-side geocoding if at all possible, so that the quota limit will be counted per client, instead of per service/server. If you're still hitting the limits, you might need to go for the Business version and pay for a larger limit.