Is there an API to retrieve Facebook recent activity?
Asked Answered
A

5

10

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

Avera answered 12/7, 2011 at 11:57 Comment(4)
recent activity? Do you mean "Alex is now friend with Martin" and others?Sitin
yes yes, exactly those mini storiesAvera
Such an API would be terrifying! A history beyond your control that is publicly accessible!Timm
why publicly? it requires access_tokens and user agreementAvera
S
9

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.

Squalor answered 4/8, 2011 at 16:32 Comment(2)
this is great, but unfortunately I can't use subscriptions in this case :( the reason is the structure of the whole app hereAvera
ahh well then, unfortunately there isn't an endpoint that exposes the functionality you are looking for. Sorry.Squalor
B
6

Yes. Read Facebook's post: Recent Activity stories now exposed via FQL and Graph API.

Bridie answered 7/3, 2013 at 9:39 Comment(2)
ahh nice, just a bit late :)Avera
They say I can access those stories by using FQL stream table which is currently not available. Are there any other ways?Ameba
A
1

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.

Alishiaalisia answered 8/8, 2011 at 14:46 Comment(0)
B
0

You can use the user/home edge.

This endpoint returns posts a person sees in their News Feed. The posts returned by this API may not be identical to the posts a person would see on facebook.com or in Facebook's mobile apps.

https://developers.facebook.com/docs/graph-api/reference/v2.3/user/home

Bract answered 15/9, 2015 at 19:24 Comment(0)
I
-3

What about the Activity Feed social plugin: http://developers.facebook.com/docs/reference/plugins/activity/

Irreversible answered 12/7, 2011 at 13:48 Comment(2)
still displays activity for a website, not the user Recent ActivityAvera
totally not what was asked forAmorist

© 2022 - 2024 — McMap. All rights reserved.