Can we get the share count of a post in fb using graph api v2.3?

1.5k Views Asked by At

I need to get the shares count of a particular post in fb uisng graph api. I could'nt find any method to do so. I have followed the link below.

https://developers.facebook.com/docs/graph-api/reference/v2.3/object/sharedposts

It returns the data of the shared posts in pagination format. Is there any way to get the total count of the shares without fetching the whole data and without paginating within the data?

Please suggest!!

2

There are 2 best solutions below

0
On BEST ANSWER

Just the field shares should give you the number of shares for a POST_ID

[POST_ID]?fields=shares

Sample data from my feed

{
  "shares": {
    "count": 1
  }, 
  "id": "POST_ID", 
  "created_time": "2015-04-29T09:07:12+0000"
}
0
On

Get shares count :

114916098537132_1265715836790480?fields=shares

Bonus [ Get likes + shares + comments ]

114916098537132_1265715836790480?fields=shares,likes.summary(true),comments.summary(true)

Improved version ( add limit(0) to removes list of likes and get only summary ):

114916098537132_1265715836790480?fields=shares,likes.limit(0).summary(true),comments.limit(0).summary(true)