Rahul Kejriwal
Rahul Kejriwal

Reputation: 101

How to get share count from Facebook Graph API?

I'm looking for a way to get the shares count of a post(not a url) using the Facebook Graph API. I was able to do it using FQL but seeing that it will be dropped by August I'm looking for a non-depricated way to do it.

I'm new to this and would really appreciate any help. I'm using the graph API on python.

I saw the following pages:

  1. How to get share counts using graph API

  2. Can i get lots of share counts using facebook graph API? And how to do it

  3. Using Facebook Graph API 2.2 to get like and share count

  4. How to get facebook share, like, comment count for a url with graph api only (in a non-deprecated way)

However, I couldn't find a way that worked for me. Please help.

Upvotes: 0

Views: 1778

Answers (1)

Tobi
Tobi

Reputation: 31479

Have a look at my answer at

You should be able to call

/?fields=id,share,og_object{engagement{count},likes.summary(true).limit(0),comments.limit(0).summary(true)}&id=http://www.google.com

which return something like

{
  "id": "http://www.google.com",
  "share": {
    "comment_count": 2,
    "share_count": 31135003
  },
  "og_object": {
    "engagement": {
      "count": 31135003
    },
    "likes": {
      "data": [
      ],
      "summary": {
        "total_count": 87935,
        "can_like": true,
        "has_liked": false
      }
    },
    "comments": {
      "data": [
      ],
      "summary": {
        "order": "chronological",
        "total_count": 1323,
        "can_comment": true
      }
    },
    "id": "381702034999"
  }
}

Upvotes: 1

Related Questions