Mehran Mazhar Mehran Mazhar -4 years ago 195
ASP.NET (C#) Question

how can i get Total like From A post in Facebook with Graph Api?

how to get total likes a post from graph api url ?

Here This Link

Return:
array of objects containing the id and name fields. Requesting with summary=1 will also return a summary object containing the total_count of likes.

Answer Source

in the FB API explorer try fetching likes for a post, i used 700182169998352

the "/700182169998352/likes" return:

{
  "data": [
    {
      "id": "663945278",
      "name": "Irene Olsson Wikler"
    },
    {
      "id": "100002437916716",
      "name": "Frida Braxell"
    },
    {
      "id": "1135121633",
      "name": "Rex Leopold Olsson"
    }
  ],
  "paging": {
    "cursors": {
      "after": "MTEzNTEyMTYzMw==",
      "before": "NjYzOTQ1Mjc4"
    }
  }
}

the "/700182169998352/likes?summary=1" return:

{
  "data": [
    {
      "id": "663945278",
      "name": "Irene Olsson Wikler"
    },
    {
      "id": "100002437916716",
      "name": "Frida Braxell"
    },
    {
      "id": "1135121633",
      "name": "Rex Leopold Olsson"
    }
  ],
  "paging": {
    "cursors": {
      "after": "MTEzNTEyMTYzMw==",
      "before": "NjYzOTQ1Mjc4"
    }
  },
  "summary": {
    "total_count": 3
  }
}

so by adding the ?summary=1 you get an extra part in the json result named summary, and containng the total_count, in my case 3

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download