I’m working on an application that needs to retrieve music listening activity from Facebook’s API, specifically the songs that users have played on Spotify.
The issue I’m facing is that when I make API calls to get listening data, I keep getting empty arrays back. I can see the music activity displayed on Facebook profiles and in the news feed, so I know the data exists and is being synced from Spotify properly.
I’ve tried different API endpoints to fetch this information:
Using /me/music returns only saved playlists, not actual listening history
Calling /{user-id}/music for other users returns completely empty results
All necessary permissions have been granted for the access token, and privacy settings are set to allow public access to this information. The music posts are visible on Facebook, but the API calls don’t return any of that listening activity data.
Has anyone successfully retrieved Spotify listening history through Facebook’s API? Are there specific permissions or endpoint configurations I might be missing?
This has been locked down since around 2018 when Facebook tightened their data policies. What you’re seeing isn’t a config issue - it’s intentional. The music stuff you see on profiles runs on a completely different system that doesn’t talk to the Graph API. I hit this same wall building a social music tracker last year. Here’s what worked: get users to connect their Spotify accounts directly to your app instead. Spotify’s Web API lets you grab recently played tracks and top artists. The auth flow is pretty simple and you’ll get way better data than Facebook ever gave you. Just watch out for rate limits (they’re generous) and make sure you handle token refresh correctly for ongoing access.
yep, totally know what u mean! fb really cut access to music data after all the privacy issues. even if u have the right permissions, u just won’t get listening history from API anymore. better to hit up spotify’s API for that info instead!
Facebook killed music listening data access years ago, but I found a workaround when I built something similar. It’s not your permissions or endpoints - Facebook just doesn’t share this data anymore, period. What worked for me: authenticate through Spotify first, then use Facebook’s API for social stuff like friend connections and shared posts. Honestly, Spotify’s Web API is way better anyway - you get track features, audio analysis, and real-time playback that Facebook never had. Just set up your app to request spotify-modify-playback-state and user-read-recently-played scopes from Spotify, then use Facebook purely for social context. You’ll get better data quality and won’t have to deal with Facebook’s increasingly restrictive music policies.
Facebook has indeed restricted access to music listening data through their API due to privacy reasons. The /me/music endpoint will only provide basic likes and saved playlists but will not include actual listening history. Even if the activity appears on user profiles, the API cannot access this data. For reliable access to listening activity, consider using Spotify’s Web API. Their recently played tracks endpoint will give you the needed data, but it requires user authentication through Spotify directly.
Been fighting this same problem for months. Facebook completely locked down music data after Cambridge Analytica and the other privacy mess.
Here’s what actually worked: I built an automation that hits both Facebook and Spotify APIs at once. Skip trying to pull listening data from Facebook - authenticate users with Spotify directly, then cross-reference their Facebook activity for context.
The automation checks Spotify’s recently played endpoint every few minutes and stores everything in a clean format. You can sync it with Facebook music posts if you need that connection.
I tried coding this manually first - total nightmare with all the OAuth flows and rate limits. Latenode made it dead simple to connect both APIs without writing a ton of boilerplate.
You can set triggers for new tracks, auto data cleaning, even push notifications when users share music. Way more reliable than begging Facebook for data they obviously don’t want to give up.