Closed a-waider closed 2 years ago
That is a very good idea - thanks. I am also not sure what the api rate limits are actually set to. It seems they don't communicate that publicly.
As an addition: any particular reason why you might have triggered that limit? Multiple instances / devices or other hardware / applications in use which are also using Spotify API? I have not yet come across that problem myself, but I do remember that some other user had this problem once.
The cause may be that I was running Home Assistant and Magic Mirror on the same Spotify App. So both together were generating double the amount of requests as of only one client.
Not sure if this is still up to date but here someone said there is an limit at 2000 requests per app per hour. In case it is still correct than 1 call per second is exceeding this limit.
Maybe you could answer me that, cause you're way deeper in the Magic Mirror ecosystem. When I have multiple Browser tabs open, does that meen that every tab is making its own request? Or does the server make one requests and forwards the response to all open browser tabs?
Okay, thank you for the insights. That does make sense that two apps are then triggering the limits.
About your question. That's a tough one - I am not that deep into the inside mechanics of MM². Some information I know:
MMM-Spotify
the node_helper.js
is initiating all the API communications. So even if you would have multiple MMM-Spotify
instances running, all these will be "bundled" via the one node_helper instanceAs I said, this is not a really substantiated statement from my side.
I noticed that Spotify has a rate limiting feature. If there are too many requests to the Spotify App it will prevent you from sending further requests.
The error message looks something like this:
Important is the "retry-after" header. It would be a nice improvement, if the Spotify client could catch the 429 HTTP error and wait the expected seconds (plus a delta) before trying again.
I'm not quite sure when the limits of the Spotify API are exceeded. Maybe anyone has some information on this.