Answer the question
In order to leave comments, you need to log in
How to get the number of likes under a Facebook Post PHP API?
Hello. Tell me how you can count the number of likes under a post using the Facebook API. Interested in information on "Like" and "Super"
Answer the question
In order to leave comments, you need to log in
This is done through insights and is only available for posts on pages.
Plus, you'll need to get approval from Facebook to use read_insights.
Insights are available only for pages/posts owned by the user, for example, he must have some kind of role on the page.
{
"name" : "post_reactions_by_type_total",
"period" : "lifetime",
"values" : [
{
"value" : {
"like" : NumberLong(1),
"love" : NumberLong(0),
"wow" : NumberLong(0),
"haha" : NumberLong(0),
"sorry" : NumberLong(0),
"anger" : NumberLong(0)
}
}
],
"title" : "Lifetime Total post Reactions by Type.",
"description" : "Lifetime: Total post reactions by type.",
"id" : "<post_id>/insights/post_reactions_by_type_total/lifetime"
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question