Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get HTTP 429 and error Max Retries, reason: too many 500 error responses when trying to fetch saved tracks. #1093

Open
K4LCIFER opened this issue Apr 30, 2024 · 5 comments
Labels
api-bug A bug in the Spotify API, not in the library itself question

Comments

@K4LCIFER
Copy link

K4LCIFER commented Apr 30, 2024

I have something similar to the following:

import spotipy
from spotipy.oauth2 import SpotifyOAuth

scope = "user-library-read user-read-recently-played"

sp = spotipy.Spotify(auth_manager=SpotifyOAuth(client_id="<client-id>", client_secret="<client-secret>", redirect_uri="http://localhost/", scope=scope))

print(sp.current_user_saved_tracks(market="US", limit=1))

But running this results in the following error

spotipy.exceptions.SpotifyException: http status: 429, code:-1 - /v1/me/tracks?limit=1&offset=0&market=US:
 Max Retries, reason: too many 500 error responses

This might be an error on Spotify's end, because, in the Spotify Web API docs, their API tester also errors out when attempting a similar request. Perhaps #1024 is related (I also have a lot of songs — approximately 40k)?

@dieser-niko
Copy link
Member

You could try posting to the Spotify Community forum with the same question.

Your script seems to be fine, and you said yourself that it wasn't working in the documentation, which suggests that this is not a problem with spotipy.

@K4LCIFER
Copy link
Author

K4LCIFER commented May 2, 2024

You could try posting to the Spotify Community forum with the same question.

I have, but, unfortunately, the post never received a response. I have emailed Spotify's support back and forth, a few times, but I've yet to find a solution.

@dieser-niko
Copy link
Member

That doesn't sound promising. I'll leave this issue open, even though this problem is not caused by spotipy. If there are any updates, please post them here.

I've also been experimenting a bit myself. First I created a playlist, because it's much easier to fill a playlist with a bunch of songs. Got up to 11,000, but no errors yet. Then I used my second account and around the 24,000 mark I got a code 500 with a "server error" message. So only partially reproducible, as I didn't get the same error you did.
Not sure why I did this because it was clear to me that I couldn't fix anything about it, but yeah.. At least partially reproducible.

@dieser-niko dieser-niko added the api-bug A bug in the Spotify API, not in the library itself label May 3, 2024
@JosepVargasf
Copy link

That response indicates that you have reached the rate limit of spotify API.

https://developer.spotify.com/documentation/web-api/concepts/rate-limits

@dieser-niko
Copy link
Member

Uhm.. no. There may be an internal rate limit, but it has nothing to do with the rate limit the documentation is talking about.
In this case it is not the application's fault.

I have already made sure that this is not a typical bug. Next time please read the comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api-bug A bug in the Spotify API, not in the library itself question
Projects
None yet
Development

No branches or pull requests

3 participants