[GH-ISSUE #58] How to catch a 429 and get the Retry-after? #32

Closed
opened 2026-02-27 19:25:42 +03:00 by kerem · 3 comments
Owner

Originally created by @Defcon0 on GitHub (Nov 19, 2016).
Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/58

Hello,

thanks for your great plugin. I'm currently testing it and one question comes to my mind:

As you of course know, there's a rate limit to spotify api. When it's reached, you get a http error code 429 and a Retry After header.

Is there any way to catch that information from your library? Is it saved to the "code" field in a SpotifyWebApiException and all I have to do is catch this Exception?

Bye Defcon0

Originally created by @Defcon0 on GitHub (Nov 19, 2016). Original GitHub issue: https://github.com/jwilsson/spotify-web-api-php/issues/58 Hello, thanks for your great plugin. I'm currently testing it and one question comes to my mind: As you of course know, there's a rate limit to spotify api. When it's reached, you get a http error code 429 and a Retry After header. Is there any way to catch that information from your library? Is it saved to the "code" field in a SpotifyWebApiException and all I have to do is catch this Exception? Bye Defcon0
kerem closed this issue 2026-02-27 19:25:42 +03:00
Author
Owner

@andig commented on GitHub (Nov 19, 2016):

See https://github.com/andig/spotify-web-api-extensions for an extension that handles rate limiting.

<!-- gh-comment-id:261719084 --> @andig commented on GitHub (Nov 19, 2016): See https://github.com/andig/spotify-web-api-extensions for an extension that handles rate limiting.
Author
Owner

@Defcon0 commented on GitHub (Nov 19, 2016):

Thanks for the advice

<!-- gh-comment-id:261719316 --> @Defcon0 commented on GitHub (Nov 19, 2016): Thanks for the advice
Author
Owner

@jwilsson commented on GitHub (Nov 19, 2016):

Hi @Defcon0,
An exception with a code of 429 will be thrown and @andig's extension contains some great pointers.

Cheers!

<!-- gh-comment-id:261719451 --> @jwilsson commented on GitHub (Nov 19, 2016): Hi @Defcon0, An exception with a code of `429` will be thrown and @andig's extension contains some great pointers. Cheers!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/spotify-web-api-php#32
No description provided.