mirror of
https://github.com/spotipy-dev/spotipy.git
synced 2026-06-19 01:03:53 +00:00
Added an explanation for rate/request limits to FAQ (#1133)
This commit is contained in:
parent
ef282e2423
commit
5e09c78ccf
@ -14,6 +14,7 @@ Add your changes below.
|
||||
- Updated order of instructions for Python and pip package manager installation in TUTORIAL.md
|
||||
- Updated TUTORIAL.md instructions to match current layout of Spotify Developer Dashboard
|
||||
- Added test_artist_id, test_artist_url, and test_artists_mixed_ids to non_user_endpoints test.py
|
||||
- Added rate/request limit to FAQ
|
||||
|
||||
### Fixed
|
||||
- Audiobook integration tests
|
||||
|
||||
24
FAQ.md
24
FAQ.md
@ -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`
|
||||
|
||||
Loading…
Reference in New Issue
Block a user