Is there an API to retrieve Facebook recent activity?
Solution 1
There isn't a single social plugin or a single API endpoint that provides exactly what you are describing, but what you can do is subscribe to Real-time Updates, check out the docs on it here:
https://developers.facebook.com/docs/reference/api/realtime/
Using this interface you could subscribe to updates for when a user's friends change for example by sending a POST request to:
graph.facebook.com/[app-id]/subscriptions?access_token=...&object=user&fields=user$callback_url=...
As the documentations notes, not everything is available via Real-time Updates, but hopefully this gets you pretty close to the functionality that you are looking for.
Solution 2
Yes. Read Facebook's post: Recent Activity stories now exposed via FQL and Graph API.
Solution 3
Are you looking for something like what Facebook itself displays in the "notifications" This FQL query should do the trick.
FB.api( {
method : 'fql.query',
query : 'SELECT notification_id, sender_id, title_html, body_html, href FROM notification WHERE recipient_id=me()'
}, function(response){console.log(response);});
A list of available fields is here.
I like to use the Chrome console to explore the data structures that Facebook returns, thus the "console.log" call. Obviously you will need to provide your own callback...
Note that this will require a special permission ("manage_notifications") starting in October as outlined here.
Alex K
Developing interesting things with JavaScript, reverse-engineering web services, conjuring spells in free time
Updated on June 04, 2022Comments
-
Alex K almost 2 years
I know there's a Graph api url for getting the recent wall feeds:
https://graph.facebook.com/me/feed?access_token=...
But how do I get the Recent Activity? Is there any way? FQL (not Graph API) can work too. I don't really care which way I get it.
I'm trying to get the RECENT ACTIVITY, which appears as part of the wall. It has same IDs like the standard wall entries have, but they aren't returned in the
/me/feed
request, because they are treated differently on facebook, and I'm trying to find out a simple way to get them just like/me/feed
-
Alex K almost 13 yearsstill displays activity for a website, not the user Recent Activity
-
Alex K over 12 yearsthis is great, but unfortunately I can't use subscriptions in this case :( the reason is the structure of the whole app here
-
squinlan over 12 yearsahh well then, unfortunately there isn't an endpoint that exposes the functionality you are looking for. Sorry.
-
Nir Gavish almost 12 yearstotally not what was asked for
-
Alex K about 11 yearsahh nice, just a bit late :)
-
Piotrek about 7 yearsThey say I can access those stories by using FQL stream table which is currently not available. Are there any other ways?