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 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"}}'

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 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[]
Key-value pairsAny spatial requestSet mode to understand or agentic, and output.format to spatialoutput.elements[] where type == "keyValueRegion", then pairs[]

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
textFast Markdown extraction via Document Engine. No optical character recognition (OCR) or artificial intelligence (AI) augmentation.Fastest1 credit per page
structureOCR-based structured extraction with spatial element outputFast1.5 credits per page
understandFull extraction pipeline with AI augmentation for richer resultsSlower9 credits per page
agenticVision language model (VLM)-augmented extraction for complex documentsSlowest18 credits per page

Default: understand. 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

Default format depends on the mode: text defaults to markdown; 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": {
"data_extraction_credits": {
"cost": 9,
"remainingCredits": 850
}
},
"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 — Credit consumption for this request.
  • configuration — The mode and output format that were used.

Next steps