> 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.

# Response Format

> Understanding the Parse API response format including chunks, blocks, and spatial information.

The Parse API returns document content in a structured format that provides both high-level formatted content and detailed block-level information. Start with the response structure, then decide whether you need formatted content or block-level detail.

---

## Response structure

Each chunk contains two key properties:

1. **`content`**: A fully formatted representation of the entire chunk in the target format (e.g., markdown). This is ready to use as-is if you need the complete formatted content of a page.

2. **`blocks`**: An array of individual content blocks that make up the chunk, each with its own formatting, position information, and metadata.

---

## Choose content vs. blocks

* **Use `chunk.content` when:**
  * You need the complete, properly formatted content of a page, already doing the logical placement of blocks (e.g. grouping markdown sections and placing spatially, etc)
  * You want to display or process the document content as a whole (and can just combine all chunk.content values)
  * You're integrating with systems that expect formatted text (e.g., markdown processors)

* **Use `chunk.blocks` when:**
  * You need to work with specific elements of the document (e.g., only tables or figures)
  * You need spatial information about where content appears on the page, perhaps to build citation systems
  * You're building a UI that shows or highlights specific document elements

---

## Examples

### Extract specific content types

```javascript
// Extract all tables from a document
function extractTables(parseResult) {
  const tables = [];
  
  parseResult.chunks.forEach(chunk => {
    chunk.blocks.forEach(block => {
      if (block.type === 'table') {
        tables.push({
          content: block.content,
          pageNumber: block.metadata.page.number,
          position: block.boundingBox
        });
      }
    });
  });
  
  return tables;
}

// Extract all figures with their images
function extractFigures(parseResult) {
  const figures = [];
  
  parseResult.chunks.forEach(chunk => {
    chunk.blocks.forEach(block => {
      if (block.type === 'figure' && block.details.imageUrl) {
        figures.push({
          caption: block.content,
          imageUrl: block.details.imageUrl,
          figureType: block.details.figureType,
          pageNumber: block.metadata.page.number
        });
      }
    });
  });
  
  return figures;
}
```

### Reconstruct content with custom formatting

```javascript
// Extract headings and their content to create a table of contents
function createTableOfContents(parseResult) {
  const toc = [];
  
  parseResult.chunks.forEach(chunk => {
    chunk.blocks.forEach(block => {
      if (block.type === 'heading' || block.type === 'section_heading') {
        toc.push({
          title: block.content,
          pageNumber: block.metadata.page.number
        });
      }
    });
  });
  
  return toc;
}
```

---

## Excel cell metadata and formatting

For advanced Excel parsing, `advancedOptions.excelIncludeCellMetadata` adds spreadsheet provenance to block details. Table cell blocks receive `details.cellReference` in A1 notation (for example, `"B2"`, or `"A1:C1"` for a merged cell), and formula cells receive `details.formula` with a leading `=`. Text or heading blocks that come from spreadsheet cells can receive a source range in `details.cellReference`.

If `blockOptions.tables.targetFormat` is `"html"`, the same metadata is also emitted as `data-cell` and `data-formula` attributes. Markdown output omits those attributes, but the structured block details still carry the metadata.

`advancedOptions.excelIncludeCellFormatting` adds `details.formatting` to table cell blocks when formatting is present. The formatting object can include `bold`, `italic`, `fontColor`, and `backgroundColor`; colors are hex strings such as `"#ff0000"`. For HTML table output, inline cell styles are also preserved.

```json
{
  "type": "table_cell",
  "content": "40",
  "details": {
    "type": "table_cell_details",
    "rowIndex": 1,
    "columnIndex": 1,
    "cellReference": "B2",
    "formula": "=A2*10",
    "formatting": {
      "bold": true,
      "fontColor": "#ff0000",
      "backgroundColor": "#ffff00"
    }
  }
}
```

---

## Spatial information

Each block contains spatial information in the form of a `polygon` (precise outline) and a simplified `boundingBox`. Use this when you need position-aware output:

* Highlight specific content in a document viewer
* Create visual overlays on top of the original document
* Understand the reading order and layout of the document

```javascript
// Create highlight coordinates for a document viewer
function createHighlights(parseResult, searchTerm) {
  const highlights = [];
  
  parseResult.chunks.forEach(chunk => {
    chunk.blocks.forEach(block => {
      if (block.type === 'text' && block.content.includes(searchTerm)) {
        highlights.push({
          pageNumber: block.metadata.page.number,
          boundingBox: block.boundingBox
        });
      }
    });
  });
  
  return highlights;
}
```

By leveraging both the formatted content and the structured block information, you can build powerful document processing workflows that combine the convenience of formatted text with the precision of block-level access.