Google sheets API v4: HttpError 429. "Resource has been exhausted (e.g. check quota)."

jason picture jason · Mar 11, 2017 · Viewed 8.7k times · Source

I have been updating about 1000 sheets using Python. Each takes about 2-3 minutes to update. The job ran most of the day yesterday (~8hrs). And when I look at my quotas for Google Sheets API in console.developers.google.com, I have used about 3k in the read group and 4k in the write group. Not nearly close to the 40k quota that is given.

Now all of the 1000 sheets interact with one sheet because all of the keys are on that one sheet.

In fact, I have tried using 2 different project sign ins, one through my company domain and one through my gmail, that both have access to these files. When I run it with the company credentials. It also gives me a HttpError 429, and 0 requests have been made with that credential.

Is there some hidden quota I don't know about? Like calls to one spreadsheet? That's what it seems like. Google, are you cutting me off to the spreadsheet because I accessed it for 8hrs yesterday?

It is bombing on spreadsheets().values().update and spreadsheets().batchUpdate

Answer

Rahul Satal picture Rahul Satal · Dec 20, 2019

The Google Sheets API has a below limits

  • 500 requests per 100 seconds per project,
  • 100 requests per 100 seconds per user.

Note that-

  • Limits for reads and writes are tracked separately.
  • There is no daily usage limit.

Reference: https://developers.google.com/sheets/api/limits