> This page is for version v2025-04-21.
> For other versions, use one of these documentation indexes:
> - v2026-02-09 (default): https://docs.extend.ai/2026-02-09/llms.txt
> - v2025-04-21: https://docs.extend.ai/2025-04-21/llms.txt
> - v2024-12-23: https://docs.extend.ai/2024-12-23/llms.txt

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.extend.ai/llms.txt
> Use this file to discover all available pages before exploring further.
>
> ## API version
> The current API version is `2026-02-09`, served at the site root (no version prefix in URLs).
> If this page URL contains `/2025-04-21/` or `/2024-12-23/`, you are reading an older API version.
> Prefer the current docs at https://docs.extend.ai/llms.txt unless the user explicitly needs that older version.
> Do not treat older-version pages as the source of truth for new integrations.

# Configuration Options

> Configure the Parse API with target formats, chunking strategies, and block options.

The Parse API accepts a `config` object that controls how documents are parsed and processed. Configuration options are organized into several categories:

* **Target Format**: Output format for parsed content (markdown vs spatial)
* **Chunking Strategy**: How the document is divided into chunks
* **Block Options**: Fine-grained control over parsing specific layout types
* **Advanced Options**: OCR enhancements and page filtering

For more information on default values and the full schema, see the [Parse File API reference](/2025-04-21/developers/api-reference/parse-endpoints/parse-file).

