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.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
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
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0