Spotify Web API无关注用户端点,如何通过Facebook API获取Spotify好友及用户ID?
Great question! Let’s break this down clearly for you:
First, to confirm your initial observation: Spotify’s Web API does not currently provide an endpoint to retrieve the list of users that the authenticated user follows (it does have endpoints for followed artists, playlists, and podcasts, but user-to-user follow relationships aren’t exposed via the public API).
Now, regarding your ask about using the Facebook API to get friends with Spotify accounts and their corresponding Spotify user IDs:
- Facebook Graph API’s strict privacy limits: Facebook has tightened access to friend data significantly in recent years. You can only retrieve a user’s friends if those friends have also authorized the exact same app you’re building, and even then, access is restricted to specific use cases (like gaming or app-specific social interactions). There’s no way to query all of a user’s Facebook friends and filter for those who have Spotify accounts via the API.
- Data isolation between Spotify and Facebook: Even if a user signed up for Spotify using their Facebook account, Spotify doesn’t share its user data with Facebook in a way that lets third-party apps cross-reference the two platforms. Similarly, Facebook won’t disclose which of a user’s friends use Spotify—this is sensitive private information protected by global privacy regulations and platform policies.
Alternative Workaround
If you need this data for a user’s own account, the only feasible non-automated method is to have the user export their Spotify account data directly from Spotify’s settings. The exported data package includes a list of followed users, along with their Spotify user IDs. Keep in mind this is a manual process for the user and can’t be automated via an API.
内容的提问来源于stack exchange,提问作者dypbrg

