javascript - Play a Track Using Spotify Web API - Stack Overflow

I have the artist, track, and album from LastFM API stored in a widget.I would like to play a 30 seco

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 badges
Add a ment  | 

2 Answers 2

Reset to default 4

In 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

相关推荐

  • javascript - Play a Track Using Spotify Web API - Stack Overflow

    I have the artist, track, and album from LastFM API stored in a widget.I would like to play a 30 seco

    23小时前
    30

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信