Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
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.
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