1

I'm using the spotipy library right now to scrape half a million track infos from the spotify API. It worked well with getting the track info and track features, but now I'm trying to get the audio analysis which has much more data per track, but always run into

MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): Max retries exceeded with url: /v1/audio-analysis/4GYktiEn51I4lc3k6PlN7p (Caused by ResponseError('too many 502 error responses'))

I guess I used it too much since I was able to get the data for the first 2000 songs but now it won't allow me to get a single request anymore.

Do I now just have to wait for a certain time or is there a workaround for this?

That's my first question ever on Stackoverflow so please be kind if I missed out on important points in my question. Thanks for your help!

Bepeem
  • 11
  • 3

1 Answers1

0

Your error:

MaxRetryError: HTTPSConnectionPool(host='api.spotify.com', port=443): 
Max retries exceeded with url: /v1/audio-analysis/4GYktiEn51I4lc3k6PlN7p 
(Caused by ResponseError('too many 502 error responses'))

Means that you have already exceded the number of allowed requests by their api, check on their API docs if they specify the max number of request allowed, you will find the exact reason of you error.

Stack
  • 1,028
  • 2
  • 10
  • 31
  • 2
    It turned out that it was a specific song id that couldn't get resolved and sent spotipy in a loop. I switched to the next song id in my list and now it's running again. Thanks anyway! – Bepeem Sep 14 '20 at 19:43