How to read Facebook post based on updated time using API - facebook

How to read Facebook comments based on updated time through API?
I tried "since" and "until" but both are reading the data based on created time.
for example let us assume a user created a post on his timeline two days back and someone commented on the post today. If I try to read the comment done on today using the following query /me/feed?since=2014-09-08 it doesn't return anything because the created date is two days back.

There's unfortunately no way to query the Graph API concerning the upate timestamp IMHO. since and until reference the created_time, as you said.
If you have a Graph API v2.0 app, you could theoretically use FQL to query by comment creation timestamp. Have a look at the comment table at https://developers.facebook.com/docs/reference/fql/comment/ and the field time. I guess you'd have to in conjunction with the stream table to get the post_is list.
To be able to use FQL you'll need an app which is an Graph API v2.0 app. And FQL will only work until April 30th 2016.

Related

Does facebook have the data about when a user adds a reaction to a post?

I am trying to collect data about a post on facebook from its graph api. I am able to get all the other information (like comments, when the comment was created, who created it, etc etc) but i am not able to find the timestamp on the reactions. That is i want find out at what time (and date) did the user add the reaction. Does facebook have this information? If yes, then how do i get that information using graph api?
Does facebook have this information?
Most likely they do.
If yes, then how do i get that information using graph api?
You don’t, because they do not provide that information via API.
For a page you manage you could set up a webhook for the feed endpoint; that will get you updates for everything that happens on the feed - new posts, new comments, new reactions ... You’d have to filter out the reactions on your end, and then you could record them in your database with a timestamp that should be close enough. (That will only work for new reactions though, and not already existing ones.)
Yes , you can get details of comment by:
https://graph.facebook.com/{page-id}/{post-id}/reactions?access_token={page_token}

Facebook API Insight Metrics Daily graph API

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

Fetching friendlist with new Graph API

Can anyone tell me how will i be able to fetch the friendlist using a simple HTTP request call like mentioned below,
https://graph.facebook.com/me/friends?access_token=xxxx
This was working for me using the access_token generated before the new update of Graph API on April 30th.
Can anyone help me out in getting this done?
This is like the 50th question about this topic. Please use the search of SO next time first.
It's no longer possible for an app which was created after 30th of April 2014 to get the complete user list. For an app which was created before that, you can prepend /me/friends with /v1.0 to get the friend list. This will only work until 30th April 2015!
My answer to this question: retrieve full list of friends using facebook API
Also, see the docs:
https://developers.facebook.com/docs/apps/upgrading#upgrading_v2_0_user_ids
https://developers.facebook.com/docs/apps/changelog#v2_0_graph_api

how to get past newsfeed using facebook API?

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.

Get register date with Graph API

Is it possible to get the date when user first joined Facebook with Graph (or any other) API. In an older post (sorry, can't find the link now) I have read that it is not possible and it is even removed from profiles; however recently with timeline it is added to the profile, so the data is somehow available.
Nope, not possible. It's been asked many times here on SO. The closest you can get is a guess by paginating thru the user's wall/stream until you get to the last item.