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

Max retries reached, too many 429 error responses on 'audio_features' endpoint only

Max retries reached, too many 429 error responses on 'audio_features' endpoint only

Plan

Premium

Country

Philippines

 

My Question or Issue

My first app worked earlier. But after one loop through a 700-song playlist, it started giving me an Error 429. Normally this would be fine, but there's also no 'Retry-After' in the HTTPS response header. It's been six hours and I still get the same error.

I asked my friend to re-create my app in their account and try to run my program, but even on a newly created Spotify Developer account and a newly generated client id/secret, the same error occurs.

 

 

# this works and returns me tracks from the playlist_id
response = sp.playlist_items(playlist_id)
print(response)

# but this gives me an http status code 429
response = sp.audio_features(song_id)
print(response)

 


The whole error:

 

 

Max Retries reached
urllib3.exceptions.ResponseError: too many 429 error responses

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
...
...
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/audio-features/?ids=4TTV7EcfroSLWzXRY6gLv6 (Caused by ResponseError('too many 429 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
...
...
requests.exceptions.RetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/audio-features/?ids=4TTV7EcfroSLWzXRY6gLv6 (Caused by ResponseError('too many 429 error responses'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
...
...
spotipy.exceptions.SpotifyException: http status: 429, code:-1 - /v1/audio-features/?ids=4TTV7EcfroSLWzXRY6gLv6:
 Max Retries, reason: too many 429 error responses

 

 

Reply
15 Replies

+1 Flagging that we're having similar issue. 

http status: 429, code:-1 - /v1/audio-features/?ids=7zMUCLm1TN9o9JlLISztxO:
 Max Retries, reason: too many 429 error responses  

 

Requesting audio features of 700 tracks one-by-one is bad practice.

The documentation clearly states "tracks - a list of track URIs, URLs or IDs, maximum: 100 ids". So, if you use lists of 100 track ids, it would only take 7 requests; not 700.

 

(For not Spotipy users, you can use this endpoint.)

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Same issue. This is my code. I'm trying to retrive the features of one song. Only one

 

track_features = sp.audio_features("3GYlZ7tbxLOxe6ewMNVTkw")

I am getting the max retries reached error after deriving the features of 700 songs using Spotipy library, I have 6700 songs for which I have to extract features , someone please guide me how can I achieve this without getting max retries error.

 

 

where does the documentation mentions the exact limit for the number of tracks whose features can be extracted by the API call ?
it says audio_features(tracks=[])

Get audio features for one or multiple tracks based upon their Spotify IDs Parameters:

  • tracks - a list of track URIs, URLs or IDs, maximum: 100 ids

 

 

@BuggerMe: A maximum of 100 ids per request

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

I'm also having a similar issue. I tried it 1 by 1 for 500 songs and that ran fine probably 4 times. 5 hours later I've now gotten a 429 off of one call of audio-features. I've tried passing in 50 songs, 5 songs, and 1 song. Still get the same error.

Screen Shot 2024-04-16 at 12.01.52 AM.png

for audio features the batch api limit is 100 so for 500 tracks you can have 5 batches of 100 id requests each and if implemented correctly should take just few seconds instead of 5 hours.

 

I tried it with just one track id. Still gives the same error

How long does it take after the rate limit is over? The error does not seem to have a Retry-After header.

i have the same issue. it worked fine for me for extracting roughly 2-3k track features at first. 

But after few hours i was hit with the rate limit. 
been more than 16 hours and still the limit is applied. 😐

Hi gautamhans,

For what purpose do you need the audio features of that many tracks? 😲

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

I guess your library of saved tracks is that big, and that is understand.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

still didn’t get an answer to why there’s a rate limit hours after on only a single song request 🤔

you might want to try refreshing your token.

I believe that's what worked for me 🙂

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