Stack Overflow

Get Stack Overflow question

Get a Stack Overflow question with its text, tags, votes, closed or locked state and, if asked, its answers and comments.

GET/v1/stack-overflow/questions/{questionId}
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
3
questionIdintegerrequiredpath

Question id on the chosen site, e.g. `11227809`.

≥ 1 · ≤ 2147483647

sitestringoptionalquery

Stack Exchange site, by its API name (`askubuntu`, `serverfault`, `math`, `ru.stackoverflow`). Default: `stackoverflow`. The sites endpoint lists them all.

includearrayoptionalquery

Extra parts to return with the question: `answers`, `comments` (the question's comments, and each answer's when `answers` is also asked for), or both, comma-separated. Default: neither.

Response fields
197

Endpoint-specific response payload.

datalookupStatus
string

`not_found` when the question does not exist or was deleted.

one of: found, not_found

datasite
string

The Stack Exchange site the question belongs to.

The question when `lookupStatus` is `found`; otherwise null.

dataquestionid
integer

Question id.

dataquestionurl
stringnullable

Link to the question.

dataquestiontitle
stringnullable

Title, with HTML entities decoded.

Tags.

dataquestiontags[]
stringoptional
dataquestionscore
integernullable

Votes up minus votes down.

Vote counts.

dataquestionvotesup
integernullable

Upvotes.

dataquestionvotesdown
integernullable

Downvotes.

dataquestionviewCount
integernullable

Views.

dataquestionanswerCount
integernullable

Answers.

dataquestioncommentCount
integernullable

Comments on the question.

dataquestionfavoriteCount
integernullable

Times favourited.

dataquestionisAnswered
booleannullable

Whether it has an accepted or upvoted answer.

dataquestionacceptedAnswerId
integernullable

The accepted answer; null when none.

dataquestioncreatedAt
stringnullable

When it was asked, ISO 8601 UTC.

dataquestionlastActivityAt
stringnullable

Last activity, ISO 8601 UTC.

dataquestionlastEditedAt
stringnullable

Last edit, ISO 8601 UTC; null when never edited.

dataquestioncommunityWikiAt
stringnullable

When it became a community wiki; null when it is not.

dataquestionprotectedAt
stringnullable

When it was protected; null when it is not.

dataquestionlockedAt
stringnullable

When it was locked; null when it is not.

Why it was closed; null when it is open.

dataquestionclosedat
stringnullable

When it was closed, ISO 8601 UTC.

dataquestionclosedreason
stringnullable

Why it was closed, e.g. `Duplicate`.

dataquestioncloseddescriptionHtml
stringnullable

The explanation shown on the question, as HTML.

The users who voted to close.

dataquestionclosedbyUsers[]id
integernullable

User id on this site; null for a deleted user.

dataquestionclosedbyUsers[]accountId
integernullable

Network-wide account id, the same on every site.

dataquestionclosedbyUsers[]name
stringnullable

Display name.

dataquestionclosedbyUsers[]url
stringnullable

Profile URL.

dataquestionclosedbyUsers[]imageUrl
stringnullable

Avatar URL.

dataquestionclosedbyUsers[]reputation
integernullable

Reputation on this site.

dataquestionclosedbyUsers[]type
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionclosedbyUsers[]acceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

The questions this one duplicates.

dataquestionclosedoriginalQuestions[]id
integer

Question id of the original.

dataquestionclosedoriginalQuestions[]title
stringnullable

Its title.

dataquestionclosedoriginalQuestions[]answerCount
integernullable

Its answer count.

dataquestionclosedoriginalQuestions[]accepted
booleannullable

Whether it has an accepted answer.

The open bounty; null when none.

dataquestionbountyamount
integernullable

Reputation offered.

dataquestionbountyclosesAt
stringnullable

When the bounty closes, ISO 8601 UTC.

Who offered it.

dataquestionbountysponsorid
integernullable

User id on this site; null for a deleted user.

