Search code examples
facebook-graph-apifacebook-likefacebook-fql

get number of like for a video with facebook fql


how can I have the number of like about a id video?

I am using this query but it's not working:

SELECT user_id FROM like WHERE object_id=10151815700693876

Error:

   {
  "error": {
    "message": "(#803) Some of the aliases you requested do not exist: SELECT user_id FROM like WHERE object_id=10151815700693876", 
    "type": "OAuthException", 
    "code": 803
  }
}

Solution

  • Your query would result back in an array of likes by user_id. You will have to take the total count of the array in order to determine the likes count.

    Instead simply use https://graph.facebook.com/postid/likes and use 'summary' as a parameter and pass its value as 1.

    You will get a response summary with a field "total_count" and that's your total likes count for the post.