How do I monitor api request quotas or usage? - google-drive-api

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.

Related

Google Maps API daily request limit reached

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?

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.

Get google maps api usage info

we using some google maps api's, and we wan't to add gapi usage/quotas to our monitoring system. Does Console api has it's own api for retrieving that metrics?
Maybe other solutions?
There is no current API endpoint to get the current quota usage information of your API. The only way to check the quota used by your application is by checking your own Developer Console. You can also see here the 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.

How can I find my google drive service account usage limits?

I created service account to consume Google Drive REST API for domain wide delegation. But from document I came to know that there are some limits API consumption such as
Number of request per day per app.
Number of requests/second/user etc.
Now my questions are
How can I find these exact numbers of my google service account?
What are default numbers for free account?
Is these numbers vary from service account and install app type applications?
Can anyone one help me please?
Each request to the Google API will be counted. You can monitor your quota details from Google Developer Console.
APIs & Auth -> APIs -> Select the API -> Navigate to Quota tab.
Currently for the Drive API it reads "Courtesy limit: 1,000,000,000 requests/day". It's a per app quota.
After you've enabled the Drive API you can also set a per user rate limit (by default 100 req/sec) to prevent one user from depleting your app's quota. That's available in the "Quotas" tab.
There is also a link to request more quota in the "Quotas" tab in case you need more than the default 1B req/day.