Question

Simple question: is there code to embed the "Spotify Follow Artist" button on a webpage yet, or a template to create a URL that directly turns clicks into followers? Not a full-on coder, but could manage a PHP based solution at a push.

Was it helpful?

Solution

The Web APIs are for metadata (search and lookup) and are unauthenticated so couldn't perform any user specific actions. Libspotify can perform authenticated actions for a user, but it does not currently contain any functionality around following artists.

The Apps API will contain this in the future, but that lives inside the Spotify client and can't be used on a web page outside of Spotify. (It is available in the preview API: https://developer.spotify.com/technologies/apps/docs/preview/views/views-buttons-subscribebutton.html)

In short: No, currently there is not any functionality in any of the APIs to follow artists from a web page.

OTHER TIPS

You can do it now: https://developer.spotify.com/technologies/widgets/spotify-follow-button/

For Avicii (spotify:artist:1vCWHaC5f2uS3yhpwWbIA6), copy the code below and paste it on your website:

<iframe src="https://embed.spotify.com/follow/1/?uri=spotify:artist:1vCWHaC5f2uS3yhpwWbIA6&size=detail&theme=light"
  width="300" height="56" scrolling="no" frameborder="0" style="border:none;
  overflow:hidden;" allowtransparency="true">
</iframe>

But for some reason even though if I was logged into the Web player, I had to login again to show if I was already following an artist or not.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top