gpt4 book ai didi

api - 使用 Spotify API 检索封面作品

转载 作者:行者123 更新时间:2023-12-01 15:34:06 26 4
gpt4 key购买 nike

目前无法使用 Spotify 的 Web API 检索封面插图。是否有实现这些或任何解决方法的计划?

最佳答案

2014 年 6 月 17 日:

今天 Spotify 发布了一个新的 Web API .

现在很容易检索封面图,如all endpoints为每个 item 包含一组 images


搜索示例:
curl -X GET "https://api.spotify.com/v1/search?q=tania%20bowra&type=artist"

{
"artists" : {
...
"items" : [ {
...
"images" : [ {
"height" : 640,
"url" : "https://d3rt1990lpmkn.cloudfront.net/original/f2798ddab0c7b76dc2d270b65c4f67ddef7f6718",
"width" : 640
}, {
"height" : 300,
"url" : "https://d3rt1990lpmkn.cloudfront.net/original/b414091165ea0f4172089c2fc67bb35aa37cfc55",
"width" : 300
}, {
"height" : 64,
"url" : "https://d3rt1990lpmkn.cloudfront.net/original/8522fc78be4bf4e83fea8e67bb742e7d3dfe21b4",
"width" : 64
...
} ],
...
}
}

旧答案:


您可以通过调用 Spotify 的 oEmbed 服务获取封面艺术的 URL:

https://embed.spotify.com/oembed/?url=spotify:track:6bc5scNUVa3h76T9nvpGIH
https://embed.spotify.com/oembed/?url=spotify:album:5NCz8TTIiax2h1XTnImAQ2
https://embed.spotify.com/oembed/?url=spotify:artist:7ae4vgLLhir2MCjyhgbGOQ
使用 JSONP:
https://embed.spotify.com/oembed/?url=spotify:artist:7ae4vgLLhir2MCjyhgbGOQ&callback=callme

http://open.spotify.com/ 网址也可以:

https://embed.spotify.com/oembed/?url=http://open.spotify.com/track/6bc5scNUVa3h76T9nvpGIH

{
"provider_url": "https:\/\/www.spotify.com",
"version": "1.0",
"thumbnail_width": 300,
"height": 380,
"thumbnail_height": 300,
"title": "Gusgus - Within You",
"width": 300,
"thumbnail_url": "https:\/\/d3rt1990lpmkn.cloudfront.net\/cover\/f15552e72e1fcf02484d94553a7e7cd98049361a",
"provider_name": "Spotify",
"type": "rich",
"html": "<iframe src=\"https:\/\/embed.spotify.com\/?uri=spotify:track:6bc5scNUVa3h76T9nvpGIH\" width=\"300\" height=\"380\" frameborder=\"0\" allowtransparency=\"true\"><\/iframe>"
}

注意 thumbnail_url:
https://d3rt1990lpmkn.cloudfront.net/cover/f15552e72e1fcf02484d94553a7e7cd98049361a

/cover/代表缩略图的大小。
可用尺寸:6085120140160 >165230300320640

例如:https://d3rt1990lpmkn.cloudfront.net/640/f15552e72e1fcf02484d94553a7e7cd98049361a

关于api - 使用 Spotify API 检索封面作品,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13724646/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com