Type comment

Discussion

All Questions and Answers on a Stack Exchange site can be commented on, and this type represents those comments.

Comments can also be optionally directed at users, when this is the case the reply_to_user property is set (if it is requested in the current filter).

The upvoted field can only be queried for with an access_token with the private_info scope.

Fields

body
string
unchanged in unsafe filters

body_markdown 2.1
string

can_flag 2.2
boolean

comment_id
integer, refers to a comment

content_license 2.2
string

creation_date

edited
boolean

link
string
unchanged in unsafe filters

post_id
integer, refers to a post

post_type
one of question, answer, or article

reply_to_user

score
integer

upvoted 2.2
boolean private_info

Fields marked with are included in the default filter, those marked with are excluded in the default filter.

Examples

Normal Comment

{"owner":{"reputation":9001,"user_id":1,"user_type":"registered","accept_rate":55,"profile_image":"https://www.gravatar.com/avatar/a007be5a61f6aa8f3e85ae2fc18dd66e?d=identicon&r=PG","display_name":"Example User","link":"http://example.stackexchange.com/users/1/example-user"},"edited":false,"creation_date":1735493389,"post_id":5678,"comment_id":12345,"link":"http://example.stackexchange.com/questions/5678/example-title#comment12345_5678","body":"Example comment body"}

Unowned Comment

{"owner":{"user_type":"does_not_exist","display_name":"Non-extant User"},"edited":false,"creation_date":1735493389,"post_id":5678,"comment_id":12345,"link":"http://example.stackexchange.com/questions/5678/example-title#comment12345_5678","body":"Example comment body"}

Reply Comment

{"owner":{"reputation":9001,"user_id":1,"user_type":"registered","accept_rate":55,"profile_image":"https://www.gravatar.com/avatar/a007be5a61f6aa8f3e85ae2fc18dd66e?d=identicon&r=PG","display_name":"Example User","link":"http://example.stackexchange.com/users/1/example-user"},"reply_to_user":{"reputation":18002,"user_id":2,"user_type":"registered","accept_rate":100,"profile_image":"https://www.gravatar.com/avatar/a007be5a61f6aa8f3e85ae2fc18dd66e?d=identicon&r=PG","display_name":"Other User","link":"http://example.stackexchange.com/users/2/other-user"},"edited":false,"creation_date":1735493389,"post_id":5678,"comment_id":12345,"link":"http://example.stackexchange.com/questions/5678/example-title#comment12345_5678","body":"@OtherUser Example comment body"}

Methods That Return This Type