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

Playing all saved tracks

Playing all saved tracks

Plan

Premium

 

Currently, the API only provides a https://api.spotify.com/v1/me/tracks call to get all saved tracks, but no proper way to play them all, without calling https://api.spotify.com/v1/me/player/play with the IDs of all tracks, which doesn't work properly with large amounts of tracks. Playlists, albums etc. have a context uri that can be used instead, but that seems to be missing for saved tracks and other similar library items.

Reply
9 Replies

Hey @kraxie, thanks for posting here!

 

Let's see what could help here! Could you try the following context URI: 

"spotify:user:{{username}}:collection"

 to play the user's tracks. Let me know how you get on!

 

Have a great day and happy coding!
Hubo

 

HuboSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Hi and thanks for your response.

Unfortunately, that didn't work. The API responded with error: "Non supported context uri".

Ditto, getting the exact same issue.

any updates on this?

any updates on this?

The context uri you can use is spotify:user:yourUserIdHere:collection as mentioned by Hubo. You can use it with the Start/Resume Playback endpoint.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Thats the solution.

It works perfectly for me

I get `Player command failed: Restriction violated`. Did I missed a scope or Spotify changed something here?

Hey @MijikBro 

The required authorization scope is user-modify-playback-state.

Does it work when you use this?

With the console, everything works as expected.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Suggested posts