Help Wizard

Step 1


Status 429 and rate limiting due to "too many 504 error responses"?

Status 429 and rate limiting due to "too many 504 error responses"?

I'm writing a simple application that calls the /v1/recommendations endpoint and a few others. The app is in very early development mode--I'm the only "user" while I'm developing and testing.


Now it seems my app is rate-limited for the /v1/recommendations and /v1/recommendations/available-genre-seeds endpoints, even though it worked yesterday. When I call them (using the spotipy wrapper), I either get read timeouts or this exception is raised:

spotipy.exceptions.SpotifyException: http status: 429, code:-1 - /v1/recommendations?limit=100&seed_artists=... (etc)
Max Retries, reason: too many 504 error responses


So, two questions:

1) I'm a little confused about the primary cause of the 504 status. Did I call the endpoint too many times? Or would the 504 be a gateway error unrelated to my code? Or something else?
2) If my app is rate-limited, how long would I have to wait before making another call to /v1/recommendations endpoints to ensure that read timeouts, 429, and 504 are not received?

4 Replies

Remark: You only have to make a request to available-genre-seeds once every month or less, and save them to a file. I don't think they change faster.

Good point! I don't call it frequently, but I was wondering if rate-limiting to one endpoint like /recommendations would extend to any sub-endpoints, like /recommendations/available-genre-seeds.

I have this exact same error, with the same recommendations function too. My code was working fine and randomly started giving this error. Have you figured it out?

Same here.
any idea why?
everything is working just fine. only this recommendations API is getting 429 error.


why is that?


Suggested posts