spotify / web-api

This issue tracker is no longer used. Join us in the Spotify for Developers forum for support with the Spotify Web API ➡️ https://community.spotify.com/t5/Spotify-for-Developers/bd-p/Spotify_Developer
981 stars 79 forks source link

Play song IN Spotify from a button on a website #1315

Open lePouns opened 5 years ago

lePouns commented 5 years ago

Hi everyone,

Just wondering if this following process is possible with Spotify API:

Let's assume I have a apply button on my website, if I click on this button, can I play a song in Spotify (not through the embedded Spotify player)

Thanks in advance Gilles

0xNF commented 5 years ago

If you're using the Web API, and you have an access token for the user, i.e., they have undergone a login process for your website which involved doing the OAuth2 dance with Spotify, then you can use the Player APIs to start playback via their Spotify.

If you're not using the Web API, then I believe the Spotify desktop clients all launch a local server that can take REST queries to do playback, which you could hit from your website, clientside. I don't know the address/port info off the to of my head, though.