dataquestionbountysponsoraccountId
integernullable

Network-wide account id, the same on every site.

dataquestionbountysponsorname
stringnullable

Display name.

dataquestionbountysponsorurl
stringnullable

Profile URL.

dataquestionbountysponsorimageUrl
stringnullable

Avatar URL.

dataquestionbountysponsorreputation
integernullable

Reputation on this site.

dataquestionbountysponsortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionbountysponsoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

The lock, protection or bounty banner; null when none.

dataquestionnoticebodyHtml
stringnullable

The banner text as HTML (a lock, a protection or a bounty).

dataquestionnoticecreatedAt
stringnullable

When the banner was put up, ISO 8601 UTC.

dataquestionnoticeownerUserId
integernullable

Who put it up.

Who asked it.

dataquestionauthorid
integernullable

User id on this site; null for a deleted user.

dataquestionauthoraccountId
integernullable

Network-wide account id, the same on every site.

dataquestionauthorname
stringnullable

Display name.

dataquestionauthorurl
stringnullable

Profile URL.

dataquestionauthorimageUrl
stringnullable

Avatar URL.

dataquestionauthorreputation
integernullable

Reputation on this site.

dataquestionauthortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionauthoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

Who edited it last; null when never edited.

dataquestionlastEditorid
integernullable

User id on this site; null for a deleted user.

dataquestionlastEditoraccountId
integernullable

Network-wide account id, the same on every site.

dataquestionlastEditorname
stringnullable

Display name.

dataquestionlastEditorurl
stringnullable

Profile URL.

dataquestionlastEditorimageUrl
stringnullable

Avatar URL.

dataquestionlastEditorreputation
integernullable

Reputation on this site.

dataquestionlastEditortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionlastEditoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

dataquestionlicense
stringnullable

Content licence, e.g. `CC BY-SA 4.0`; null when the site does not say.

dataquestionmigratedFrom
stringnullable

The site it was moved from; null when it was not moved.

dataquestionmigratedTo
stringnullable

The site it was moved to; null when it was not moved.

dataquestionbodyHtml
stringnullable

Question text as HTML; null on lists that were not asked for bodies.

dataquestionbodyMarkdown
stringnullable

Question text as Markdown; null on lists that were not asked for bodies.

The answers when asked for with `include=answers`; null otherwise.

dataquestionanswers[]id
integer

Answer id.

dataquestionanswers[]questionId
integernullable

The question it answers.

dataquestionanswers[]questionTitle
stringnullable

Title of the question it answers, with HTML entities decoded.

Tags of the question it answers, filled when the answer is nested in its question; empty on answer lists, which do not carry them.

dataquestionanswers[]tags[]
stringoptional
dataquestionanswers[]url
stringnullable

Link to the answer.

dataquestionanswers[]score
integernullable

Votes up minus votes down.

Vote counts.

dataquestionanswers[]votesup
integernullable

Upvotes.

dataquestionanswers[]votesdown
integernullable

Downvotes.

dataquestionanswers[]isAccepted
booleannullable

Whether the asker accepted it.

dataquestionanswers[]createdAt
stringnullable

When it was posted, ISO 8601 UTC.

dataquestionanswers[]lastActivityAt
stringnullable

Last edit or activity, ISO 8601 UTC.

dataquestionanswers[]lastEditedAt
stringnullable

Last edit, ISO 8601 UTC; null when never edited.

dataquestionanswers[]communityWikiAt
stringnullable

When it became a community wiki; null when it is not.

dataquestionanswers[]lockedAt
stringnullable

When it was locked; null when it is not.

Who wrote it.

dataquestionanswers[]authorid
integernullable

User id on this site; null for a deleted user.

dataquestionanswers[]authoraccountId
integernullable

Network-wide account id, the same on every site.

dataquestionanswers[]authorname
stringnullable

Display name.

dataquestionanswers[]authorurl
stringnullable

Profile URL.

