Retrieve Facebook Post Comments Using Graph API

Jeaf Gilbert picture Jeaf Gilbert · Jan 25, 2011 · Viewed 81.4k times · Source

I tried to get Facebook comments using:

http://graph.facebook.com/[post_id]/comments

It results only 2 of 15 comments, and without count info.

{
    "data": [
        {
            "id": "[post_id]",
            "from": {
                "name": "[name]",
                "id": "[id]"
             },
             "message": "[message]",
             "created_time": "2011-01-23T02:36:23+0000"
        },
        {
             "id": "[id]",
             "from": {
             "name": "[name]",
                 "id": "[id]"
             },
            "message": "[message]",
            "created_time": "2011-01-23T05:16:56+0000"
        }
    ]
}

Anyone know why only 2 comments?

Also, I want to retrieve comments (default number) or retrieve comments with my limit number, and get its comments count. Any idea? (Please use Graph API).

Answer

ifaour picture ifaour · Jan 25, 2011

You need to call it from a secure request https and provide an access_token:

https://graph.facebook.com/19292868552_118464504835613/comments?access_token=XXX

EDIT:
Added the object from the post document. try clicking the comments connection and then remove the access_token and try and see the difference.