Google Custom Search API use which timezone for counting the daily quota? - google-custom-search

Google Custom Search API has a free quota for 100 queries per day, so what timezone is used by the API for counting the daily quota?
GMT or my server setting or other?

It used Pacific time to reset api key quota https://time.is/PT

You can go to your quota page, https://console.cloud.google.com/apis/api/customsearch.googleapis.com/quotas and it says "Daily quotas reset at midnight Pacific Time (PT)."
Even if you are in Europe or use a language that is not US English, Google's daily quota still uses Pacific Time.
However, I wonder if it is really reset at 00:00 PT. I think it's been 24 hours since I used up the daily quota of a project, the usage now is still 100%. Weird.

Google Custom Search API has a free quota for 100 queries per day, so what timezone is used by the API for counting the daily quota?
answer is GMT

Related

Is it possible to increase the Google Sheets API quota limit beyond 2500 per account and 500 per user?

The problem: Running into Google Sheets API read/write quota limits. Specifically, the read/write requests per 100 seconds and read/write requests per 100 seconds per user quotas.
Some background:
For the past few months I've been developing a web app for students and staff in our school district which uses a Google spreadsheet as the database. Each school in our district was assigned a different Google spreadsheet, and a service account was created to make read and write calls to these spreadsheets on behalf of the web app.
We started with one school of approximately 1000 students, but it has now expanded to two other schools with a total user load of around 4000. Due to the nature of a school day schedule, we started hitting our quota limit (per 100 sec & per 100 sec per user) since almost everyone uses the app at the same time.
I found the usage limits guide for the Google sheets API, and as per the instructions I created a billing account, and linked the associated service account project to it. I then went to the quotas section in the developers console and applied for a higher quota. This involved filling out a Google form which asked "How much quota do you need? Express in number of API queries per day." Again, queries per day is not the problem, rather it's the number of queries per 100 seconds and per user (service account). After a couple of weeks our limit was increased to 2500 read/write requests per 100 seconds and 500 read/write requests per 100 seconds per user. The billing account was not charged, and after a little searching, I realized this was a free increase. This bump in our quota limit helped, but it's still going to be an issue because our district wants to add more schools in the future.
Here's what I need to know:
1) [ESSENTIAL QUESTION] Does Google have an upper limit or maximum to the number of read/write requests a single service account/user/IP can make within the 100 second time frame, and if so what is it?
2) If it is possible to go beyond our current quota limit (2500/500), is there another way of requesting/applying for the increase. Once again we have a billing account established for the project and are willing to pay for the service.
I've been pulling (what's left of) my hair out trying to find definitive answers to my questions. This post came close to what I was looking for, and I even did some of the things the OP suggested, but I just need a direct answer to my "essential" question.
Couple more things.
I understand that Google Charts Visualization doesn't have a quota limitation, and I'd consider using it however, for privacy reasons I can't have the spreadsheet keys exposed in plain javascript. Are there other options here?
Also, one might suggest creating multiple service accounts, but I'd rather avoid this if possible.
Thank you for your help. I'm very much a novice and I greatly appreciate your time and expertise.
To answer your questions:
1) [ESSENTIAL QUESTION] Does Google have an upper limit or maximum to the number of read/write requests a single service account/user/IP can make within the 100 second time frame, and if so what is it?
*The provided documentation only stated that Google Sheets API has a limit of 500 requests per 100 seconds per project, and 100 requests per 100 seconds per user. Check this post for additional information.*
2) If it is possible to go beyond our current quota limit (2500/500), is there another way of requesting/applying for the increase. Once again we have a billing account established for the project and are willing to pay for the service.
AFAIK, you can request for a higher quota limit and the Google Engineers may grant the request as long as you are making a reasonable request.
Also, you may check this thread for additional tips:
You can use spreadsheets.get to read the entire spreadsheet in a single call, rather than 1 call per request. Alternately, you
can use spreadsheets.values.batchGet to read multiple different
ranges in a single call, if all you need are the values.
The Drive API offers "push notifications", so you can get notified when changes occur and react to those, instead of polling for
them. The latency of the notifications is a little on the slow side,
but it gets the job done.

How does Google define "day" for Google API quotas?

Google Cloud Translate API, for example, sets a default quota of 2 million characters "per day".
However, I can't find their definition of "day" anywhere.
Is this calendar-based, or is it a sliding time interval?
(Observation suggests that it is a sliding time window.)
If calendar-based, when does each day begin?
Is this immutable or does it vary?
Can developers set the start or end time of a project's "days"?
If it is a sliding window, can developers reset it? This could help us manage usage that comes in bursts, and could help us test limiting situations.
Thanks in advance for any information you can provide.
I found one answer in Google's online documentation, and it is specific to the Google Analytics API.
This API's daily quota is calendar-based and immutable:
Daily quotas are refreshed at midnight Pacific Standard Time.
From: Google Developers | Analytics Real Time Reporting API | Limits and Quotas on API Requests
I assume that this definition probably applies to the other Google APIs, as well.

How is rate-limit in Azure API Management calculated

In Azure API Management , rate and quota limit both have a renewal-period configuration.
For eg.
renewal-period is defined as "The time period in seconds after which the quota resets."
My question is, when does the quota start , does it start from the first second of lets say 0000 GMT or is calculated from first request or is a rolling window.
Apigee has a very documentation of quota rate counters as documented here
Can someone explain how azure calculates it ?
Rate limiting is using sliding window. Quota is using fixed window. We will update the documentation - thanks for the feedback!

Exceeding the API quota -- consequences?

We use the free API for a simple 501C3's map. Usually our geo-coding usage is quite low, but a change we made [oops] triggered all >2500 records to re-request.
We can wait the 24H "timeout" imposed.
Our concern is will Google log this as abuse? Do we need to write code to cap our geocode usage at 2499/day in case of a future event?
Google doesn't consider daily over quota as abuse. You can trigger anti abuse systems in case if you are sending too many queries per second from the same IP address as far as I know, but if your QPS is within allowed 50 queries per second you should be OK. Daily quota is reset automatically, so you should just wait until 0:00 PDT when the reset is typically happen.

What Is The Time Range For Google Analytics Real Time API

I'm having no issues using the API with PHP, but when I look at my dashboard on Google Analytics, it says I have 1 real time user, but the data I get back from my API call shows far more than that. This leads me to believe this is over a period of time. What is the time period it is calling? The last 15 mins, 30?
Thanks for your help!
For real time reports, the session duration of a user is 5 minutes. More info can be found here https://support.google.com/analytics/answer/1638635?hl=en under "Active User Metrics". I'm not sure if this would be any different if the data was accessed through the API though.
I discovered that the answer is 30 minutes. Realtime displays pageviews back 30 minutes, not as a snapshot as I had thought.