dataquestionanswers[]authorimageUrl
stringnullable

Avatar URL.

dataquestionanswers[]authorreputation
integernullable

Reputation on this site.

dataquestionanswers[]authortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionanswers[]authoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

Who edited it last; null when never edited.

dataquestionanswers[]lastEditorid
integernullable

User id on this site; null for a deleted user.

dataquestionanswers[]lastEditoraccountId
integernullable

Network-wide account id, the same on every site.

dataquestionanswers[]lastEditorname
stringnullable

Display name.

dataquestionanswers[]lastEditorurl
stringnullable

Profile URL.

dataquestionanswers[]lastEditorimageUrl
stringnullable

Avatar URL.

dataquestionanswers[]lastEditorreputation
integernullable

Reputation on this site.

dataquestionanswers[]lastEditortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionanswers[]lastEditoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

dataquestionanswers[]license
stringnullable

Content licence, e.g. `CC BY-SA 4.0`.

dataquestionanswers[]commentCount
integernullable

Comments on the answer.

The bounty this answer was awarded; null when none.

dataquestionanswers[]bountyAwardedamount
integernullable

Reputation awarded.

Who received it.

dataquestionanswers[]bountyAwardedusers[]id
integernullable

User id on this site; null for a deleted user.

dataquestionanswers[]bountyAwardedusers[]accountId
integernullable

Network-wide account id, the same on every site.

dataquestionanswers[]bountyAwardedusers[]name
stringnullable

Display name.

dataquestionanswers[]bountyAwardedusers[]url
stringnullable

Profile URL.

dataquestionanswers[]bountyAwardedusers[]imageUrl
stringnullable

Avatar URL.

dataquestionanswers[]bountyAwardedusers[]reputation
integernullable

Reputation on this site.

dataquestionanswers[]bountyAwardedusers[]type
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionanswers[]bountyAwardedusers[]acceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

dataquestionanswers[]bodyHtml
stringnullable

Answer text as HTML; null when bodies were not asked for.

dataquestionanswers[]bodyMarkdown
stringnullable

Answer text as Markdown; null when bodies were not asked for.

Comments on the answer when asked for with `include=comments`; null otherwise.

dataquestionanswers[]comments[]id
integer

Comment id.

dataquestionanswers[]comments[]postId
integernullable

The question or answer the comment is on.

dataquestionanswers[]comments[]postType
stringnullable

Whether the comment is on a question or an answer; null when not known.

one of: question, answer, null

dataquestionanswers[]comments[]url
stringnullable

Link to the comment.

dataquestionanswers[]comments[]score
integernullable

Upvotes the comment received.

dataquestionanswers[]comments[]edited
booleannullable

Whether the comment was edited. The flag comes from the route that returned the comment, so the same comment can differ between routes.

dataquestionanswers[]comments[]createdAt
stringnullable

When it was written, ISO 8601 UTC.

Who wrote it.

dataquestionanswers[]comments[]authorid
integernullable

User id on this site; null for a deleted user.

dataquestionanswers[]comments[]authoraccountId
integernullable

Network-wide account id, the same on every site.

dataquestionanswers[]comments[]authorname
stringnullable

Display name.

dataquestionanswers[]comments[]authorurl
stringnullable

Profile URL.

dataquestionanswers[]comments[]authorimageUrl
stringnullable

Avatar URL.

dataquestionanswers[]comments[]authorreputation
integernullable

Reputation on this site.

dataquestionanswers[]comments[]authortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionanswers[]comments[]authoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

The user the comment is addressed to, when it is a reply. Null when the comment is not a reply; on the comments-by-post routes it is always null because those routes do not carry reply targets.

dataquestionanswers[]comments[]replyToid
integernullable

User id on this site; null for a deleted user.

dataquestionanswers[]comments[]replyToaccountId
integernullable

Network-wide account id, the same on every site.

dataquestionanswers[]comments[]replyToname
stringnullable

Display name.

