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

Is there a way to play a song or playlist using the web api or sdk?

Solved!

Is there a way to play a song or playlist using the web api or sdk?

Hi,

As stated in the subject, is there a way I can play a specific song or set of songs in a playlist via the Web API or Web SDK?  I've far as I've found, the closest I can get to playing a song or playlist is via adding to queue or skipping to the next track or skipping to the previous track.  

Thanks,

 

Reply

Accepted Solutions
Marked as solution

Hey there, help's here!

You can use the Start/Resume a User's Playback-endpoint to play something specific on the currently active device (or other device, if specified). You can play a song from a user's webbrowser with the Web Playback SDK. Let me know if you have any questions about these!

 

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.

View solution in original post

4 Replies
Marked as solution

Hey there, help's here!

You can use the Start/Resume a User's Playback-endpoint to play something specific on the currently active device (or other device, if specified). You can play a song from a user's webbrowser with the Web Playback SDK. Let me know if you have any questions about these!

 

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.

Thank you!

Hi Hubo, I have been trying to get it so I can search for song and being able to click on one of the returned songs from the search so that I can play that specific song. but so far I am getting errors. is it possible for that to happen with the start/resume a user's playback endpoint? or is that feature not available?

Hi amirlasalle,

To use functions like searching for a song, you can use Client Credentials. Because the Playback SDK requires user authorization, this isn't sufficient.

To make it work, you will need to implement another OAuth flow.

You can choose between the Authorization code if you want to run your code on a back-ed server, or Authorization code with PKCE extension if you want to run the code fully in your browser. In your case, I recommend the second option. You can use all endpoints with this flow (with the required scopes specified) and I recommend not mixing flows.

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