Skip to main content
The Revisions API provides access to specific revisions by numeric ID, returning their wikitext source, rendered HTML, metadata, or a structured diff comparing two revisions. All endpoints are served under /w/rest.php/v1/revision/.
Revision IDs are assigned at edit time and are unique across all pages on a wiki. To find revision IDs for a page, use the page history endpoint.

GET /v1/revision/{id}

Returns the wikitext source and full metadata for a specific revision.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567

Path parameters

id
integer
required
The numeric revision ID.

Response

id
integer
required
The revision ID.
size
integer
required
Size of the revision content in bytes.
minor
boolean
required
Whether this revision was flagged as a minor edit.
timestamp
string
required
ISO 8601 timestamp of when the revision was made.
content_model
string
required
The content model of the revision (e.g., wikitext, json).
page
object
required
The page this revision belongs to.
license
object
required
License for the content.
user
object
required
The user who made this revision. Null if the user information has been suppressed.
comment
string
required
The edit summary. Null if the comment has been suppressed.
delta
integer
required
Byte difference from the parent revision. Null if the parent revision size is unavailable.
source
string
required
The raw wikitext source of this revision.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567

GET /v1/revision/{id}/bare

Returns revision metadata without the wikitext source, plus a URL pointing to the HTML representation. Suitable for clients that need revision metadata but will fetch HTML separately.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567/bare

Path parameters

id
integer
required
The numeric revision ID.

Response

Same fields as GET /v1/revision/{id} (without source), plus:
html_url
string
The URL from which the Parsoid HTML for this revision can be fetched.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567/bare

GET /v1/revision/{id}/html

Returns the Parsoid HTML for a specific revision. The response body is text/html.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567/html

Path parameters

id
integer
required
The numeric revision ID.
The response content type is text/html, not application/json. The HTML follows the Parsoid HTML specification.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567/html

GET /v1/revision/{id}/with_html

Returns revision metadata combined with the Parsoid HTML in a single JSON response.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567/with_html

Path parameters

id
integer
required
The numeric revision ID.

Response

Same fields as GET /v1/revision/{id}/bare, plus:
html
string
The full Parsoid HTML of the revision as a string.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234567/with_html

GET /v1/revision/{from}/compare/{to}

Compares two revisions and returns a structured JSON diff. Both revisions must belong to the same page. The diff uses the wikidiff2 JSON inline diff format.
This endpoint requires the wikidiff2 PHP extension to be installed on the server. If the extension is not present, the API returns HTTP 500.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234566/compare/1234567

Path parameters

from
integer
required
The revision ID of the base (older) revision.
to
integer
required
The revision ID of the target (newer) revision.

Response

from
object
required
Information about the base revision.
to
object
required
Information about the target revision. Same structure as from.
diff
array
required
An array of diff operation objects in the wikidiff2 JSON inline diff format. Each object describes a block of changed, added, or removed content.
curl https://en.wikipedia.org/w/rest.php/v1/revision/1234566/compare/1234567
To compare the latest revision of a page with any earlier revision, first retrieve the current revision ID from GET /v1/page/{title}/bare, then use it as the to parameter.

Build docs developers (and LLMs) love