question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GSpread Error 429

See original GitHub issue

Important: Please do not post usage questions here. To get a quick response, please ask a question on Stack Overflow using gspread tag. See existing questions: https://stackoverflow.com/questions/tagged/gspread


Describe the bug A clear and concise description of what the bug is.

Error I am getting when clearing and then updating 15 Sheets. Roughly 1000 rows and 10 columns for each in a loop.

Do i need to add a backoff is there a way around this?

To Reproduce Steps to reproduce the behavior: 1. 2. 3.

Expected behavior A clear and concise description of what you expected to happen.

Code example* If applicable, provide a code example to help explain your problem.

Screenshots If applicable, add screenshots to help explain your problem.

Environment info:

  • Operating System [e.g. Linux, Windows, macOS]:
  • Python version
  • gspread version

Stack trace or other output that would be helpful

Additional context Add any other context about the problem here.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lavigne958commented, Jul 16, 2022

Hi we recently introduced a new BackOffClient and a way to use it in gspread with almost no changes.

You can now use the following code to make any requests go through the back-off client. The client will retry exponentially until it reaches some limits to make sure the client is not stuck in a loop.

use the following syntax:

gc = gspread.service_account(client_factory=BackoffClient)

or

gc = gspread.oauth(client_factory=BackoffClient)

closing this issue.

1reaction
burnashcommented, May 6, 2020

Yeah, I’ve started getting 429 recently while running the test suite and implemented a derived Client class very similar to the monkey patched in dbdf85a386b6aecac52ec168420f2307409ef307

I haven’t yet made up my mind if this should be the default behavior in gspread. The problem is that it may not be clear to gspread users how many requests each method produces (see #770) which may lead to inefficient code that fetches values from single cells in a loop.

The OP says:

Roughly 1000 rows and 10 columns for each in a loop.

@AETDDraper could you please share a snippet of the code you’re running?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to deal with gspread quota exceded, error 429
Have you tried to increase your time. · Actually, it is way more than the quota limit. · You could also place a...
Read more >
Code 429: Quota exceeded for quota metric 'Read requests'
After some small successful test, I added more records to the sheet to test. Then the program run halfway and gave me this...
Read more >
[Code example]-Gspread quota exceded, error 429 - Python
I'm doing a bot to put the result of a website in a sheets with the Google Sheets API. But I received the...
Read more >
What could cause 429 errors in Google Sheets? - Super User
The HTTP status of 429 means “Too many requests.” As explained here, the HTTP status code means too many requests are being made:....
Read more >
Usage limits | Google Sheets
If your app sends 350 requests in one minute, the additional 50 requests exceed the quota and generates a 429: Too many requests...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found