Parsoid/API/v2

'''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, that responds to a request with a JSON structure containing separate   data for clean roundtripping between HTML and wikitext and a   key with slimmer HTML of {title} without   attributes.

For example, compare the value of html.body in
 * http://parsoid-lb.eqiad.wikimedia.org/v2/en.wikipedia.org/pagebundle/Siskiwit_Lake/650380826

with the HTML of
 * http://parsoid-lb.eqiad.wikimedia.org/enwiki/html/Siskiwit_Lake?oldid=650380826

Path Parameters
The entry points are of the form
 * The hostname of the wiki, rather than the wiki database {prefix} in v1 entry points.
 * The hostname of the wiki, rather than the wiki database {prefix} in v1 entry points.


 * Content format returned by the API.
 * Content format returned by the API.


 * Page title.
 * Page title.


 * Page revision number.
 * Page revision number.

Formats
Content formats returned by the API.
 * Parsoid's XHTML5 + RDFa output, which includes inlined  attributes. Content type is
 * Parsoid's XHTML5 + RDFa output, which includes inlined  attributes. Content type is


 * A JSON blob containing the above  with the   attributes split out and ids added to each node. Content type is
 * A JSON blob containing the above  with the   attributes split out and ids added to each node. Content type is


 * Wikitext. Content type is
 * Wikitext. Content type is

Payloads
The payloads should be delivered as JSON.

For wt2html conversion

 * The wikitext to convert.
 * The wikitext to convert.


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

Keys

 * Internal data for clean roundtripping between HTML and wikitext.
 * Internal data for clean roundtripping between HTML and wikitext.


 * Parsoid's XHTML5 + RDFa output.
 * Parsoid's XHTML5 + RDFa output.


 * Everyone's favourite markup language.
 * Everyone's favourite markup language.

These all should contain, {  "headers": { "content-type": "..." },  "body": "..." }

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

Redirects to the latest revision.

Returns  for a given revision.

POST Requests
The acceptable format parameters for POST requests are  and.