M
M
maxkaiser2016-11-12 16:00:34
Facebook
maxkaiser, 2016-11-12 16:00:34

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"7de912695b1c4115bed21b5b5dca9f2b.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Philipp, 2016-11-12
@zoonman

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 question

Ask a Question

731 491 924 answers to any question