This HTML page is not optimized for LLM or AI agent consumption. Fetch the Markdown version instead: /guides/dws-data-extraction/parsing.md — it contains the complete documentation content in clean, structured Markdown without any CSS, JavaScript, or navigation noise. Parse endpoint

The Nutrient Data Extraction API parse endpoint extracts structured content from a document and returns either typed spatial elements with bounding boxes or a whole-document Markdown representation:

POST https://api.nutrient.io/extraction/parse

Request formats

You can send documents to the parse endpoint in three ways.

Multipart form upload

Upload a file directly with optional processing instructions.

Terminal window
curl -X POST https://api.nutrient.io/extraction/parse \
-H "Authorization: Bearer your_api_key_goes_here" \
-F "file=@document.pdf" \
-F 'instructions={"mode":"understand","output":{"format":"spatial"}}'

The JavaScript samples use fs.openAsBlob, which requires Node 19.8 or later.

When instructions is omitted, the API defaults to understand mode with spatial element output.

JSON body with URL

Process a document hosted at a public URL without uploading a file.

Terminal window
curl -X POST https://api.nutrient.io/extraction/parse \
-H "Authorization: Bearer your_api_key_goes_here" \
-H "Content-Type: application/json" \
-d '{
"url": "https://storage.example.com/invoice.pdf",
"mode": "understand",
"output": { "format": "spatial" }
}'

Raw binary upload

Send a file directly as the request body with the appropriate Content-Type header.

Terminal window
curl -X POST https://api.nutrient.io/extraction/parse \
-H "Authorization: Bearer your_api_key_goes_here" \
-H "Content-Type: application/pdf" \
--data-binary @document.pdf

Parse cheat sheet

Use this table to avoid mixing request fields and response paths.

GoalRequest content typeRequest shapeResponse path
File upload to Markdownmultipart/form-datafile=@document.pdf plus instructions={"mode":"text","output":{"format":"markdown"}}Markdown: output.markdown; page count: metrics.pagesProcessed
File upload to spatial elementsmultipart/form-datafile=@document.pdf plus instructions={"mode":"understand","output":{"format":"spatial"}}Elements: output.elements[]; page number: output.elements[].page.pageNumber; page count: metrics.pagesProcessed
File upload with word-level datamultipart/form-datafile=@document.pdf plus instructions={"mode":"understand","output":{"format":"spatial","includeWords":true}}Words: output.elements[].words[] or output.elements[].cells[].words[]
URL input to Markdownapplication/json{ "url": "https://.../document.pdf", "mode": "text", "output": { "format": "markdown" } }Markdown: output.markdown; page count: metrics.pagesProcessed
URL input to spatial elementsapplication/json{ "url": "https://.../document.pdf", "mode": "understand", "output": { "format": "spatial" } }Elements: output.elements[]; page number: output.elements[].page.pageNumber; page count: metrics.pagesProcessed
Raw binary uploadDocument Multipurpose Internet Mail Extensions (MIME) type, such as application/pdfRequest body is the file bytes. No instructions field; the API uses the default understand spatial output.Elements: output.elements[]; page count: metrics.pagesProcessed
Table cellsAny spatial requestSet output.format to spatialoutput.elements[] where type == "table", then cells[]
Chart dataAny spatial requestSet mode to understand or agentic, and output.format to spatialoutput.elements[] where type == "chart", then htmlTable, summary, or text
QR code or barcode payloadsAny spatial requestSet mode to understand or agentic, and output.format to spatialoutput.elements[] where type == "barcode", then value and format

Request field reminders:

  • Use output.format, not outputFormat, output.markdown, or a top-level markdown request field.
  • configuration.outputFormat is a response field, not a request field.
  • Spatial output is a flat list at output.elements[]. Page information is nested on each element at element.page, and coordinates are at element.bounds.
  • Markdown output is returned at output.markdown in the JSON response.

Processing modes

The mode parameter controls the extraction pipeline.

ModeDescriptionSpeedCost
autoRoutes each page to structure, understand, or agenticVaries$0.0015–$0.018 per page
textFast Markdown extraction via Document Engine. No optical character recognition (OCR) or artificial intelligence (AI) augmentation.Fastest$0.001 per page
structureOCR-based structured extraction with spatial element outputFast$0.0015 per page
understandFull extraction pipeline with AI augmentation for richer resultsSlower$0.009 per page
agenticVision language model (VLM)-augmented extraction for complex documentsSlowest$0.018 per page

Start with auto and select it explicitly. The API uses understand when you omit mode. Refer to the processing modes guide for a detailed comparison.

Output formats

The output.format parameter controls what the API returns.

FormatDescriptionReturns
spatialTyped document elements with bounding boxes and confidence scores. Not available with text mode.output.elements[]
markdownWhole-document Markdown representationoutput.markdown

The default format depends on the mode: text defaults to markdown; auto, structure, understand, and agentic default to spatial.

When output.format is spatial, you can also set output.includeWords: true to include word-level OCR data nested inside paragraph and table cell elements.

Response structure

Every successful response includes:

{
"status": 200,
"requestId": "req_e5f6g7h8",
"output": { ... },
"metrics": {
"processingTimeMs": 4200,
"pagesProcessed": 1
},
"usage": {
"global_usd": {
"cost": "0.01062",
"currency": "USD",
"includedBalance": "72.40",
"walletBalance": "0.00"
}
},
"configuration": {
"mode": "understand",
"outputFormat": "spatial"
}
}
  • requestId — Unique identifier for debugging and support requests.
  • output — Contains either elements (spatial format) or markdown (Markdown format).
  • metrics — Processing time and pages processed.
  • usage — The cost of this request in US dollars, and your remaining monthly usage and wallet balance. Accounts still on a credits plan get data_extraction_credits instead, in credits.
  • configuration — The mode and output format that were used.

Run asynchronously

For long documents, or when the caller can’t hold a connection open, send the same request to POST /extraction/parse/async. It answers 202 with a stored run you poll for the result. Refer to the run asynchronously guide.

Next steps