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_markdown 2.1
string
can_flag 2.2
boolean
content_license 2.2
string
edited
boolean
post_type
one of
question
, answer
, or article
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":1728941294,"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":1728941294,"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":1728941294,"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
answers/{ids}/comments
articles/{ids}/comments
comments
comments/{ids}
posts/{ids}/comments
posts/{id}/comments/render 2.2
comments/{id}/flags/add 2.2
comments/{id}/upvote/undo 2.2
comments/{id}/upvote 2.2
comments/{id}/delete 2.1
comments/{id}/edit 2.1
posts/{id}/comments/add 2.1
questions/{ids}/comments
users/{ids}/comments
users/{ids}/comments/{toid}
users/{ids}/mentioned
me/comments
me/comments/{toid}
me/mentioned
articles/{ids}/comments
comments
comments/{ids}
posts/{ids}/comments
posts/{id}/comments/render 2.2
comments/{id}/flags/add 2.2
comments/{id}/upvote/undo 2.2
comments/{id}/upvote 2.2
comments/{id}/delete 2.1
comments/{id}/edit 2.1
posts/{id}/comments/add 2.1
questions/{ids}/comments
users/{ids}/comments
users/{ids}/comments/{toid}
users/{ids}/mentioned
me/comments
me/comments/{toid}
me/mentioned