I’m trying to build an app that needs to fetch the music tracks that users have been listening to on Spotify. I can see this information shows up in Facebook’s recent activity section, but I’m not sure how to pull this data using Facebook’s API.
I already know about using ‘me/feed’ to get the regular posts, but that doesn’t seem to include the music activity data. Is there a specific endpoint or method to access this recent activity information? I’ve been searching through the documentation but haven’t found a clear solution yet.
Any help or guidance on the right API calls to make would be really appreciated. Thanks!
yeah, facebook axed that feature long ago because of privacy stuff. I ran into the same issue - those old music endpoints dont work anymore. just focus on the spotify api instead. way cleaner and you get real-time data, not the old stuff fb was pulling.
Yes, you’re encountering a significant limitation with Facebook’s API. The music activity endpoints were discontinued in 2018 due to privacy issues, meaning that the activity data you see now is outdated and cannot be accessed through the API. I faced this same hurdle while working on a comparable project and spent excessive time experimenting with various Graph API calls, only to discover that the necessary data is simply unavailable. Your best course of action is to utilize Spotify’s Web API directly. Although this requires separate user authentication, it is beneficial as it allows access to real-time playback information and a comprehensive listening history. Spotify’s documentation is clear, and the authentication process is relatively simple. Ultimately, the data you obtain from Spotify will be far superior to what Facebook used to offer.
I tried building something like this six months ago and hit the same wall. Facebook killed their music activity endpoints back in 2018 - that’s why you can’t find any decent docs. The music stuff you see in Facebook’s feed is just old data you can’t access anymore.
Don’t waste more time on this. Just go with Spotify’s Web API from the start. Yeah, users have to log in through Spotify’s OAuth, but you get way better data - current playback, recent tracks, full listening history. Spotify’s API actually works and gives you real-time info instead of the stale garbage Facebook used to show. You’ll save yourself tons of headaches and your users will get a much better experience.
That won’t work anymore. Facebook killed those music activity endpoints years ago over privacy issues and policy changes. Even the Facebook-Spotify integration for sharing what you’re listening to got gutted. What you see in Facebook’s activity feed now is mostly old data or manual posts. I hit this same wall on a project last year. Skip Facebook completely and go straight to Spotify’s API. You’ll need to set up Spotify’s auth flow to get user permission, then use their Web API to pull listening history. It’s actually better this way - you get fresher, more accurate data straight from Spotify. Spotify’s API docs are solid and their recently played tracks endpoint is exactly what you need.
Facebook killed access to music activity data through their API a few years back because of privacy issues. That recent activity section you see? Only visible to the user - can’t be accessed programmatically anymore. They axed the old endpoints like ‘me/music.listens’ around 2018. Your best bet is going straight to Spotify’s Web API instead. Users will need to authenticate with their Spotify accounts separately, but you’ll get their recently played tracks, current playback, and listening history through endpoints like ‘/me/player/recently-played’. Yeah, it means dealing with two separate auth flows, but it’s way more reliable since you’re getting data directly from Spotify instead of Facebook’s filtered version.