Announcements

Help Wizard

Step 1

NEXT STEP

API rate-limiting excessively fast

Solved!

API rate-limiting excessively fast

Plan

Free

Country

USA

Device

Desktop

Operating System

Windows 11

 

My Question or Issue

I've built a python file that utilizes the spotify.py package module to make batch calls at specific times using specific artist ids. Working fine for weeks, no issue. An hour or so ago, it was scheduled to make another batch call(~80 ids, spread over two get_artists() calls.) I could see the API call went through, as the python logs were lighting up with the parsing prints it normally does. But at a certain artist, it froze. I assumed it was an issue with the bot breaking while parsing this artist's data, and retried. Same result. I removed the artist's id from the request and resent it. At this point, I got the full API call to run, but it froze again while parsing the second get_artists() reply. I restarted the file, and after this, no call to spotify returns anything. Nothing else changed, nothing crazy happened. In total, I made maybe 50 API calls over the span of 5-10 minutes. This may be a question better directed towards the python package instead of the API itself, but I figured someone here may be able to help.

 

I'm not running many requests on my end, but spotify's API seems to think otherwise, as I've consistently been rate limiting the few days since this happened. My API calls are utilizing bulk function calls like get_artists(), so across 80 artists, to my understanding, it should only fire two API requests. Is this wrong? Any help is appreciated!

Reply

Accepted Solutions
Marked as solution

Update 2: Found out that each artist has to run a separate get_albums() request, and that isn't included with the Artist class returned by spotify. This is clunky to work around, but is enough of an answer to my question that I'm marking this as resolved.

View solution in original post

2 Replies

Update: Tried again after midnight tonight. The first few calls worked, no problem(with API side at least). While trying to troubleshoot an entirely different problem, I ran a handful of API calls(certain artists aren't parsing properly on my end). After maybe a dozen or so calls, the API bricked itself again. I'm genuinely not sure what I could be doing to cause this, as each instance I run an API call is only triggering one or two get_artists() requests.

Marked as solution

Update 2: Found out that each artist has to run a separate get_albums() request, and that isn't included with the Artist class returned by spotify. This is clunky to work around, but is enough of an answer to my question that I'm marking this as resolved.

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