API:REST API/Reference

The REST API lets you interact with MediaWiki by sending HTTP requests to unique URLs. You can use the API to build apps and scripts that search wiki pages and explore page history.

= Search =

Search result object
The search result object represents a wiki page matching the requested search.

Search pages
Searches wiki page titles and contents for the provided search terms, and returns matching pages.

Autocomplete page title
Searches wiki page titles, and returns matches between the beginning of a title and the provided search terms. You can use this endpoint for a typeahead search that automatically suggests relevant pages by title.

Responses
= History =

Revision object
The revision object represents a change to a wiki page.

Get page history
Returns information about the latest revisions to a wiki page, in segments of 20 revisions, starting with the latest revision. The response includes API routes for the next oldest, next newest, and latest revision segments, letting you scroll through page history.

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

Get revision
Returns details for an individual revision.

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.