mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-10-11 09:10:45 +00:00
Added an explanation for rate/request limits to FAQ (#1133)
This commit is contained in:
2 files changed
+24
-1
No files matched your search
@@ -51,4 +51,26 @@ must be specified: `search("abba", market="DE")`.
|
||||
If you cannot open a browser, set `open_browser=False` when instantiating SpotifyOAuth or SpotifyPKCE. You will be
|
||||
prompted to open the authorization URI manually.
|
||||
|
||||
See the [headless auth example](examples/headless.py).
|
||||
See the [headless auth example](examples/headless.py).
|
||||
|
||||
### My application is not responding
|
||||
|
||||
This is still speculation, but it seems that Spotify has two limits. A rate limit and a request limit.
|
||||
|
||||
- The rate limit prevents a script from requesting too much from the API in a short period of time.
|
||||
- The request limit limits how many requests you can make in a 24 hour window.
|
||||
The limits appear to be endpoint-specific, so each endpoint has its own limits.
|
||||
|
||||
If your application stops responding, it's likely that you've reached the request limit.
|
||||
There's nothing Spotipy can do to prevent this, but you can follow Spotify's [Rate Limits](https://developer.spotify.com/documentation/web-api/concepts/rate-limits) guide to learn how rate limiting works and what you can do to avoid ever hitting a limit.
|
||||
|
||||
#### *Why* is the application not responding?
|
||||
Spotipy (or more precisely `urllib3`) has a backoff-retry strategy built in, which is waiting until the rate limit is gone.
|
||||
If you want to receive an error instead, then you can pass `retries=0` to `Spotify` like this:
|
||||
```python
|
||||
sp = spotipy.Spotify(
|
||||
retries=0,
|
||||
...
|
||||
)
|
||||
```
|
||||
The error raised is a `spotipy.exceptions.SpotifyException`
|
||||
Reference in new issue
Block a user