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.

v3 API
 Work in progress -- to be completed 

Common 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

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


 * format : one of html or pagebundle
 * html
 * Parsoid's XHTML5 + RDFa output, which includes inlined data-parsoid attributes. Content type is text/html. The HTML conforms to the MediaWiki DOM spec.
 * 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


 * bodyOnly (optional)
 * boolean flag, only return the HTML body.innerHTML instead of a full document

Wikitext -> HTML

 * format1 : wikitext
 * format2 : one of html or pagebundle
 * bodyOnly (optional parameter) : boolean flag, only return the HTML body.innerHTML instead of a full document

HTML -> Wikitext

 * format1 : one of html or pagebundle
 * html
 * data-parsoid is expected to be inline attributes of the DOM elements. The HTML parameter is converted to wikitext.
 * pagebundle
 * This parameter is expected to have the html and data-parsoid properties which Parsoid combines into a single DOM with inlined data-parsoid properties. This DOM is then converted to wikitext.


 * format2 : wikitext
 * scrubWikitext (optional parameter) : boolean flag, which normalizes the DOM to yield cleaner wikitext than might otherwise be generated.

-- to be completed with documentation about original wikitext, original html --

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