访问 Spotify 应用中的用户数据

发布于 2024-12-21 16:21:23 字数 449 浏览 0 评论 0原文

使用这篇文章中的建议我已经能够访问 Spotify 用户数据对于他们的播放列表,

sp = getSpotifyApi(1);
console.log (sp.core.library.getAlbums());                

我想访问登录应用程序的用户的 Spotify 用户数据,特别是用户的 Spotify URI。

sp = getSpotifyApi(1);
console.log (sp.core.user);        // is undefined
console.log (sp.social.relations); // is undefined

我该怎么做?

Using the advice in this post I have been able to access the spotify users data for their playlists with

sp = getSpotifyApi(1);
console.log (sp.core.library.getAlbums());                

I want to access the spotify user data for the user logged into the app, specifically the spotify uri for the user.

sp = getSpotifyApi(1);
console.log (sp.core.user);        // is undefined
console.log (sp.social.relations); // is undefined

How can I do this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

逆夏时光 2024-12-28 16:21:23

出于隐私原因,此信息在 Spotify Apps API 中不可用。有一个唯一的用户 ID,但它不是用户的用户名。

如果您需要用户的好友列表,您需要自己连接到(例如)Facebook 并以这种方式获取。

This information is not available in the Spotify Apps API for privacy reasons. There is a unique user ID, but it is not the user's username.

If you need the user's friends list, you'll need to connect to (say) Facebook yourself and get it that way.

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