Parsoid/API

Parsoid converts MediaWiki's Wikitext to XHTML5 + RDFa and back.

In addition to the API defined below, the Parsoid service provides some form-based debugging tools at. These are subject to change and may disappear at any time.

Common HTTP headers supported in all entry points

 * Accept-encoding : Please accept gzip.
 * Cookie : Cookie header that will be forwarded to the Mediawiki API. Makes it possible to use Parsoid with private wikis. Setting a cookie implicitly disables all caching for security reasons, so do not send a cookie for public wikis if you care about caching.
 * x-request-id : A request id that will be forward to the Mediawiki Api.

Common path parameters across all requests

 * domain
 * The hostname of the wiki


 * title
 * Page title -- needs to be urlencoded (percent encoded)


 * revision
 * revision id of the title


 * format
 * input / output format of content - wikitext, html, or pagebundle
 * wikitext
 * plain text that is treated as wikitext. Content type is text/plain.
 * html
 * Parsoid's XHTML5 + RDFa output, which includes inlined data-parsoid attributes. The HTML conforms to the MediaWiki DOM spec. Content type is text/html.
 * pagebundle
 * a JSON blob containing the above html with the data-parsoid attributes split out and ids added to each node. Content type is application/json.

Common payload / querystring parameters across all requests

 * body_only
 * optional boolean flag, only return the HTML body.innerHTML instead of a full documen


 * scrub_wikitext
 * optional boolean flag, which normalizes the DOM to yield cleaner wikitext than might otherwise be generated.

Wikitext -> HTML

 * revision
 * revision is optional, however GET requests without a revision id should be considered a convenience method. If no revision id is provided, it'll redirect to the latest revision.


 * format
 * one of html or pagebundle (nb. not all formats are supported in all API endpoints)

Some querystring parameters are also accepted: body_only

POST requests
Content type for the post payload can be:,  , or

Wikitext -> HTML
Some payload parameters are also accepted: body_only
 * format1: wikitext
 * format2: one of html or pagebundle

HTML -> Wikitext

 * format1
 * one of html or pagebundle


 * format2: wikitext

Some payload parameters are also accepted: scrub_wikitext

Examples
Some simple GET requests to a Parsoid HTTP server bound to.

Returns text/html

Returns application/json

For more intricate examples, see Parsoid's API test suite.

v2 API
'The v2 API is being deprecated. Please move to the v3 API which is much closer to RESTBase url structure'

Parsoid gained a "v2" API in December 2014 to act as middleware behind RESTBase entry points.

Parsoid/API/v2

v1 API entry points
The v1 API is deprecated.

Parsoid/API/v1