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
 WIP -- to be completed (time to consider moving to swagger which also provides great formatting) 

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


 * 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.

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 (not all formats are supported in all API endpoints)
 * body_only (optional)
 * boolean flag, only return the HTML body.innerHTML instead of a full document

Wikitext -> HTML

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

HTML -> Wikitext

 * format1 : one of html or pagebundle
 * 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