Reputation: 51
I have a daily running task that pulls down some metrics from the YouTubeAPI based a collection of products that I want to monitor the activity for. That collection of products tends to grow over time and I'd like to set up an alert for when I get close to exceeding my daily quota limit so that I can either make a quota increase request or reduce the collection's size rather than having a gap in my metrics if I hit the limit without realizing it.
Haven't found anything in the Google API documentation for being able to query your current quota consumption or even a way to set up an e-mail alert in the console itself.
I'm not opposed to having my task track its usage internally but would prefer getting those numbers directly from the API itself and try to avoid a potential bug on my end.
Upvotes: 3
Views: 619
Reputation: 7779
Well, AFAIK you cannot query it using an API request, but you can check your daily usage in the Developer Console. Just Go to the API you want to check, then on the Overview part you can check the traffic there. Then the total response code will tell you the total count that you make a request in this API.
For more information, check this documentation that tells you that:
You can see your current usage in the quota tab for your project in the Google APIs Console.
To view or change usage limits for your project, or to request an increase to your quota, do the following:
If you don't already have a billing account for your project, then create one.
Visit the Enabled APIs page of the API library in the API Console, and select an API from the list.
To view and change quota-related settings, select Quotas. To view usage statistics, select Usage.
Upvotes: 1