Help Wizard

Step 1


Who Me Too'd this topic

Too Many Requests (429 Error) - blocked for 13 hours


Premium Family


United States


Macbook Pro M1 2020

Operating System

MacOS 13.3.1


My Question or Issue

I am running a Python script I wrote that uses the spotipy library to make Web API requests. My script will make a single request to search for a track, then wait 1 second, then make another request. I am trying to do this for about 34,000 tracks. After about 24,000 requests over the course of about 12 hours, my script stopped running. I then made a manual API request with a curl command, and saw that the response stated "Too many requests", with `retry-after: 39437` in the header (asking to retry after about 13 hours).


The only documentation I can find about rate limits suggests that Spotify rate limits are calculated on a rolling 30 second basis. I have no idea why my script was succeeding for 12 hours straight, only to suddenly be blocked, unless there's also some daily limit in place.


What is the actual rate limit policy? I need to know so that I can avoid hitting the rate limit again in the future.

Who Me Too'd this topic