Comments
Create, update, delete, and query the Comments for a Target. Comments may also be inserted based on a Target or deleted based on Id.
Table Specific Information
Comments in Facebook are comments about a specific thing. They are always associated with a target, which is the item the comment is directed toward. For example, this could be a post, a picture, or a video. Using this table, you can list the comments for a specific target and also insert new comments about a target.
Note: Due to a deprecation in the Facebook API, queries to the Comments, Photos, Posts, and Videos views where a user profile is either the defined or default target, no longer return data for the following fields:
- comments
- message_tags
- reactions
- sharedposts
- story
- story_tags
- to
- via
Select
When querying comments, either the Target or the Id of the comment may be specified. For example, to retrieve all the comments about a specific post, your SELECT statement could look something like this:
SELECT * FROM Comments WHERE Target = '15526475270_410830705612736'
Alternatively, you can specify the Id to retrieve a specific comment. For example:
SELECT * FROM Comments WHERE Id = '15526475270_410830705612736_5193593'
If no Target or Id is specified, comments will be queried from the posts of the feed of the currently authenticated user or page.
Multiple queries can also be composed together to retrieve comments from posts across multiple Facebook entities. For instance:
SELECT * FROM Comments WHERE Target IN (SELECT Id FROM Posts WHERE Target IN (SELECT Id FROM Pages))
If you are looking for comments for all posts, please consider looking at the Posts table or the Wall view. They contain the columns 'CommentsData' and 'CommentsCount'. 'CommentsCount' can be queried to filter and only select posts (targets) on which a comment has been made:
SELECT * FROM Wall WHERE CommentsCount > 0
Columns
Name | Type | Description |
ID [KEY] | String | The Id of the comment. |
Target | String | The Id of the target you are retrieving comments for. This may be an album, checkin, link, note, photo, post, status update, or video. |
FromId | String | Id of the user who made the comment. |
FromName | String | Name of the user who made the comment. |
FromPicture | String | Picture of the user who made the comment. |
Message | String | The text of the comment. |
MessageTags | String | Aggregate of tags contained in the message. |
Likes | Integer | The number of likes the comment has. |
CommentsCount | Integer | The number of comments in reply to this comment. |
LikesData | String | Aggregate of likes information on the comment. |
UserLikes | Boolean | Boolean indicating if the authenticated user likes the comment. |
CanRemove | Boolean | Boolean indicating if the comment can be removed. |
Attachments | String | An aggregate for the attachments of the post. |
CreatedTime | Datetime | The time the comment was created. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source. For more information, see the WHERE clause section.
Name | Type | Description |
offset | String | Which result to begin returning results from. Used for manual paging of results. |