如何使用图形API从Facebook页面获取最受欢迎的帖子

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.

There is a "bug" in the documentation that suggests it is not currently possible to find out what the top liked URLs in your domain are via FQL or the Graph API. I don't believe this is the case, as FB claims that the API is more robust than the dashboard.

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

Just an FYI, it seems FB is building out an API for this but it's very restricted right now, nobody can use it.

https://developers.facebook.com/docs/public_feed/