Excel and CSV

Get the result as a file in the same response, for no extra credits.

Add export=xlsx or export=csv to a parse, as a form field or a JSON key. The response is the same JSON plus an export object with the file as base64.

invoice.xlsx
curl -s -X POST https://doxtract.manoonlabs.com/api/v1/parse \
  -H "Authorization: Bearer mldxt_..." \
  -F file=@invoice.pdf \
  -F schema=invoice \
  -F export=xlsx \
| jq -r '.export.content' | base64 -d > invoice.xlsx

export object

export.format"xlsx" | "csv"Required: Always
The export value you sent.
export.filenamestringRequired: Always
A suggested name, <name>-<yyyy-mm-dd>.<ext> in UTC. The name is the document name (filename, else the uploaded file name), else the saved schema name, else "doxtract".
export.contentTypestringRequired: Always
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for xlsx, text/csv; charset=utf-8 for csv.
export.contentstringRequired: Always
The file bytes as standard base64. Decode and write them to disk.

Excel (.xlsx)

  • The Document sheet has one row: a document column, then every top-level key.
  • Nested objects become dotted columns, for example vendor.address.city.
  • Each list of objects gets its own sheet, named after its path (lineItems, or lineItems.taxes for a list inside a list). Its first columns tie each row back: document, then a row number per level ("lineItems #").
  • document is the document name: filename, else the uploaded file name, else 1.
  • Numbers and dates (yyyy-mm-dd) are real number and date cells. true and false stay booleans. Lists of plain values are joined with "; ". Headers are bold and frozen.

CSV (.csv)

  • One row per item of the largest list in the result, usually the line items. Its columns are prefixed with its path, for example lineItems.amount.
  • Every other key is repeated on each row, so the file stands on its own in a spreadsheet or a database import.
  • A result with no lists is a single row. Other lists of objects, including lists inside a line item, are written into one cell as JSON. Excel has every list as its own sheet.
  • UTF-8 with a byte order mark, so Excel shows accents and currency symbols correctly. Lines end with CRLF. Text that starts with =, +, -, or @ gets a leading apostrophe, so it is not run as a formula.

Sample output

invoice.xlsx
Document sheet
document    | vendor           | invoiceNumber | issued     | total  | currency
------------|------------------|---------------|------------|--------|---------
invoice.pdf | Northwind Supply | INV-1042      | 2026-10-25 | 1280.5 | USD

lineItems sheet
document    | lineItems # | description | amount
------------|-------------|-------------|-------
invoice.pdf | 1           | Cable       | 1280.5

Notes

  • The JSON is always in the response. export only adds the file next to it, from the same parse, for the same credits.
  • A failed parse never has export. Check status first.
  • If the file cannot be built, the response is the plain JSON without export. The parse itself still counts.
  • MCP's parse_document returns JSON only. The Playground has a Download menu for Excel and CSV.