I have the artist, track, and album from LastFM API stored in a widget. I would like to play a 30 second snippet of the song from Spotify when a user clicks play. Is it possible to do this? I'm struggling to find a way.. Especially without user authentication / permissions.
Spotify App API: Play specific track from album
This looks promising, but I'm not sure if it's what I'm talking about...
If someone could point me in the right direction (what API calls to use), that would be great! I can figure out the rest from there.
I have the artist, track, and album from LastFM API stored in a widget. I would like to play a 30 second snippet of the song from Spotify when a user clicks play. Is it possible to do this? I'm struggling to find a way.. Especially without user authentication / permissions.
Spotify App API: Play specific track from album
This looks promising, but I'm not sure if it's what I'm talking about...
If someone could point me in the right direction (what API calls to use), that would be great! I can figure out the rest from there.
Share Improve this question edited May 23, 2017 at 11:51 CommunityBot 11 silver badge asked Jul 28, 2014 at 19:51 kwitbkwitb 111 silver badge4 bronze badges2 Answers
Reset to default 4In the Spotify API documentation I found a link to this github repo that uses the 30-sec API calls to build a web player you can check out here. I believe you want the track API:
preview_url string A link to a 30 second preview (MP3 format) of the track.
You can get the track preview_url
from a search response, too.
If you know the artist and track title:
https://api.spotify./v1/search?q=artist:Lady+Gaga+title:Bad+Romance&type=track&limit=1
if you know the ISRC:
https://api.spotify./v1/search?q=isrc:US2J71103806&type=track
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742282426a4414734.html
评论列表(0条)