Spotify API 获取相关艺术家

发布于 2024-11-03 10:29:20 字数 92 浏览 0 评论 0原文

有没有办法通过 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

回忆追雨的时光 2024-11-10 10:29:20

是的,可以通过 libspotify 获得。有一个 SPArtistBrowse 类,其中包含大量元数据,包括相关艺术家。查看

CocoaLibSpotify 附带的文档包,您可以在其中找到有关其中内容的更多详细信息:https://github.com /spotify/cocoalibspotify

请注意,目前加载整个 SPArtistBrowse 对象的速度非常慢。我假设它与 libspotify 将其全部加载到一个块中并在主线程上有关(?)。据我所知,Spotify 应该会在即将推出的 libspotify 版本中解决这个问题。

Yes, it's available through libspotify. There's a SPArtistBrowse class that contains a lot of metadata, including the related artists. Check out the

CocoaLibSpotify 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 with libspotify 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 of libspotify, though.

伏妖词 2024-11-10 10:29:20

现在可以通过 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.

琴流音 2024-11-10 10:29:20

确实!您所需要的只是“artist_id”,SpotifyPublicAPI 可以返回相关艺术家的列表。您根本不需要 access_token。

您可以在 RapidAPI 上轻松测试 API 调用。< /a> 我已专门将您链接到 getArtistsRelatedArtists 端点。 Rapid 将为您提供一个代码片段,您可以将其直接复制并粘贴到您的代码中以进行调用。

以下是使用 Beyonce 的艺术家 ID 测试 API 调用的示例:

getArtiistsRelatedArtists Beyonce

以下是 RapidAPI 提供的带有 Beyonce 的艺术家 ID 的示例代码片段作为参数传递:

BeyonceCodeSnippet

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:

getArtiistsRelatedArtists Beyonce

Here is a sample code snippet provided by RapidAPI wth Beyonce's artist_id passed as a parameter:

BeyonceCodeSnippet

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文