Spotify API 获取相关艺术家
有没有办法通过 Spotify API 获取相关艺术家的列表。喜欢实际程序中显示的小列表吗?
如果是这样的话会非常有用,但我不太确定
干杯
Is there a way to get a list of related artists through the spotify api. Like the small list that displays in the actual program?
Would be very useful if so, but I am not so sure
Cheers
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,可以通过
libspotify
获得。有一个SPArtistBrowse
类,其中包含大量元数据,包括相关艺术家。查看CocoaLibSpotify 附带的文档包,您可以在其中找到有关其中内容的更多详细信息:https://github.com /spotify/cocoalibspotify。
请注意,目前加载整个
SPArtistBrowse
对象的速度非常慢。我假设它与libspotify
将其全部加载到一个块中并在主线程上有关(?)。据我所知,Spotify 应该会在即将推出的libspotify
版本中解决这个问题。Yes, it's available through
libspotify
. There's aSPArtistBrowse
class that contains a lot of metadata, including the related artists. Check out theCocoaLibSpotify comes with a documentation package, where you can find more details on what's included: https://github.com/spotify/cocoalibspotify.
Do note that it's currently extremely slow to load an entire
SPArtistBrowse
object. I'm assuming it's got something to do withlibspotify
loading it all in one chunk and on the main thread (?). From what I know, Spotify are suppose to remedy that in an upcoming version oflibspotify
, though.现在可以通过 Spotify Web API 获取艺术家的相关艺术家。
GET https://api.spotify.com/v1/artists/{id}/related-artists
是格式。https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE/lated-artists
是一个示例请求。有关详细信息,请参阅 API 文档。
还有一个 JSFiddle 演示应用。
Get an artist's related artists is now available through the Spotify Web API.
GET https://api.spotify.com/v1/artists/{id}/related-artists
is the format.https://api.spotify.com/v1/artists/43ZHCT0cAZBISjO8DG9PnE/related-artists
is an example request.For more information, see the API documentation.
There is also a JSFiddle demo app.
确实!您所需要的只是“artist_id”,SpotifyPublicAPI 可以返回相关艺术家的列表。您根本不需要 access_token。
您可以在 RapidAPI 上轻松测试 API 调用。< /a> 我已专门将您链接到 getArtistsRelatedArtists 端点。 Rapid 将为您提供一个代码片段,您可以将其直接复制并粘贴到您的代码中以进行调用。
以下是使用 Beyonce 的艺术家 ID 测试 API 调用的示例:
以下是 RapidAPI 提供的带有 Beyonce 的艺术家 ID 的示例代码片段作为参数传递:
Definitely! All you need is the "artist_id" and the SpotifyPublicAPI can return a list of the related artists. You don't need an access_token at all.
You can easily test the API call here on RapidAPI. I've specifically linked you to the getArtistsRelatedArtists endpoint. Rapid will provide you with a code snippet you can copy and paste directly into your code to make the call.
Here is an example testing the API call using Beyonce's artist_id:
Here is a sample code snippet provided by RapidAPI wth Beyonce's artist_id passed as a parameter: