I wanted to fetch most popular posts from a facebook page using Graph API. I tried https://graph.facebook.com/%pageId%/posts, But with that API I am getting recent posts from page. I wanted to filter the result with most popular posts (i.e., most shared, liked and commented). Can any body help me out how to get the popular posts from the page using the graph API.
Thanks, Siva.
You can't get popular posts directly from Facebook Graph API. You can fetch the posts using the Graph API (/{page-id}/posts), then count likes, shares or comments of a post by yourself (/{post-id}/likes, /{post-id}/comments, /{post-id}/sharedposts) and then sort all the posts.
References:
1.https://developers.facebook.com/docs/graph-api/reference/v2.3/object/comments 2.https://developers.facebook.com/docs/graph-api/reference/v2.3/object/likes 3.https://developers.facebook.com/docs/graph-api/reference/v2.3/object/sharedposts
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With