Stack Overflow Revisions API
Every version of a question or answer, with who changed it, when, and the text on either side.
GET /v1/stack-overflow/posts/{postId}/revisions1 credit Failed requests are free
About this endpoint
GET /v1/stack-overflow/posts/{postId}/revisions returns the edit history of a post, newest first, up to 100 per page. Each revision has guid, number, type (single_user or vote_based), postId, postType, createdAt, author, comment (the edit summary as plain text; markup on bounty and bot rows is stripped), isRollback, setCommunityWiki, title, tags, bodyHtml, previousTitle, previousTags and previousBodyHtml.
A rollback and a close or lock are vote_based and can have no single author, so author is null there. A post that does not exist is not_found. Page with page.nextCursor while page.hasMore is true, and check limitReached on a list that stops at the ceiling.
Stack Overflow Revisions API FAQ
Can I see what the post said before an edit?
Yes. Each revision carries previousBodyHtml, previousTitle and previousTags beside the post-edit bodyHtml, title and tags.
How many credits does a revisions page cost?
Pricing is documented on the operation in the API registry (shown on this page). Confirm on every response with meta.creditsCharged: that field is the billing source of truth. Each paginated page is a separate billed request.
Why is a revision's author null?
A vote_based revision, such as a rollback or a close, has no single author. single_user revisions name the editor in author.
Does it work for answers?
Yes. Pass an answer id as postId. read postType to see whether the revision belongs to a question or an answer; title and tags are empty for answers.
Other Stack Overflow endpoints
- QuestionGET /v1/stack-overflow/questions/{questionId}
- Questions by idGET /v1/stack-overflow/questions/batch
- QuestionsGET /v1/stack-overflow/questions
- SearchGET /v1/stack-overflow/questions/search
- Similar titlesGET /v1/stack-overflow/questions/title-search
- AnswersGET /v1/stack-overflow/questions/{questionId}/answers
- CommentsGET /v1/stack-overflow/posts/{postId}/comments
- Comments by postGET /v1/stack-overflow/posts/comments