Quota on time-based gscript tiggers - google-apps-script

I have got a script that I need to run periodically (preferably once every half hour). I have made an hourly trigger, but I'm not sure of the limitations on how many times this can be run in a day without hitting the quota for my standard Gmail account.
I have found the "Quotas for Google Services" page, however, I'm not sure what category it falls under and therefore how many triggers I can have daily.

Regarding the use of triggers, from https://developers.google.com/apps-script/guides/services/quotas
Feature
Consumer (e.g., gmail.com) and G Suite free edition (legacy)
Google Workspace accounts
Triggers total runtime
90 min / day
6 hr / day
Please bear in mind that other quotas might apply too.

Related

When does Google Apps Script reset the daily quota?

Daily quotas for Google services are described here. For example 100 email recipients per day. How is "day" defined when evaluating the quota? Does the quota get reset when it's midnight in my time zone? Or in Greenwich? Or do they count the statistics of the past 24 hours with a sliding time window?
For Apps Script it's seems no resource to get such info.
But you can check Google Cloud quotas help page to get an idea on how Google calculates per day quotas:
For per-day rate quotas: The Current usage is the total usage for far in the current 24-hour period for day-rate quotas.
Also see this related questions on when non-Apps Script quotas reset:
When does the daily error limit for the analytics API reset?
Google API: Quota Limit Reset Times and Timezone
The answer you are looking for is currently written here in this reference article:
Limits per day are applied over a rolling 24-hour period, not a set time of day.
So basically, quota limits are restored over a set of 1-24 hours starting from the recent period that it was depleted.
And, aside from that, these quota limits are not subject only to App Script, rather than the service quota it uses by their Google Service is all used by their designated quota reserve as explained here:
Note: In addition to the Apps Script quotas, some features have quotas created by the Google product they're associated with. A use of a product feature in Apps Script depletes all associated quota reserves. A feature becomes unavailable if any of the associated quotas are reached.
Side note:
As mentioned by CizRanger, the two conditions below are the requirements needed for you to increase your quota limits if you are using a Google Workspace account:
Your domain has cumulatively paid at least USD 100 (or equivalent)
At least 60 days have passed since reaching that payment threshold
This is a really good question!
Based on my experience the Quota reset for certain quotas is reset within 24 hours right after the last run of your script.
Moreover, you need to keep in mind that if you have a trial Google Workspace (After you convert from a free trial account to a paid subscription) this means that you need to:
1-Your domain has cumulatively paid at least USD $100 (or equivalent).
2-At least 60 days have passed since reaching that payment threshold.

Even after waiting more then 24 hours i still get error "Exception: Service invoked too many times for one day: urlfetch." [duplicate]

we use a custom script to retrieve data from Bookeo API with UrlFetchApp.fetch. µ
Everything went well but today, we have the following error "Service invoked too many times for one day: urlfetch"
We are aware of the limitation of 20.000 calls/day as mentionned here https://developers.google.com/apps-script/guides/services/quotas, but we don't think that we come close to this (maybe 1.000 - 1.500/day max)
The portion of the code where the error happen is
var responseBooking = UrlFetchApp.fetch(urlBooking);
So i'm sure it's related to quota issue
The weird thing is it's working like 1 time / 5-6 try
My questions are :
has Google changed it's quota limitation? (I didn't see any communication about it)
Is there a way to see how many calls was made for each service?
Is there a sort of chat for technical support for Google Apps Script?
Answer(s):
has Google changed it's quota limitation? (I didn't see any communication about it)
No.
Is there a way to see how many calls was made for each service?
No.
Is there a sort of chat for technical support for Google Apps Script?
No.
More Information:
Aside from the 20,000 calls/day limit, there are also limits which restrict the number of calls in short periods of time.
The quota works based on a rolling average of service invocations. You have a quota of 20,000 per day, but if you exceed the rate of ~0.231 calls per second (20,000/86,400) for a sustained period of time, you can still trigger an error.
You can rectify this by waiting for a while so that the impulse of invocations goes down. I would also suggest adding some form of exponential backoff to your code to stop this from happening again in future.
References:
Quotas for Google Services | Apps Script | Google Developers
Exponential backoff - Wikipedia

Service invoked too many times for one day: urlfetch - Pretty sure quota not exceeded

we use a custom script to retrieve data from Bookeo API with UrlFetchApp.fetch. µ
Everything went well but today, we have the following error "Service invoked too many times for one day: urlfetch"
We are aware of the limitation of 20.000 calls/day as mentionned here https://developers.google.com/apps-script/guides/services/quotas, but we don't think that we come close to this (maybe 1.000 - 1.500/day max)
The portion of the code where the error happen is
var responseBooking = UrlFetchApp.fetch(urlBooking);
So i'm sure it's related to quota issue
The weird thing is it's working like 1 time / 5-6 try
My questions are :
has Google changed it's quota limitation? (I didn't see any communication about it)
Is there a way to see how many calls was made for each service?
Is there a sort of chat for technical support for Google Apps Script?
Answer(s):
has Google changed it's quota limitation? (I didn't see any communication about it)
No.
Is there a way to see how many calls was made for each service?
No.
Is there a sort of chat for technical support for Google Apps Script?
No.
More Information:
Aside from the 20,000 calls/day limit, there are also limits which restrict the number of calls in short periods of time.
The quota works based on a rolling average of service invocations. You have a quota of 20,000 per day, but if you exceed the rate of ~0.231 calls per second (20,000/86,400) for a sustained period of time, you can still trigger an error.
You can rectify this by waiting for a while so that the impulse of invocations goes down. I would also suggest adding some form of exponential backoff to your code to stop this from happening again in future.
References:
Quotas for Google Services | Apps Script | Google Developers
Exponential backoff - Wikipedia

Can I pay to increase my Google App Scripts Quota Limits?

We have a very complex core banking system using MongoDB and Google Sheets, and we are hitting the Google Apps Script quota limits and getting timeouts daily. We are looking at optimizing where we can, but I need to know if there is a way that I can increase the limits somehow in the meantime (don't mind paying more).
I have looked at the Early Access Program, but it says that they aren't taking any more new members.
Any ways that I can increase the limits?
Yes, you can
If you have a look at the Apps Script Quota information, you will see that the limits depend on the type of account you have.
If you have a free account, it means that most likely it is a Customer Account.
You can upgrade to either G Suite Basic, G Suite Business or G Suite Enterprise - depending on how much you need to increase your quota and how much you are willing to pay.
See here for more information about different accounts and pricing.

urlFetch terms of service and quotas - using Google Docs to monitor website uptime

I've been making improvements to a Google Docs spreadsheet (and the underlying script) that monitors websites for uptime/downtime. You can see a description and copy the spreadsheet here: http://agileadam.com/google-docs-uptime-monitor
I'm a web developer and need to monitor the uptime of 199 (the number will grow) websites. This is an accumulation of many years of development - all sites we control. So, I had a 5 minute time-driven trigger that ran my function, which loops through every URL and checks the HTTP status using urlFetch.
I have two questions:
Is this a violation of the Google Docs TOS?
At 5:57am I got a message: "Exception: Service invoked too many times for one day: urlfetch." According to https://docs.google.com/macros/dashboard the limit is 20,000 for my account. According to my calculations I should have only been around 14,000 uses. Why did it bomb out on me?
I am going to remove many of the domain names that are similar (I suppose I don't NEED to monitor .com and .org for the same site) and I've changed my trigger to run every 15 minutes. This will reduce the number of executions considerably.