How to fix the "Service invoked too many times for one day: urlfetch" error? How to fix the "Service invoked too many times for one day: urlfetch" error? json json

How to fix the "Service invoked too many times for one day: urlfetch" error?


I had a similar issue even though I was only calling two fetch calls in my functions and each function per data row. It exponentially grew, and with my data changing, every recalculate call also called those functioned, which VERY quickly hit the max.
My solution? I started using the Cache Service to temporarily store the results of the fetch calls, even if only for a few seconds, to allow for all the cells triggered by the same recalculation event to propagate using only the single call. This simple addition saved me thousands of fetch calls each time I accessed my sheets.

For reference:https://developers.google.com/apps-script/reference/cache?hl=en