3

In the previous graph api version 2.7 this was working for all count (total, like, comment):

https://graph.facebook.com/v2.7/?fields=id,share,og_object{engagement{count},likes.summary(true).limit(0),comments.limit(0).summary(true)}&id=<ad_url>&access_token=<access_token>

But In graph api new version 2.10 share is depricated.

Can any one help me to get the share count in graph api new version 2.10.

Ganesh
  • 837
  • 1
  • 11
  • 18

2 Answers2

14

You can use the query

https://graph.facebook.com?id=<your-url>&fields=og_object{engagement}

The answer will be

{
  "og_object": {
    "engagement": {
      "count": 197,
      "social_sentence": "197 people like this."
    },
    "id": "895062470590407"
  },
  "id": "<your-url>"
}

og_object->engagement->count total shares here

Anton Lukin
  • 307
  • 2
  • 8
2

For all engagement share, like, comments use this query.

https://graph.facebook.com/?fields=id,share,og_object{engagement{count},likes.summary(true).limit(0),comments.limit(0).summary(true)}&id=<url>

Output:

{
   "id": <url>,
   "share": {
      "comment_count": 0,
      "share_count": 61
   },
   "og_object": {
      "engagement": {
         "count": 61
      },
      "likes": {
         "data": [

         ],
         "summary": {
            "total_count": 0,
            "can_like": false,
            "has_liked": false
         }
      },
      "comments": {
         "data": [

         ],
         "summary": {
            "order": "chronological",
            "total_count": 0,
            "can_comment": false
         }
      },
      "id": "975365752527984"
   }
}
wittmason
  • 338
  • 2
  • 5
Ganesh
  • 837
  • 1
  • 11
  • 18