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

How to play "liked songs" playlist using Spotify Android SDK

How to play "liked songs" playlist using Spotify Android SDK

I can see that the only way to play song is using `PlayerApi`'s play method that accepts a `URI` of either song, album or playlist. My use case is to show the user with the list of their liked songs and play any of those songs that should continue with any song that is after that. So, instead of passing the selected song `URI`, I probably should pass the liked songs playlist URI and then call `skipToIndex` using the same URI and the selected song position.

 

However, I cannot find how I can get user's liked songs playlist URI anywhere. Is it possible? If not, is there any other way to achieve the same functionality?

 

Reply
6 Replies

I don't know how it's called in or works with the SDK, but this is the Web API documentation of the endpoint you are looking for: https://developer.spotify.com/documentation/web-api/reference/get-users-saved-tracks

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.

Has anyone been able to actually get saved tracks successfully? 

 

I get Forbidden 403 error, even with updated access token. Other endpoints work for me.

Hi jsmnkk, that endpoint wil not work with Client Credentials, and you need to use the user-library-read Authorization scope with the Authorization code flow.

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.

It's not what I'm looking for. I already use it for fetching the list of tracks, but there is no playlist URI in there.

It has no Playlist URI. That is the only way.

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.

How do I make Spotify play the next track in the playlist instead of random songs? Also, the shuffle and repeat modes functionality doesn't work since the song URI is passed and not the playlist URI.

Suggested posts

Let's introduce ourselves!

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…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random