How do i get latest comments without using FQL with the help of graph API? - facebook

I am looking to get the latest comments for the Facebook page which I have created, I can fetch it using FQL, but now I don't want to use FQL Because it'll be Deprecated after few months, so I need to Do it through Open Graph API,
Can anybody help me out here?
Help will be appreciated.

https://developers.facebook.com/docs/graph-api/reference/v2.2/page/feed
/{page-id}/tagged shows the posts that this page was tagged in and the 'posts to page'
...if you mean the user posts. If you want to get the latest comments to page posts, you need to get the latest posts with /page-id/feed first and use the /post-id/comments endpoint for each one. Or easier: /page-id/feed?fields=comments
If you need older entries, you need to use paging: https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging

Related

To get likes of last month with Graph Api like "fanpagekarma" and "quintly" in FACEBOOK

Is there a way to get the likes of last month using Graph API, of course, I am not admin, because being admin it is possible to get it. But using tools like fanpagekarma.com and quintly.com is possible! I don't know if it is possible. Thanks for all! :D
Example of Fanpage Karma
Example of Quintly

Facebook Group Search post without comments

Hi,
As title, in my facebook group, I need to retrieve only post without comments.
I see the search box and notice that searching something will give an url with
`?query=Word%20Search`
and maybe there is a way to search post without comments by url.
Thanks for help!
You must use the Graph API to retrieve data from Facebook. There is example code how to get the group feed in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.2/group/feed#read
You canĀ“t filter by posts without comments, you need to do the filtering on your own after getting the posts.

Facebook - graph api 2.x - post missing user_likes field

With the 2.x graph api version, access will be removed to fql.
We were using fql to retrieve, from the likes table, if a user have liked a specific post.
How to perform this check now ?
Is it a chance that the post object would be quickly updated with a "user_likes" field as into the comment objetc as?
Cheers
Currently, it looks like the only solution is to go over all the likes and look if the page/user has liked the post manually. :-/
Hope FB will have something for this in next versions of the graph api

How to count likes/comments of a photo/post using new Facebook Graph API 2.1?

I tried for several hours to get the total number of likes/comments of a photo/post using the new Facebook Graph API 2.1 but I didn't find how to do it.
I am able to photo and post details through the API but it contains only an subarray with some likes and comments (ID/Name pair), but no the total number. Graph API Reference for object/likes mention a total_count field but is not able to found in API response.
Can you please suggest me a way to do it?
I am using latest Facebook PHP SDK 4.
I faced this situation before. Facebook Graph API Explorer, in the Fields dropdown list, you can not find any field related to total_like or total_comment of a specific post ( via its object_id). That means Facebook Graph API does not support getting the total likes, comments of a specific post.
But, it support to get likes, comments data of a post via likes, comments fields. So by this way, you can get the entire data about likes, comments, therefore, you can get the total number of likes/comments. This solution is not good, I think. I think in the near feature, Facebook Graph API support the fields total_likes, total_comments.
/object_id?fields=comments.limit(1000),likes.limit(1000)

Fetching posts from a page made only by the page using Graph API

I am trying to fetch all posts from a fan page using Graph API. I can do it in many pages using {page-id}/posts, but it does not work in all cases (example, facebook.com/cocacola). If I use {page-id}/feed, I can get it all, but I will get many user posts too. I could do it with FQL, but since FQL is not going to be supported anymore, I don't want to use it.
I want to get everything the page posts, even if it is a link, photo or share.
Something like this:
graph.facebook.com/{page-id}/feed?from.id={page-id}
The edge /{page-id}/posts will return all posts made by the page.
[1] https://developers.facebook.com/docs/graph-api/reference/v2.0/page/feed