Announcements

Help Wizard

Step 1

NEXT STEP

Huge Discrepancy Between Retry-After and Rate-Limit-Reset Headers

Huge Discrepancy Between Retry-After and Rate-Limit-Reset Headers

Hey Spotify team/community,

I'm working on a Discord bot that tracks new music releases for users from artists they follow or listen to frequently.
Been running into some weird rate limiting issues lately that I can't figure out.
My bot got rate limited for the first time today and I noticed something strange in the response headers.
The Retry-After header said 71943 seconds (that's almost 20 hours!), but the X-RateLimit-Reset header indicated the limit would reset in just 58 minutes.

This is super confusing.
Which value should I actually respect? Is there a bug in one of these headers or are they meant to represent different things?

Some context on how I'm using the API:
- I'm calling various endpoints like /me/following, /me/top/artists, and /artists/{id}/albums
- The bot checks for new releases about once per hour for artists that users follow
- I've implemented proper backoff strategies and caching
- When rate limited, I pause requests and wait for the specified time before retrying

This happened specifically when calling: /artists/1C3qb5czyoPMhiTRFM86EQ/albums?include_groups=album,single,compilation&limit=20
The status was 429 with a Retry-After of 71943 seconds, which seems excessively long compared to the reset time.

Any insights on what's happening here would be really helpful.
Thanks!

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random