Output formats
Choose outputs with the repeatable export query parameter when you upload. If you choose none, you get plain text.
export value |
Published file | Contents |
|---|---|---|
txt |
document.txt |
UTF-8 text in reading order. A form feed (U+000C) separates pages; a blank page has an empty body. |
html |
document.html |
Semantic HTML: tables with headers and spans, figures with captions, MathML for recognized formulas. |
markdown |
document.md |
GitHub-flavored Markdown: pipe tables for simple grids, embedded HTML tables for merged cells, LaTeX math. |
json |
document.json |
The structured document: pages, blocks, tables and bounding boxes. |
Combine formats by repeating the parameter, for example ?export=html&export=markdown. Include export=txt as well if you also want plain text. A duplicate or unknown format returns 422 invalid_options.
Figures
Section titled “Figures”HTML, Markdown and JSON outputs can reference figure images, published as PNG files named like figure-p2-1.png. HTML and Markdown link to them by relative filename, for example . Save an export and its figures in the same directory to view it offline. When the structure of a table or formula cannot be recovered reliably, the region is kept as an image at the same position instead of being guessed.
The result manifest
Section titled “The result manifest”When a document succeeds, GET its links.result URL. The manifest lists every published file with its media type and download URL. All files become available together and do not change afterwards.
{ "document_id": "a~d17", "page_count": 1, "transformations": [], "files": { "document.json": { "media_type": "application/json", "url": "https://api.sonicdocs.ai/v1/documents/a~d17/artifacts/document.json" }, "figure-p1-1.png": { "media_type": "image/png", "url": "https://api.sonicdocs.ai/v1/documents/a~d17/artifacts/figure-p1-1.png" } }}Download each file from its url with the same API key. Only filenames listed in the manifest can be downloaded; any other name returns 404 artifact_not_found. Each download has a Content-Disposition: attachment header with the filename.
Before the document has finished, the manifest and downloads return 409 result_pending. If processing failed, they return 409 document_failed; read the status for the failure details.
Bates numbering and redaction
Section titled “Bates numbering and redaction”The contract reserves profiles for Bates numbering and redaction, which publish a transformed document.pdf. They are disabled in the first release until their safety and fidelity tests pass. The transformations field in the manifest is [] for every document today.