Type in your question below and we'll check to see what answers we can find...
Loading article...
Submitting...
If you couldn't find any answers in the previous step then we need to post your question in the community and wait for someone to respond. You'll be notified when that happens.
Simply add some detail to your question and refine the title if needed, choose the relevant category, then post.
Before we can post your question we need you to quickly make an account (or sign in if you already have one).
Don't worry - it's quick and painless! Just click below, and once you're logged in we'll bring you right back here and post your question. We'll remember what you've already typed in so you won't have to do it again.
Please see below the most popular frequently asked questions.
Loading article...
Loading faqs...
Please see below the current ongoing issues which are under investigation.
Loading issue...
Loading ongoing issues...
Regarding the "Get Currently Playing Track" endpoint, is it best practice to setup an interval every 1-2 seconds to fetch data from the API? Currently i am using setInterval in Node to fetch every 1 second. Is this the right approach? Would i eventually hit the rate limit? I don't plan on releasing this to the public anyway. More or less building a system internally for my own needs.
hi, in my project I set up a timer that waits till the song is almost ending by getting the 'progress_ms' and 'duration_ms' properties and calculating the time left till the song switches. this will help reduce API calls but has the drawback that if the user manually changes the song, the timer will report incorrect values. I mitigate this collateral problem by stopping the timer from waiting whenever the spotify window goes in foreground (because there is a higher chance the user will switch the song). this still does not handle the case where the user switches with keyboard buttons or other means though, but it's the best compromise I came up with at the moment.
also I don't know if setting a wait time of 1 second will saturate API quota but I had problems when setting such low values (and I was the only one running my script for test)
Also I dont know if setting a wait time of 1 second will saturate API quota but I had problems when setting such low values, and I was the only one running my script for test
I was thinking of that idea as well but i also realized that it doesn’t take into consideration of what happens if the song changes or the playback state changes.
Additionally, i’m studying how Discord’s Spotify integration does it. Playback status update is instantaneous when i change the song for example. Wondering how
i can replicate this same behavior on Node without using a library (which is the goal)
So I was also looking into this issue. There is a websocket connection that discord uses. I was able to connect to the websocket, but then need to make a call to a restricted endpoint for realtime playback activity to start flowing. It seems like Spotify can enable the needed endpoint for approved client applications. I would imagine this is a request you could make after going through the application approval process.
Ah that explains it. After you brought up web sockets, it so happens there were other users 4 years ago that have a similar case like mine. And 4 years later, they still doesn't have a solution for it.
https://community.spotify.com/t5/Spotify-for-Developers/Access-to-websockets/td-p/4955299
Yes, polling the **bleep** out of the endpoint, would love to have a callback or websocket for it.
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…