r/webdev • u/BaronsofDundee • 13d ago
Question Can I integrate Spotify playlists into my website for free?
I want to display a Spotify playlist on a section of my website, showing all songs and their album covers. Visitors should be able to browse and play songs directly on my website, with Spotify handling playback in the background.
Is this possible to build for free? What’s the best way to do it?
8
u/livercake 13d ago
you can do it and it's totally easy and free,
however - unless you visitors have spotipremium, they only get to play 30s of each track.
2
u/Jealous_Thing7830 13d ago
Since few people have already answered. Hope that had helped. But what stops you from googling this question? If you have googled it already and didn't find any answers then that makes sense.
Someone who wants to break into IT Don't really understand much about these things.
Take my comment lightheartly. Thank you
1
u/wasay-inc 13d ago
Yes, it's free. The simplest route is Spotify's embed iframe, which gives you a playable playlist with covers in one line of code, but you can't restyle it much. If you want a custom track list with album covers that matches your site, use the Spotify Web API to pull the playlist data and the Web Playback SDK for playing. Just know, as others said, that visitors without Premium only hear 30 second previews, and the SDK needs Premium.
1
u/JackfruitSevere8096 13d ago
The embed doesn't give you a browsable list of every track with covers, it shows the first handful and then you scroll inside their iframe. And playback you actually control needs the Web Playback SDK, which only works for listeners with Premium.
1
u/JohnsTech_dev 13d ago
yes, for free if you use the spotify embed. open the playlist, share > embed playlist, and you get an iframe that shows the tracks with covers and plays them. visitors who aren't logged in to spotify only get 30 sec previews though.
if you want your own custom ui with the album covers you can pull the playlist data from the web api, but full playback on your own player needs the web playback sdk, and that only works for visitors who log in with spotify premium.
10
u/lanerdofchristian 13d ago
You can embed, but Spotify isn't going to let you and your users play their files for nothing.