> **Prefer a UI?** [Extend Studio](https://dashboard.extend.ai/studio) lets you configure the parser visually and export the config JSON.

---

## Target format

#### `target`

**Type:** `"markdown"` | `"spatial"`

Determines how content is extracted and formatted from the document.

* **markdown**: Clean, logical reading order using true markdown constructs (headings, lists, tables, checkboxes). Supports section-aware chunking and works best for LLMs and RAG.
* **spatial**: Layout/position-preserving text that uses markdown elements for block types (e.g. tables, checkboxes) but is not strictly markdown due to tabs/whitespace used to preserve relative spatial placement. Chunks are page-based only.

**When to choose markdown:**

* Default choice for most documents
* Better for multi-column layouts (content is linearized into readable paragraphs)
* Enables logical section chunking for improved retrieval
* Ideal for getting chunks to embed in RAG pipelines

**When to choose spatial:**

* Very messy, scanned, or handwritten docs (e.g. healthcare notes, skewed scans) where even the best reading order models fail to correctly parse the document
* You need a near 1:1 representation of the original layout
* For data extraction use cases, especially on scanned/skewed documents, this target can often perform better by reducing chance of improper reading order messing up logical interpretation of the document in an extraction pipeline

> **Tip:** If unsure, prefer `markdown`. Only consider `spatial` in special cases

```json
{
  "config": {
    "target": "markdown"
  }
}
```

---

## Chunking strategy

#### `chunkingStrategy.type`

**Type:** `"page"` | `"section"` | `"document"`

Determines the granularity of document chunking.

**`"page"`** — Creates a separate chunk for each page of the document. Compatible with both `markdown` and `spatial` targets.

**`"section"`** — Chunks the document into logical sections based on markdown structure (headings, subheadings). The parser ensures logical groups of content are preserved by never breaking markdown elements across chunks. **Only works with `target: "markdown"`**. This is ideal for RAG systems where each chunk should be a complete semantic unit.

**`"document"`** — Treats the entire document as a single chunk. Use this for small documents or when you have custom downstream chunking requirements.

```json
{
  "config": {
    "chunkingStrategy": {
      "type": "section"
    }
  }
}
```

#### `chunkingStrategy.options.minCharacters`

**Type:** `number`

The minimum number of characters per chunk. Small sections may be combined to meet this minimum.

#### `chunkingStrategy.options.maxCharacters`

**Type:** `number`

The maximum number of characters per chunk. Long sections will be split at natural boundaries when possible.

```json
{
  "config": {
    "chunkingStrategy": {
      "type": "section",
      "options": {
        "minCharacters": 500,
        "maxCharacters": 2000
      }
    }
  }
}
```

---

## Block options

Fine-grained control over how specific content types are detected and formatted.

### Figures

#### `blockOptions.figures.enabled`

**Type:** `boolean`

Enables or disables figure detection and parsing. When enabled, the visual languages models will do additional processing, classification and summarization of images, charts, diagrams, and more to analyze and extract content from each figure. \

**Note**: This adds processing latency, especially for documents with many figures. Disable for fastest processing.

#### `blockOptions.figures.figureImageClippingEnabled`

**Type:** `boolean`

When enabled, extracts figure images from the document and uploads them to blob storage, providing presigned URLs in the output. Each figure is cropped from the page and saved as a PNG.

```json
{
  "config": {
    "blockOptions": {
      "figures": {
        "enabled": true,
        "figureImageClippingEnabled": true
      }
    }
  }
}
```

### Tables

#### `blockOptions.tables.targetFormat`

**Type:** `"markdown"` | `"html"`

Controls the output format for tables.

* **markdown**: Human-readable pipe syntax, works well with LLMs
* **html**: Preserves complex table structure (merged cells, rowspan, colspan)

#### `blockOptions.tables.tableHeaderContinuationEnabled`

**Type:** `boolean`

When enabled, automatically propagates table headers across page breaks. Useful for long tables spanning multiple pages where headers are only present on the first page.

```json
{
  "config": {
    "blockOptions": {
      "tables": {
        "targetFormat": "html",
        "tableHeaderContinuationEnabled": true
      }
    }
  }
}
```

### Text

#### `blockOptions.text.signatureDetectionEnabled`

**Type:** `boolean`

Enables advanced signature detection. When enabled, identifies handwritten signatures, initials, and signature blocks in the document.

#### `blockOptions.text.agentic.enabled`

**Type:** `boolean`

Enables OCR corrections using vision language models to review and correct low OCR confidence and difficult to parse handwriting. The system automatically identifies text regions with low OCR confidence and applies VLM-based corrections.

When to enable:

* Handwritten documents or forms
* Poor quality scans
* Historical documents or faded text
* Mixed print and handwritten content

**Note**: Increases latency, especially when every page is scanned.

```json
{
  "config": {
    "blockOptions": {
      "text": {
        "signatureDetectionEnabled": true,
        "agentic": {
          "enabled": true
        }
      }
    }
  }
}
```

---

## Advanced options

#### `advancedOptions.pageRotationEnabled`

**Type:** `boolean`

Enables automatic page rotation detection and correction. The system detects if pages are rotated and automatically rotates them to the correct orientation before parsing.

```json
{
  "config": {
    "advancedOptions": {
      "pageRotationEnabled": true
    }
  }
}
```

#### `advancedOptions.pageRanges`

**Type:** `Array<{ start: number, end: number }>`

Specifies which pages of the document to process. Page numbers are 1-based and ranges are inclusive. Ranges can overlap and be in any order—the system automatically merges and sorts them.

```json
{
  "config": {
    "advancedOptions": {
      "pageRanges": [
        { "start": 1, "end": 3 },
        { "start": 10, "end": 10 }
      ]
    }
  }
}
```

* 1-based, inclusive page numbers
* Ranges can overlap or arrive out of order; the platform merges and sorts them automatically
* Omit the field or pass `[]` to process the full document (subject to global limits)
* You are only billed for pages actually processed

### Excel

#### `advancedOptions.excelParsingMode`

**Type:** `"basic"` | `"advanced"`

Controls how Excel files are parsed.

* **basic**: Fast, deterministic parsing.
* **advanced**: Enable layout block detection for complex spreadsheets.

For `.xls` files, `basic` mode is always used.

```json
{
  "config": {
    "advancedOptions": {
      "excelParsingMode": "advanced"
    }
  }
}
```

#### `advancedOptions.excelSkipHiddenContent`

**Type:** `boolean`

When enabled, hidden rows, columns, and sheets are excluded from parsed Excel output.

```json
{
  "config": {
    "advancedOptions": {
      "excelSkipHiddenContent": true
    }
  }
}
```

#### `advancedOptions.excelUseRawCellValues`

**Type:** `boolean`

When enabled, returns raw calculated cell values instead of locale-formatted values. For example, a date stored as `45672` would be returned as `45672` instead of `01/15/2025`. Useful when downstream processing needs the underlying numeric or unformatted data.

```json
{
  "config": {
    "advancedOptions": {
      "excelUseRawCellValues": true
    }
  }
}
```

#### `advancedOptions.excelSkipCalculation`

**Type:** `boolean` (default: `true`)

When enabled, skips formula recalculation when opening the workbook. This significantly improves parsing speed for formula-heavy spreadsheets. Disable if you need formulas to be recalculated before parsing (e.g., when cell values depend on volatile functions like `NOW()` or `TODAY()`).

```json
{
  "config": {
    "advancedOptions": {
      "excelSkipCalculation": false
    }
  }
}
```

#### `advancedOptions.excelIncludeCellMetadata`

**Type:** `boolean`

When enabled, table cell blocks include their source spreadsheet coordinate in `details.cellReference` (for example, `"B2"`, or `"A1:C1"` for a merged cell). Formula cells also include `details.formula` with a leading `=`. Heading or text blocks derived from spreadsheet cells can include a source range in `details.cellReference`.

For HTML table output, the same provenance is also preserved as `data-cell` and `data-formula` attributes. Markdown output does not include HTML attributes, but the structured block details are still available.

**Note:** Requires `advancedOptions.excelParsingMode: "advanced"`.

```json
{
  "config": {
    "advancedOptions": {
      "excelParsingMode": "advanced",
      "excelIncludeCellMetadata": true
    }
  }
}
```

#### `advancedOptions.excelIncludeCellFormatting`

**Type:** `boolean`

When enabled, table cell blocks include structured formatting (`bold`, `italic`, `fontColor`, `backgroundColor`) in `details.formatting` when the source cell has formatting. For HTML table output, the cell's inline style is also preserved, including colors, bold or italic text, and borders.

Useful when spreadsheet formatting carries meaning for downstream extraction, review, or display.

**Note:** Requires `advancedOptions.excelParsingMode: "advanced"`. Can increase response size for heavily formatted workbooks.

```json
{
  "config": {
    "advancedOptions": {
      "excelParsingMode": "advanced",
      "excelIncludeCellFormatting": true
    }
  }
}
```

#### `advancedOptions.returnOcr`

Options for returning raw OCR data in the response.

#### `advancedOptions.returnOcr.words`

**Type:** `boolean`

When enabled, returns word-level bounding boxes in the response under `ocr.words`. Each word includes `content`, `boundingBox`, `confidence` (0-1), and `pageNumber`. Coordinates are in points (1/72 inch) from the top-left corner.

Useful for building document viewers with precise text selection, word-level search highlighting, or OCR quality assessment.

**Note:** This meaningfully impacts the response size. Consider using the signed URL return format (`responseType=url`) for large documents.

```json
{
  "config": {
    "advancedOptions": {
      "returnOcr": {
        "words": true
      }
    }
  }
}
```

**Response structure:**

```json
{
  "chunks": [...],
  "ocr": {
    "words": [
      {
        "content": "Invoice",
        "boundingBox": {
          "left": 72.5,
          "top": 50.2,
          "right": 120.3,
          "bottom": 65.8
        },
        "confidence": 0.99,
        "pageNumber": 1
      }
    ]
  }
}
```

#### `advancedOptions.alwaysConvertToPdf`

**Type:** `boolean`

When enabled, supported file types (images, Word documents, PowerPoint, Excel, HTML) are converted to PDF before parsing. This can improve parsing quality for some file types and ensures spatial output with bounding boxes.

```json
{
  "config": {
    "advancedOptions": {
      "alwaysConvertToPdf": true
    }
  }
}
```

---

## Response type

You can specify the response type in the `responseType` query parameter for the [Parse File](/2025-04-21/developers/api-reference/parse-endpoints/parse-file) and [Get Parser Run](/2025-04-21/developers/api-reference/parse-endpoints/get-parser-run) endpoints.

* `json` returns parsed outputs directly in the response body.
* `url` returns a presigned URL to the parsed content.

Use `url` for large documents to reduce response payload size, especially when `returnOcr.words` is enabled.