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

# Quick Start

> Get started with the Parse API to convert documents into structured, LLM-ready formats.

The Parse endpoint converts documents into structured, LLM-ready formats.
Use it to extract clean document content for downstream processing such as RAG pipelines, custom ingestion workflows, document extraction tasks, Agents, etc.

This quickstart will get you up and running with the Parse API in under 5 minutes to extract structured content that can be passed into your LLM/Agent as context or further processed.

---

## What we're going to parse

We'll use a bank statement to demonstrate the Parse API.

![Bank statement page 1](/_fern-img/6054ef645b2cc17010f5472ca513d6b4c02ad1c15ba0abc4dbe982408f517322.webp)

Feel free to use [this document](https://extend-public-files.s3.us-east-2.amazonaws.com/bank_statement_example.pdf) to follow along with the quickstart!

## Using the Parse API

Choose your preferred language to get started.
If you're using an SDK, see [installation instructions](/2025-04-21/developers/sdks). For raw REST calls, you can use the built-in `fetch` API (Node.js 18+) or `requests` in Python.

Replace `<YOUR_API_KEY>` with your actual key, available on the [Developers](https://dashboard.extend.ai/developers) page, then run one of the examples below to parse the document.

**`TypeScript SDK`**

```typescript TypeScript SDK
import { ExtendClient } from "extend-ai";

const client = new ExtendClient({
  environment: "https://api.extend.ai",
  token: "<YOUR_API_KEY>",
});

const response = await client.parse({
  file: {
    fileName: "bank_statement.pdf",
    fileUrl: "https://extend-public-files.s3.us-east-2.amazonaws.com/bank_statement_example.pdf",
  }
});

console.log("Parsed content:", response);
```

**`TypeScript`**

```typescript TypeScript
const response = await fetch("https://api.extend.ai/parse", {
  method: "POST",
  headers: {
    "x-extend-api-version": "2025-04-21",
    "Authorization": "Bearer <YOUR_API_KEY>",
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    file: {
      fileName: "bank_statement.pdf",
      fileUrl: "https://extend-public-files.s3.us-east-2.amazonaws.com/bank_statement_example.pdf",
    },
  }),
});

const data = await response.json();
console.log("Parsed content:", data);
```

**`Python SDK`**

```python Python SDK
from extend_ai import Extend

client = Extend(
    base_url="https://api.extend.ai",
    token="<YOUR_API_KEY>"
)

response = client.parse(
    file={
        "fileName": "bank_statement.pdf",
        "fileUrl": "https://extend-public-files.s3.us-east-2.amazonaws.com/bank_statement_example.pdf",
    }
)

# Print the clean markdown content for each page
for chunk in response.output.chunks:
    print(chunk.content)
```

**`Python`**

```python Python
import requests

response = requests.post(
    "https://api.extend.ai/parse",
    json={
        "file": {
            "fileName": "bank_statement.pdf",
            "fileUrl": "https://extend-public-files.s3.us-east-2.amazonaws.com/bank_statement_example.pdf",
        },
    },
    headers={
        "x-extend-api-version": "2025-04-21",
        "Authorization": "Bearer <YOUR_API_KEY>",
        "Content-Type": "application/json",
    },
)

print("Parsed content:", response.json())
```

**`Java SDK`**

```java Java SDK
import ai.extend.ExtendClient;

ExtendClient client = new ExtendClient("<YOUR_API_KEY>");

ParseRequest request = ParseRequest.builder()
    .file(ParseFileInput.builder()
        .fileName("bank_statement.pdf")
        .fileUrl("https://extend-public-files.s3.us-east-2.amazonaws.com/bank_statement_example.pdf")
        .build())
    .build();

ParserRun response = client.parse(request);
System.out.println("Parsed content: " + response);
```

Each example sends a document to the Parse API and returns structured content split into page-level chunks.

Note: this doesn't set any configuration options, so the parser will use the default settings. For configuration details, see [Configuration Options](/2025-04-21/product/parsing/configuration-options).

> **Warning**
>
> For high-volume production workloads, use asynchronous parsing. For more details, see [Async vs. sync processing](/2025-04-21/product/parsing/best-practices#async-vs-sync-processing).

### Example response (truncated)

After you run the code snippet above, you'll see a response like this. This example response is truncated for brevity. The response is organized into `chunks`, which in this case are page-level units. Each chunk includes a formatted `content` string for the full page and a `blocks` array for block-level elements (like text, tables, and figures) with metadata and spatial data.

```json
{
  "object": "parser_run",
  "id": "parser_run_3f1j6I1gsw5k96xFiCnkM",
  "fileId": "file_GzKUy0VDhHscv7tweODYb",
  "metrics": { "pageCount": 7, "processingTimeMs": 8293 },
  "status": "PROCESSED",
  "config": { "engine": "parse_performance", "engineVersion": "1.0.0" },
  "usage": { "credits": 14 },
  "chunks": [
    {
      "id": "chunk_qncr8Txe-wYvmFjipXgMD",
      "type": "page",
      "content": "CHASE JPMorgan Chase Bank, N.A. P O Box 659754...", // ... more content
      "metadata": { "pageRange": { "start": 1, "end": 1 } },
      "blocks": [
        {
          "object": "block",
          "id": "block_WNoJ0WbMj4pRW9MpMpUox",
          "type": "text",
          "content": "CHASE JPMorgan Chase Bank, N.A. P O Box 659754 San Antonio, TX 78265 - 9754",
          "details": {},
          "metadata": { "page": { "number": 1, "width": 612, "height": 792 } },
          "polygon": [
            { "x": 56.873, "y": 35.374 },
            { "x": 162.173, "y": 35.215 },
            { "x": 162.245, "y": 81.158 },
            { "x": 56.938, "y": 81.317 }
          ],
          "boundingBox": { "left": 56.873, "top": 35.215, "right": 162.245, "bottom": 81.317 }
        }
        // ... more blocks
      ]
    },
    { "id": "chunk_O3gS1z8_KaaCdgi5rDz5P", "type": "page", "content": "..." } // ... more content
    // ... more chunks for remaining pages
  ]
}
```

**Key fields**

| Field                      | What it contains                                                         |
| -------------------------- | ------------------------------------------------------------------------ |
| `id`                       | Parser run ID you can use to fetch results later.                        |
| `fileId`                   | The Extend file identifier tied to this parse run.                       |
| `status`                   | Processing state for the parse run (e.g., `PROCESSED`).                  |
| `metrics.pageCount`        | Total pages processed in the document.                                   |
| `metrics.processingTimeMs` | End-to-end parsing time in milliseconds.                                 |
| `usage.credits`            | Credits consumed by this run.                                            |
| `chunks`                   | Parsed content units (page, section, or document-level based on config). |
| `chunks[].content`         | Formatted content string for the chunk.                                  |
| `chunks[].blocks`          | Block array with structured elements and their layout data.              |

For full request/response details, see the [Parse File API reference](/2025-04-21/developers/api-reference/parse-endpoints/parse-file).

### Using Parsed Output

You can access the formatted content of each chunk or work with individual blocks for more control.

```javascript
// Access the formatted content of each chunk
response.chunks.forEach((chunk, index) => {
  console.log(`Page ${index + 1}:`, chunk.content);
});

// Or work with individual blocks for more control
response.chunks.forEach(chunk => {
  chunk.blocks.forEach(block => {
    console.log(`${block.type}:`, block.content);
  });
});
```

For a deeper guide on how to use the output of this endpoint, see [Response Format](/2025-04-21/product/parsing/response-format).

---

## Using Extend Studio

You can also use [Extend Studio](https://dashboard.extend.ai/studio) UI to upload your document, configure the parser, and view the code to copy.

![Parser view code](/_fern-img/1a9ad41a9097ecf4e824e35fb45c57636d36dc558f1d09c99fb57735c18bfff5.webp)

Here, you're also able to go to the `Config` tab to edit the parser configuration and copy the JSON config.

![Parser config](/_fern-img/e501099ddd0fd8a0191219efe8a9663cea60218eaaf54178c72da08d1ebb633d.webp)

---

## Next steps

#### [Configuration](/2025-04-21/product/parsing/configuration-options)

Customize chunking, output format, and block options

#### [Recipes](/2025-04-21/product/parsing/recipes)

Ready-to-use configs for RAG, legal docs, and more

#### [Response Format](/2025-04-21/product/parsing/response-format)

Extract tables, figures, and spatial data

#### [Best Practices](/2025-04-21/product/parsing/best-practices)

Optimize for speed or accuracy

#### [Error Codes](/2025-04-21/product/parsing/error-codes)

Handle errors and troubleshoot issues

#### [API Reference](/2025-04-21/developers/api-reference/parse-endpoints/parse-file)

Full request and response schema