Facebook is planning to drop support for FQL after V2.0 https://developers.facebook.com/docs/apps/changelog/#v2_0_fql
The below task could be done easily with FQL
Get comments, shares, and likes count from post:
[POST_ID]/?fields=id,shares,likes.limit(0).summary(true),comments.limit(0).summary(true)
I've included limit(0)
to prevent the API from spitting out the actual comments and likes. I believe the default limit is 25
.
Please note you can also add these fields to /feed
to get this data for all the posts on the page.
[PAGE_ID]/feed?fields=id,shares,likes.limit(0).summary(true),comments.limit(0).summary(true)
Final note: If shares
data is missing on the return, it is because the post has no shares. Instead of returning "shares": {"count": 0}
, the shares section will be removed entirely.