Comments associated with one or more fb:comments as represented in FQL.
| Name | Description |
|---|---|
app_id id | The application id associated with this comment |
can_comment bool | If the current user is able to post a comment reply |
can_like bool | If the current user is able to like this comment |
can_remove bool | If the current user is able to remove this comment |
comment_count unsigned int32 | The number of replies to this comment |
fromid id | The user submitting a comment |
| string | A unique ID for a given XID for each comment |
is_private bool | If this comment is private |
likes unsigned int32 | The number of likes for this comment |
| id | The object_id of an object on Facebook. This can be a video, note, link, photo, or photo album. Note that for photos and albums, the object_id must be queried from the photo and album FQL tables. Note that in the photo and album tables, object_id is a different field from pid and aid. You must specify either an xid or an object_id |
object_id_cursor string | The next page of results for this object |
| string | The ID of the parent comment to this reply or 0 (zero) if this is a top-level comment |
parent_id_cursor string | The cursor of the parent_id field |
post_fbid numeric string | The object_id of this comment. This can be used for querying likes for this comment or replies to this comment if the comment came from the comments plugin |
| string | The ID of the post in the stream |
post_id_cursor string | The next page of results for this post |
text string | The text of a comment |
text_tags array | Array of mention objects for each object tagged in the comment |
time timestamp | A UNIX timestamp associated with the creation time of a comment |
user_likes bool | If the current user liked this comment |
To read the comment table you need
access_token for public dataaccess_token to access private field: user_likesSome comment threads, for example those from the Comments Plugin, are sorted by social relevance and not by time. Since there is no social_relevance column to ORDER BY, in order to get comments in socially relevant order, please add "AND parent_id='0'" to the WHERE clause of your query and omit any ORDER BY. For example:
SELECT id, text, time, fromid FROM comment WHERE object_id='10151309718465667' AND parent_id='0'
Will get the top level comments on this photo in the order they appear on the site. If you would like to get the comments in chronological order, simply add ORDER BY time:
SELECT id, text, time, fromid FROM comment WHERE object_id='10151309718465667' AND parent_id='0' ORDER BY time
To find out the default display order, select the comment_info column of the appropriate table. For the above example that would be:
SELECT comment_info FROM photo WHERE object_id='10151309718465667'
This will return a comment_info object with the comment_order:
{
"comment_info": {
"can_comment": true,
"comment_count": 19,
"comment_order": "ranked"
}
}