the API to fetch newsfeed is: https://graph.facebook.com/me/home?access_token=&limit=1000&untill=
which returns paginated feed output with 'next' url to fetch previous feeds.
However it stops returning newsfeed beyond a certain time. So newsfeed of few days is only available for parsing.
Is there a way out to get more historical newsfeed using facebook apis???
If you look at the graph API documentation page, /me/home is limited to only 1-2 weeks of history, and it has fallen into the "we don't care about this" category:
/me/home retrieves an outdated view of the News Feed. This is currently a known issue and we don't have any near term plans to bring them back up into parity.
Use /me/feed instead.
You can use the since and until parameters to get historical data from a user's feed. This will get you the posts that appeared between August 15-20, 2012.
/me/feed?since=2012-08-15&until=2012-08-20
The data returned by /me/feed/ is also limited. The limits aren't explicitly stated, but I never expect to be able to access more than 30 days worth of posts from one API call.
Related
Hi Guys I am hoping someone could help me.
I have been toying around with the Facebook API for our company's facebook analytics page. I am looking to get information on the likes, shares, impressions etc and store directly to a database
I have been able to pull this information back using the Graph API Explorer. Now I want to be able to pull the information back for say today. When I add today's date in it only relates to the actual posts that were posted today, not today's activity. if that makes sense.
An example of this is if I had liked a post today that was created 2 days ago, it doesnt show in in today's activity, but the activity from 2 days ago.
The code I have been using is:
feed?fields=comments.limit(1).summary(true),likes.limit(1).summary(true)&since=2016-10-28
Just wondering if I am missing something as surely should be an easy way of getting todays actual activity from users?
Your example isn't fetching Insights, you're fetching the posts visible on the page's Timeline, then asking for a count of the comments and likes
There's a totally different API for fetching Insights data: https://developers.facebook.com/docs/platforminsights/page
This is the same API used by the Insights UI, so for the same set of metrics/dates, it should give identical results to the UI
I'm having a hard time getting access to most recent posts and comments for a given user using the OpenGraph API.
I have the read_stream permission, and get realtime notifications for feed field on the user object. The notification comes in, but fetching the /<user id>/feed stream doesn't include the new action.
When playing around with the Graph API Explorer, the data I see via OpenGraph and data I see by going directly to the page is different. Viewing my friend's profile, I see his latest update, yet it doesn't come back via /friend_id/feed. A comment I left a week ago shows in my /feed, but one from a few hours ago (which sent a realtime notification!) isn't showing up.
It's almost like some posts are filtered for the API. Is this how it's supposed to work?
My actual goal is to get all the comments made by my application's user.
On the Graph API documentation, the following is in brackets next to the News Feed endpoint:
this is an outdated view, does not reflect the News Feed on facebook.com
This is a fairly critical method in any app using the Graph API, so what are we supposed to use? Is there a way to obtain a more accurate version of the News Feed with a different API?
I've noticed some differences between what is shown on the website and what is shown through the API but I assumed most of it was down to individual user permissions. Either way this issue is non-trivial and is starting to make regret choosing the Graph API over, say, FQL.
You can use FQL to fetch the news feed. See the documentation under https://developers.facebook.com/docs/reference/fql/stream/
But it seems that the results doesn't differ from the results via the graph api.
The FB docs at http://developers.facebook.com/docs/reference/api/ have been updated to say things like:
/me/home retrieves an outdated view of the News Feed. This is currently a known issue and we don't have any near term plans to bring them back up into parity.
So, what is the preferred/best way to get the user's news feed? Query the Stream table via FQL or does it have the same limitations?
First of all, I'm not sure what you're asking as you already answered half of the question yourself. The News Feed became quite complex and to be honest, I'm not surprised it's not supported as an API method anymore.
Regarding FQL - you get the same connections as for the API (more or less) - I haven't seen anything in the FQL tables that would allow you to recreate the Feed precisely.
I would recommend asking for permissions to read Friend's feed and Liked pages statuses and recreate your own version of the News feed in the app.
When I use the open graph API to get my own facebook news feed (my wall), everything looks right for the most recent 3 months, but prior to that, I no longer see my own posts (but still see posts of other users on my wall).
I'm using a version of this link (with a working access token):
https://graph.facebook.com/me/feed??access_token=putvalidaccesstokenhere&limit=100
as documented on this page:
http://developers.facebook.com/docs/api
And I notice that posts from me (i.e. status updates, shared links etc.) no longer show up from early June and prior. Any ideas why?
Facebook lets you see only latest 5000 records. Everything older than that is unaccessible through the api. Is it possible that you reached this limit in 3 months?