dataquestionanswers[]comments[]replyTourl
stringnullable

Profile URL.

dataquestionanswers[]comments[]replyToimageUrl
stringnullable

Avatar URL.

dataquestionanswers[]comments[]replyToreputation
integernullable

Reputation on this site.

dataquestionanswers[]comments[]replyTotype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestionanswers[]comments[]replyToacceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

dataquestionanswers[]comments[]isByPostAuthor
booleannullable

Whether the comment's author wrote the post it is on; null on lists that do not carry it.

dataquestionanswers[]comments[]license
stringnullable

Content licence, e.g. `CC BY-SA 4.0`.

dataquestionanswers[]comments[]bodyHtml
stringnullable

Comment text as HTML.

dataquestionanswers[]comments[]bodyMarkdown
stringnullable

Comment text as Markdown; null on lists that do not carry it.

dataquestionanswersComplete
booleannullable

False when the list in `answers` has fewer answers than `answerCount` says the question has; null when answers were not asked for.

Comments on the question when asked for with `include=comments`; null otherwise.

dataquestioncomments[]id
integer

Comment id.

dataquestioncomments[]postId
integernullable

The question or answer the comment is on.

dataquestioncomments[]postType
stringnullable

Whether the comment is on a question or an answer; null when not known.

one of: question, answer, null

dataquestioncomments[]url
stringnullable

Link to the comment.

dataquestioncomments[]score
integernullable

Upvotes the comment received.

dataquestioncomments[]edited
booleannullable

Whether the comment was edited. The flag comes from the route that returned the comment, so the same comment can differ between routes.

dataquestioncomments[]createdAt
stringnullable

When it was written, ISO 8601 UTC.

Who wrote it.

dataquestioncomments[]authorid
integernullable

User id on this site; null for a deleted user.

dataquestioncomments[]authoraccountId
integernullable

Network-wide account id, the same on every site.

dataquestioncomments[]authorname
stringnullable

Display name.

dataquestioncomments[]authorurl
stringnullable

Profile URL.

dataquestioncomments[]authorimageUrl
stringnullable

Avatar URL.

dataquestioncomments[]authorreputation
integernullable

Reputation on this site.

dataquestioncomments[]authortype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestioncomments[]authoracceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

The user the comment is addressed to, when it is a reply. Null when the comment is not a reply; on the comments-by-post routes it is always null because those routes do not carry reply targets.

dataquestioncomments[]replyToid
integernullable

User id on this site; null for a deleted user.

dataquestioncomments[]replyToaccountId
integernullable

Network-wide account id, the same on every site.

dataquestioncomments[]replyToname
stringnullable

Display name.

dataquestioncomments[]replyTourl
stringnullable

Profile URL.

dataquestioncomments[]replyToimageUrl
stringnullable

Avatar URL.

dataquestioncomments[]replyToreputation
integernullable

Reputation on this site.

dataquestioncomments[]replyTotype
stringnullable

Kind of account.

one of: registered, moderator, unregistered, does_not_exist, team_admin, null

dataquestioncomments[]replyToacceptRate
integernullable

Percent of the user's questions with an accepted answer; null when not shown.

dataquestioncomments[]isByPostAuthor
booleannullable

Whether the comment's author wrote the post it is on; null on lists that do not carry it.

dataquestioncomments[]license
stringnullable

Content licence, e.g. `CC BY-SA 4.0`.

dataquestioncomments[]bodyHtml
stringnullable

Comment text as HTML.

dataquestioncomments[]bodyMarkdown
stringnullable

Comment text as Markdown; null on lists that do not carry it.

Metadata describing the request and billing outcome.

metarequestId
string

Unique request identifier for tracing this API call.

min 1 chars

metacreditsCharged
integer

Credits charged for this request.

≥ 0

metaversion
string

Public API version that served the response.

one of: v1

Code example

curl "https://api.socialfetch.dev/v1/stack-overflow/questions/11227809?include=answers" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Question.