> For a complete page index of the Captain API documentation, fetch https://docs.captain.dev/llms.txt?excludeSpec=true

# Get Document Page

GET https://api.captain.dev/v3/collections/{collection_name}/documents/{document_id}/pages/{page_number}

Return one document page's OCR text in reading order and, optionally, its layout regions.

Addressed by the `document_id` returned by [List Documents](/reference/v3/documents) and [Query](/reference/v3/query), plus a `page_number`.

**Only works for documents with OCR data** (PDFs and similar). For other file types, use [Get Document](/reference/v3/document) or [Get Chunk](/reference/v3/documents/chunk) instead.

Reference: https://docs.captain.dev/reference/v3/document/page

## Request

### Path parameters

- `collection_name` (string, required)
- `document_id` (string, required)
- `page_number` (integer, required)

### Query parameters

- `include_regions` (boolean, optional, default: false)

## Response

### 200

Get Document Page response.

- `collection_name` (string, required)
- `document_id` (string, required)
- `page` (integer, required) — The requested page number, echoed back.
- `text` (string, required) — The page's full text in reading order. Empty string when the page exists but has no extractable text (see `warnings`).
- `page_count` (integer, optional, nullable) — Best-effort total page count, derived from the document's OCR data. Null when it cannot be determined.
- `text_source` (enum, optional, default: ocr) — Where `text` came from. Always `ocr` today; a future value would mean reconstructed text, not primary-source OCR.
  - Allowed values: `ocr`
- `regions` (list of FileSearchRegionFromV3, optional, nullable) — Layout regions on this page when `include_regions` is true. Regions of type `figure`, `chart`, or `image` carry a presigned `image_url`.
- `warnings` (list of PageWarningV3, optional) — Non-fatal conditions on this response, such as `document_indexing` (content may be incomplete) or `page_empty` (page exists, no extractable text).

## Errors

### 404 Not Found Error

Document not found, has no OCR page data, is still indexing with no OCR data yet, or the page is beyond the document's page range.

- `message` (string, required) — Human-readable explanation. Free to change.
- `path` (string, required) — The request path.
- `code` (enum, optional) — Present when the document or page is missing. Branch on this, not `message`.
  - Allowed values: `document_not_found`, `document_indexing`, `document_has_no_pages`, `page_out_of_range`
- `error` (string, optional) — `HTTP_ERROR` when the collection is missing. Absent when `code` is set.
- `page_count` (integer, optional, nullable) — Present only for `page_out_of_range`: the document's best-effort total page count.
- `status_code` (integer, optional) — Present only on `HTTP_ERROR`.

## Types

### FileSearchRegionFromV3

- `type` (string, optional, nullable) — Region category, such as `text`, `title`, `section_header`, `key_value`, `table`, `figure`, `chart`, or `image`. Regions of type `figure`, `chart`, or `image` also carry a cropped `image_url` (a visual citation).
- `text` (string, optional, nullable)
- `page` (integer, optional, nullable)
- `bbox` (map from string to double, optional, nullable)
- `confidence` (string, optional, nullable)
- `image_url` (string, optional, nullable) — Short-lived presigned URL to a cropped image of the region (a visual citation), returned for `figure`, `chart`, and `image` regions when `include.regions` is true. Null for text regions and for documents indexed before figure cropping was enabled. Fetch promptly — the link expires within minutes.
- `description` (string, optional, nullable)

### PageWarningV3

A non-fatal condition on an otherwise successful page fetch, such as indexing still in progress or the page having no extractable text.

- `code` (string, required) — Stable machine-readable warning code, such as `document_indexing` or `page_empty`.
- `message` (string, required) — Human-readable explanation. Free to change; branch on `code`, not this text.

## Examples

**Response**

```json
{
  "collection_name": "policy_docs",
  "document_id": "f4a91c7e8b2d4a0c9e6f13b5a8d02744",
  "page": 3,
  "text": "REMOTE WORK POLICY\nEmployees may work remotely up to three days per week with manager approval. Equipment requests go through IT Support.\n\nEQUIPMENT AND EXPENSES\nThe company provides a laptop and a one-time $500 home office stipend for approved remote employees.",
  "page_count": 18,
  "text_source": "ocr",
  "regions": [
    {
      "type": "heading",
      "text": "REMOTE WORK POLICY",
      "page": 3,
      "bbox": {
        "top": 0.0619,
        "left": 0.0662,
        "width": 0.3382,
        "height": 0.0183
      },
      "confidence": "high",
      "image_url": null,
      "description": null
    },
    {
      "type": "text",
      "text": "Employees may work remotely up to three days per week with manager approval. Equipment requests go through IT Support.",
      "page": 3,
      "bbox": {
        "top": 0.0862,
        "left": 0.0662,
        "width": 0.8544,
        "height": 0.0445
      },
      "confidence": "high",
      "image_url": null,
      "description": null
    },
    {
      "type": "figure",
      "text": "Org chart showing IT Support escalation path for equipment requests.",
      "page": 3,
      "bbox": {
        "top": 0.45,
        "left": 0.0662,
        "width": 0.4013,
        "height": 0.0788
      },
      "confidence": "high",
      "image_url": "https://captain-visual-citations.s3.amazonaws.com/crops/org_example/f4a91c7e8b2d4a0c9e6f13b5a8d02744/p3-0.png?AWSAccessKeyId=AKIAEXAMPLE&Expires=1785084004&Signature=EXAMPLESIGNATUREvalue%3D",
      "description": "Org chart showing the IT Support escalation path."
    }
  ],
  "warnings": [
    {
      "code": "document_indexing",
      "message": "Document 'f4a91c7e8b2d4a0c9e6f13b5a8d02744' is still indexing; page content may be incomplete."
    }
  ]
}
```

**SDK Code**

```python
import json
import requests

BASE_URL = "https://api.captain.dev"
API_KEY = "your_api_key"
COLLECTION_NAME = "policy_docs"
DOCUMENT_ID = "f4a91c7e8b2d4a0c9e6f13b5a8d02744"
PAGE_NUMBER = 3

headers = {
    "Authorization": f"Bearer {API_KEY}",
}

params = {
    "include_regions": True
}

response = requests.get(
    f"{BASE_URL}/v3/collections/{COLLECTION_NAME}/documents/{DOCUMENT_ID}/pages/{PAGE_NUMBER}",
    headers=headers,
    params=params,
    timeout=30.0
)

print(json.dumps(response.json(), indent=2))
```

```typescript
const BASE_URL = "https://api.captain.dev";

const API_KEY = "your_api_key";

const collection_name = "policy_docs";

const document_id = "f4a91c7e8b2d4a0c9e6f13b5a8d02744";

const page_number = 3;

const headers = {
  Authorization: `Bearer ${API_KEY}`,
};

const params = new URLSearchParams({
  "include_regions": "true"
});

const response = await fetch(`${BASE_URL}/v3/collections/${collection_name}/documents/${document_id}/pages/${page_number}?${params}`, {
  method: "GET",
  headers,
});

const data = await response.json();
console.log(JSON.stringify(data, null, 2));
```