Type answer

Discussion

This type represents an answer to a question on one of the Stack Exchange sites, such as this famous answer of bobince's.

As on the question page, it is possible to fetch the comments on an answer as part of a call; though this is not done by default.

The upvoted, downvoted, and accepted fields can only be queried for with an access_token with the private_info scope.

Fields

accepted 2.2
boolean private_info

answer_id
integer, refers to an answer

awarded_bounty_amount 2.2
integer
may be absent

awarded_bounty_users 2.2

body
string
unchanged in unsafe filters

body_markdown 2.2
string

can_comment 2.3
boolean

can_edit 2.3
boolean

can_flag 2.2
boolean
unchanged in unsafe filters

can_suggest_edit 2.3
boolean

collectives 2.3
an array of collectives

comment_count 2.2
integer

comments
an array of comments
may be absent

community_owned_date

content_license 2.2
string

creation_date

down_vote_count
integer

downvoted 2.2
boolean private_info

is_accepted
boolean

last_activity_date

last_edit_date

last_editor 2.2

link
string
unchanged in unsafe filters

locked_date

posted_by_collectives 2.3
an array of collectives

question_id
integer, refers to a question

recommendations 2.3

score
integer

share_link 2.2
string
unchanged in unsafe filters

tags 2.1
an array of strings

title
string

up_vote_count
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 Answer

{"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"},"down_vote_count":2,"up_vote_count":3,"is_accepted":false,"score":1,"last_activity_date":1710775812,"last_edit_date":1710801012,"creation_date":1710732612,"answer_id":5678,"question_id":1234,"link":"http://example.stackexchange.com/questions/1234/an-example-post-title/5678#5678","title":"An example post title","body":"An example post body"}

Locked Answer

{"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"},"down_vote_count":2,"up_vote_count":3,"is_accepted":false,"score":1,"last_activity_date":1710775812,"creation_date":1710732612,"locked_date":1710797412,"answer_id":5678,"question_id":1234,"link":"http://example.stackexchange.com/questions/1234/an-example-post-title/5678#5678","title":"An example post title","body":"An example post body"}

Community Owned Answer

{"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"},"down_vote_count":2,"up_vote_count":3,"is_accepted":false,"score":1,"last_activity_date":1710775812,"creation_date":1710732612,"answer_id":5678,"question_id":1234,"link":"http://example.stackexchange.com/questions/1234/an-example-post-title/5678#5678","title":"An example post title","body":"An example post body"}

Methods That Return This Type