Announcements

Help Wizard

Step 1

NEXT STEP

Spotify Web API Request: GET Queue

Spotify Web API Request: GET Queue

There still seems to be no API endpoint for the queue is there any hope in getting one added?

Reply
3 Replies

Do you want the current playback queue? If so, it's available here:

https://developer.spotify.com/documentation/web-api/reference/#/operations/get-queue

 

I think it's a recent(ish) addition, as it wasn't previously possible to get the current queue, but it works great - it also handles shuffled lists etc. which my old work-around couldn't.

I"ll have to test it when I get more time. This main issue is after a song has been listened to it removes itself from the queue and when I hit that endpoint again it won't have any previous songs. I think I can piece together something that will keep up with everything added to a queue

I created two functions, one to get previous tracks and the other to get future, as well as rendering the current track. Originally I tried hacking something together by getting future tracks in the playlist if one was played, but the new endpoint is much better.

You can consider https://developer.spotify.com/console/get-recently-played/ for the recent tracks, I think that'll give you a list of tracks you can reverse sort and show the newest 3 or something as past played.

Suggested posts