You loop over your data and write it to a Google Sheet, and after a few dozen calls:

gspread.exceptions.APIError: APIError: [429]: Quota exceeded for quota metric 'Write requests' and limit 'Write requests per minute per user' of service 'sheets.googleapis.com' 

A time.sleep(1) did not fix it, or it fixed it and now the job takes hours. This is what is going on.

What Google counts

Google's Sheets API usage limits page lists, for both reads and writes: 300 requests per minute per project and 60 requests per minute per user per project. Read and write each have their own bucket. A batchUpdate request counts as one request, however many operations it contains. Google's advice for a 429 is exponential backoff. (Limits change, so check the page.)

Three consequences:

  • The unit is the request, not the cell. One cell and one 60,000-cell block both cost one request.
  • The binding limit for a script is usually the per-user one: 60 per minute. A service account counts as one user.
  • It is a speed limit per minute, not a ban. Without retry code a throttled job simply crashes.

The arithmetic

Writing a 5,000-row, 12-column table:

How you write it Requests Minimum time at 60/min
update_cell in a double loop 60,000 about 1,000 minutes
append_row in a loop 5,000 about 84 minutes
one block with ws.update 1 under a minute

Layer 1: make fewer requests (this fixes most 429s)

import gspread gc = gspread.service_account(filename="service_account.json") ws = gc.open_by_key("YOUR_SHEET_ID").worksheet("Data") rows = [["date", "usd"], ["2026-10-27", 1.115]] # your whole table as a list of lists ws.update(values=rows, range_name="A1", value_input_option="USER_ENTERED") # one request 

Note the argument order of gspread 6: values first, then the range. Also read once (ws.get_all_values()) and work in memory: every ws.cell() and ws.col_values() call is a request. To add rows below existing data in one request use ws.append_rows(rows, value_input_option="USER_ENTERED").

Layer 2: slow down on purpose

A well-batched job can still exceed 60 a minute when it touches many tabs. Keep a small sliding window and sleep when you are about to go over (55 calls per 60 seconds leaves headroom under the documented 60).

import time from collections import deque class PerMinuteLimiter: def __init__(self, max_calls=55, window=60): self.max_calls = max_calls self.window = window self.times = deque() def wait(self): now = time.monotonic() while self.times and now - self.times[0] >= self.window: self.times.popleft() if len(self.times) >= self.max_calls: time.sleep(self.window - (now - self.times[0])) return self.wait() self.times.append(time.monotonic()) limiter = PerMinuteLimiter() # 55 calls per 60 seconds # before every Sheets call: limiter.wait() 

Layer 3: retry politely, with backoff and jitter

import random, time, gspread def call_with_backoff(fn, *args, tries=8, **kwargs): for n in range(tries): try: return fn(*args, **kwargs) except gspread.exceptions.APIError as e: if e.code not in (429, 500, 502, 503, 504) or n == tries - 1: raise # not retryable, or out of attempts time.sleep(min(2 ** n + random.random(), 64)) limiter.wait() call_with_backoff(ws.update, values=rows, range_name="A1", value_input_option="USER_ENTERED") 

Two details that matter:

  • Retry only what is worth retrying. A 403 "permission denied" or a 404 will never fix itself; retrying hides the real problem. e.code comes from the JSON error body; for a normal Sheets 429 it is the integer 429.
  • Wait longer than one quota window. A per-minute quota needs about a minute to recover. In my own test with one Cloud project, writes became possible again between under 10 and about 130 seconds after a burst (usually 40 to 60; about eight trials). A version that gave up after six retries (about 66 seconds in total) failed in three of those trials. Your numbers will differ, but eight retries with a 64-second cap is a safer default than three.

The jitter (the random.random()) stops many jobs from retrying at the same instant.

Estimate before you run

A job with more than about 50 requests per run needs a redesign, not more retries. Open the spreadsheet by ID (1 request), read each tab once, write each output block once, and put all formatting changes in one batchUpdate.

Free one-page checklist for the three things that most often kill a scheduled Sheets script (the 7-day invalid_grant, 429 Quota exceeded, duplicate rows): https://whop.com/whop-0bab/day-8-checklist-python-google-sheets-free/

Disclosure: I also sell a short fix pack with tested helpers for those three (EUR 9): https://whop.com/whop-0bab/python-google-sheets-fix-pack/, and a larger starter kit: https://whop.com/whop-0bab/python-google-sheets-running-on-autopilot-the-starter-kit/ . Everything in this post works without them.