< Parsoid‎ | API

v2 API is now deprecated. These incomplete docs have been archived from the main API docs page.

Parsoid gained a "v2" API in December 2014 to act as middleware behind RESTBase entry points. The spec for it is at docs/specs/apiv2.yaml.

The main addition is a new format pagebundle, that responds to a request with a JSON structure containing separate data-parsoid data for clean roundtripping between HTML and wikitext and a html key with slimmer HTML of {title} without data-parsoid attributes.

For example, compare the value of html.body in

with the HTML of

Path ParametersEdit

The entry points are of the form /v2/{domain}/{format}/{title}/{revision}

The hostname of the wiki, rather than the wiki database {prefix} in v1 entry points.
Content format returned by the API.
Page title.
Page revision number.


Content formats returned by the API.

Parsoid's XHTML5 + RDFa output, which includes inlined data-parsoid attributes. Content type is text/html
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
Wikitext. Content type is text/plain


The payloads should be delivered as JSON.

wikitext original


For wt2html conversionEdit

The wikitext to convert.
body (optional)
A boolean flag. If true, returns only the <body> element of the result.
Note that this is subtly different from the RESTbase "bodyOnly" option, which returns the *children* of the <body> element.


Internal data for clean roundtripping between HTML and wikitext.
Parsoid's XHTML5 + RDFa output.
Everyone's favourite markup language.

These all should contain,

  "headers": { "content-type": "..." },
  "body": "..."


GET requestsEdit

The acceptable format parameters for GET requests are html and pagebundle.

GET /v2/{domain}/{format}/{title}

Redirects to the latest revision.

GET /v2/{domain}/{format}/{title}/{revision}

Returns {format} for a given revision.

POST requestsEdit

The acceptable format parameters for POST requests are html and pagebundle.


POST requestsEdit