How to get number of likes for a post Facebook PHP API?

Hello. Tell me how you can count the number of likes for a post using Facebook API. Interested in information on "Like" and "Super" 7de912695b1c4115bed21b5b5dca9f2b.png
July 2nd 19 at 17:27
1 answer
July 2nd 19 at 17:29
This is done through the insights and is only available for posts on pages.
Plus you'll need to get approval from Facebook for using read_insights.
Insights are only available for pages/posts owned by the user, e.g. he should have some 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 post Total Reactions by Type.",
 "description" : "Lifetime: Total post reactions by type.",
 "id" : "<post_id>/insights/post_reactions_by_type_total/lifetime"
 }</post_id>

Find more questions by tags Facebook