API:REST API/Reference

Overview
The REST API history endpoints provide access to the revision history of a wiki page. You can use the history endpoints to explore recent edits to a page, see metadata for a specific revision, compare versions, and get statistics about the history of a page. The history endpoints are available in MediaWiki 1.35 and later.

Read the guide to exploring page history with the REST API on PAWS.

Get page history
Returns information about the 20 latest revisions to a wiki page, starting with the latest revision. The returned revision segment includes API routes for the next oldest, next newest, and latest revisions, letting you scroll through page history. This endpoint responds to the presence a logged-in user and displays content appropriate to that user's permissions.

Get page history counts
Returns data about a page's history.

Get revision
Returns details for an individual revision. This endpoint responds to the presence a logged-in user and displays content appropriate to that user's permissions.

Compare revisions
Returns data that lets you display a line-by-line comparison of two revisions. (See an example.) Only text-based wiki pages can be compared; trying to compare revisions of other page types, such as image pages, results in a 400 response code. This endpoint responds to the presence a logged-in user and displays content appropriate to that user's permissions.

The compare revisions endpoint requires Wikidiff2 1.9.0 or later.