Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Get User Queue Doesn't Return Full Queue

Get User Queue Doesn't Return Full Queue

Working on developing an application, and I have to use this endpoint:

 

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

 

I need to obtain the full user queue, but what this endpoint returns is only the first 20 songs queued (despite 20+ songs queued). I've tested in Postman too with the same problem, so it's not an app-specific issue.

 

Is this an intentional limit? Is there some parameter not documented I can pass in to set a limit or offset? 

Reply
20 Replies

Additionally, this endpoint returns an empty list if a device isn't currently playing (even if there are many songs queued).

I have the same issue, but only 2 songs returned

Hey @zack_johnston, welcome to the developer board. This endpoint doesn't support fetching additional pages of queue items right now. It would be great to hear more about the app you are building — can you tell us more about the use case?

Hi @spotifyjosh !

That's too bad the queue endpoint doesn't support pagination! So I've tested this endpoint even more, and it behaves even more strangely than I first outlined. Sometimes it returns only 2 songs (despite a full queue) like @mfatica observed. Sometimes it returns 14 songs (despite queue # > 14) for no rhyme or reason. Sometimes it will return a list of 20 songs, alternating in repetition (e.g. [Superstition, Sir Duke, Superstition, Sir Duke, Superstition, Sir Duke, Superstition, Sir Duke, Superstition, Sir Duke, Superstition, Sir Duke]). Sometimes it even returns 20 songs when less than 20 songs have been queued (the remainder of songs in the returned queue alternate [as I outlined above] until it hits 20).

 

I'm getting other strange behaviours than what I outlined above, with no clue how to reproduce it. Each time, I'm receiving a 200 status code--and I test in Postman to confirm the results in my app, so it's not an app-specific problem. To test, I've queued varying numbers of songs--I've tried different combinations of mobile queueing and desktop queueing. Sorry I can't give you a better idea about specific use cases! I'm having a hard time myself trying to reproduce these problems consistently to isolate causes.

I have the same issue. @zack_johnston described the situation perfectly. 


Is there a fix/workaround?

The issue still persists, most of the time it only returns the next 2 tracks. I was excited the endpoint got finally added after several years of everyone here begging for it only to be completely broken and inconsistent. 

Same issue... how is this not fixed yet?

 

This route is practically useless in its current state.

Thanks for elaborating here, Zack - we are looking into the issue you described involving the length of the response array. I'll update this thread as soon as I know more.

Please prioritize this fix.

API returns only 2 songs when player is not shuffling, if shuffle is enabled then 20 songs are always returned even if there are actually less songs in the queue!

 

I described it in more detail and with examples in other thread:

https://community.spotify.com/t5/Spotify-for-Developers/Inconsistent-behaviour-of-me-player-queue-en...

This issue is still not fixed, hopefully it's still on Spotify team's radar

Any idea when this is going to be fixed? Currently working on a Java application to allow my vintage Reel to Reel and Cassette tape decks to control the playback of the Spotify client, and not having this endpoint fully functional is really making things a bit harder coding wise. Now I rely on manual selecting and loading of playlist and albums.

Still NOT fixed. Some of my users are affected by this, and it's rather annoying the bug has been around forever, especially since there's no other way to grab the queue. 

Still not fixed! Only getting 20 songs total.

Still not fixed...please Spotify!

This issue is still not fixed, can you please forward it to the team?

I have a similar issue with queue : queue is juste... false. When my current album/playlist reaches the last track, the queue is displaying nothing. But when the current track is now out of the album/playlist (automatically added by Spotify's recommendations), the queue given by this endpoint is false. On my app I have for example : "Good Riddance Time of your life" as first element, and the endpoint is returning as first element "It Ain't Over 'Til It's Over". It seems that when Spotify is playing recommendations without user's interaction, the app isn't showing you the user's queue anymore but the "recommendations's queue".

And it seems there's no way to know that Spotify is in "recommendations mode". 

Any idea about that?

 

Have a look at the screenshots below showing the queue being returned by the API endpoint, and the queue of Spotify App running on MacOS

 

 

 

 

 

API queue.png
App queue.png

Im facing the same problem @upgrader-dev

Try to change your Spotify preferences: disable Autoplay

The queue should be synchronized with the /player/queue endpoint now

 

This is not a satisfying solution, but hopefully a fix is coming ??

still not fixed...

I confirm this solution is not satisfying for me as I need auto play but thank you. 

Suggested posts