facebookfacebook-graph-apifacebook-graph-api-v2.0facebook-graph-api-v2.2facebook-graph-api-v2.1

Find the count of the like on Graph Api


I use facebook graph api and I encountered a problem relating to likes.

My request: enter image description here

My goal is to find the count of the like. but the query timeout. What is the solution?

Thanx


Solution

  • My goal is to find the count of the like

    So you only want the overall number of likes, the counter, but not the individual likes?

    Then you should ask for the summary via field expansion:

    /{page_id}/feed?fields=likes.limit(0).summary(1)
    

    For each feed item, you will get a likes data structure that looks like this:

      "likes": {
        "data": [
        ], 
        "summary": {
          "total_count": 12345
        }
      }