pyfy
pyfy copied to clipboard
Rate limiting
I keep on getting 429 errors using this for my app, is there any built in rate limiting for outgoing requests using the sync client?
Unfortunately, there isn't. We can use an exponential backoff strategy on any 429 errors as recommended by Spotify here: https://developer.spotify.com/documentation/web-api/#rate-limiting We can use this lib: https://pypi.org/project/backoff/ I'm open for pull requests if you're willing to fix this issue.
I ended up using a try/except and retrying the api call after the Retry-After time. Will check backoff out, thanks!