Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Rate limit unreasonably high after one single 429 response.

Rate limit unreasonably high after one single 429 response.

Im currently developing a web application utilizing the spotify web api. At first I didnt completely read through the documentation and soon encountered 429 errors. As I didn't have any mechanisms implemented to prevent my application from requesting after a 429 error, my application made a bunch of requests which skyrocketed the amount of time my rate limit was applied. (like almost 48 hours). So I used the time to change my app to take the rate limit into account. Now it blocks requests to the url after the first 429 error for the amount provided in the 'Retry-After'.

 

So after these 48 hours I tested it and made a bunch of requests, which resulted in a 429 response. My application stopped as soon as the first 429 response was received. But the value of the Retry-After header is about 21 HOURS. So is there a way to detect the rate limit before a 429 response is provided? Or will my application just be locked for 21 HOURS everytime I violate the rate limit for ONE SINGLE TIME?

Reply
1 Reply

What URL/endpoint are you accessing? And when you say "it blocks requests" do you mean it provides an extremely high "Retry-After" value?

 

I'm encountering something similar. When I encounter a 429 response, my app will wait for the stated amount of time in the "Retry-After" header before making another request, and this typically works 99% of the time. However, sometimes I will suddenly get a 429 response with an extremely high "Retry-After" value (like 49000, or around 13.6 hours) despite the past few requests being successful with no 429 responses. This seems to happen for a specific endpoint that I am accessing a lot (the /artists/{id}/albums endpoint) rather than the API as a whole.

 

I understand if my app is continuing to make rapid requests and disregarding the rate limit then the "Retry-After" value would keep climbing, but this isn't the case for me. I am respecting the rate limit and "Retry-After" values, but it suddenly gives me a 429 response with a very high wait time seemingly out of nowhere, and only for a specific endpoint. When I refresh the app, other requests go through or have a normal "Retry-After" value, but on the first request to the specific endpoint it returns a 429 with a very high wait time.

 

A response from a Spotify staff or support member would be greatly appreciated.

Suggested posts