Check out this play button, written entirely it seems, using javascript: spotify play button.
Notice that pressing play will cause Spotify to start playing music. OK
The desktop runs a server at *.spotilocal.com
on your computer, then on the web, the embed player (example) will choose a subdomain name (example: fdxubmxkqp.spotilocal.com
).
It then makes request to the local server's API, examples:
https://fdxubmxkqp.spotilocal.com:4370/service/version.json
https://fdxubmxkqp.spotilocal.com:4370/simplecsrf/token.json
And it just returns some JSON:
{
"version": 9,
"client_version": "1.0.10.107.gd0dfca3a"
}
See this screenshot for more info, or you can get the same info by going to news.spotify.com and using the Network inspector with spotilocal
as a filter.