Stack Overflow

List Stack Overflow post revisions

List the versions of a Stack Overflow post, with the text before and after each edit.

GET/v1/stack-overflow/posts/{postId}/revisions
1credit
x-api-keystringheader

API key (`sfk_...`)

Parameters
4
postIdintegerrequiredpath

Post id (a question or an answer) on the chosen site, e.g. `11227902`.

≥ 1 · ≤ 2147483647

sitestringoptionalquery

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

limitintegeroptionalquery

Up to this many rows per page, 1 to 100. Default: 30. A page can hold fewer than `limit` rows where rows share a creation second or a block of 100 rows ends. Follow `page.nextCursor` until `hasMore` is false.

≥ 1 · ≤ 100

cursorstringoptionalquery

Cursor from `page.nextCursor` of the previous response. It only works with the same filters.

min 1 chars · max 1024 chars

Response fields
39

Endpoint-specific response payload.

datalookupStatus
string

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

one of: found, not_found

datasite
string

The Stack Exchange site the revisions belong to.

datapostId
integer

The post the revisions belong to.

The revisions on this page, newest first.

datarevisions[]guid
stringnullable

Identifier of the revision.

datarevisions[]number
integernullable

Position in the post's history, 1 for the first version.

datarevisions[]type
stringnullable

`single_user` (an edit by one user) or `vote_based` (a rollback, a close or a community change).

datarevisions[]postId
integernullable

The post the revision belongs to.

datarevisions[]postType
stringnullable

`question` or `answer`.

datarevisions[]createdAt
stringnullable

When the revision was made, ISO 8601 UTC.

Who made it; null when the revision has no single author.

datarevisions[]authorid
integernullable

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

datarevisions[]authoraccountId
integernullable

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

datarevisions[]authorname
stringnullable

Display name.

datarevisions[]authorurl
stringnullable

Profile URL.

datarevisions[]authorimageUrl
stringnullable

Avatar URL.

datarevisions[]authorreputation
integernullable

Reputation on this site.

datarevisions[]authortype
stringnullable

Kind of account.

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

datarevisions[]authoracceptRate
integernullable

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

datarevisions[]comment
stringnullable

The edit summary as plain text. A bounty or bot row carries markup, which is stripped.

datarevisions[]isRollback
booleannullable

Whether the revision restored an older version.

datarevisions[]setCommunityWiki
booleannullable

Whether the revision turned the post into a community wiki.

datarevisions[]title
stringnullable

The title after the revision; null for answers.

The tags after the revision; empty for answers.

datarevisions[]tags[]
stringoptional
datarevisions[]bodyHtml
stringnullable

The text after the revision, as HTML.

datarevisions[]previousTitle
stringnullable

The title before the revision.

The tags before the revision.

datarevisions[]previousTags[]
stringoptional
datarevisions[]previousBodyHtml
stringnullable

The text before the revision, as HTML.

Pagination state for the current page.

datapagehasMore
boolean

Whether another page is available.

datapagenextCursor
stringnullable

Cursor for the next page; null on the last page.

datalimitReached
boolean

True when the list stopped at the site's 25-page ceiling (2,500 rows, or 625 when the page carries text), or when a user's answer or comment list is too large for page-offset paging and has served its first 100 rows (25 when it carries text). Sort by `creation` to page deeper. False for every list that ends because it ran out.

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/posts/11227902/revisions" \
  -H "x-api-key: YOUR_API_KEY"

Responses

Revision listing.