How to get post statistics using post id from facebook

I want to get statistics (likes, comments, shares) in a Facebook post. How can i do this?

+3


source to share


2 answers


Url: https://graph.facebook.com/<userid>_<postid>

- there is a lot of information about the wall.

http://developers.facebook.com/tools/explorer

- you can use this tool for testing.



Sample data:

{
  "id": "<userid>_<postid>", 
  "from": {
    "name": "User Name", 
    "id": "<userid>"
  }, 
  "message": "playing with graph api", 
  "actions": [
    {
      "name": "Comment", 
      "link": "http://www.facebook.com/<userid>/posts/<postid>"
    }, 
    {
      "name": "Like", 
      "link": "http://www.facebook.com/<userid>/posts/<postid>"
    }
  ], 
  "privacy": {
    "description": "Public", 
    "value": "EVERYONE"
  }, 
  "type": "status", 
  "created_time": "2012-03-14T11:33:14+0000", 
  "updated_time": "2012-03-14T11:33:14+0000", 
  "comments": {
    "count": 0
  }, 
  "is_published": true
}

      

+7


source


You should just use https://graph.facebook.com/<postid>

if it's status. You can get the message by clicking on the date / time in the feed.



If the type is comment you can use https://graph.facebook.com/<postid>_<commentid>

+1


source







All Articles