---
title: "Read the text of the uploaded PDF, a run of pages at a time"
method: GET
path: "/api/v1/documents/{id}/text/pages"
tags: ["Documents"]
---

# Read the text of the uploaded PDF, a run of pages at a time

`GET /api/v1/documents/{id}/text/pages`

## Request

- Base URL: `https://api.korala.ai`
- URL: `https://api.korala.ai/api/v1/documents/{id}/text/pages`
- Auth: one of:
  - API key in header `X-API-Key`
  - `bearer` (a scheme the document does not define)

Returns the text of each page as someone reading it would see it. One answer holds about 20,000 characters and at most 50 pages, in whole pages; `nextPage` says where to continue, so the number of pages is no limit. The file itself may be up to 25 MB. Pages without a text layer come back empty, and `hasText` is false when all of the returned ones are.

## Path parameters

- `id` string, required

## Query parameters

- `fromPage` number
- `toPage` number

## Response `200`

- DocumentPagesTextDto
  - `pageCount` number, required: Pages in the document
  - `pages` PageTextDto[], required
    - `pageNumber` number, required
    - `text` string, required: The page as someone reading it would see it: columns kept apart, lines in order. Empty for a page with no text layer.
    - `truncated` boolean: True when this page ran past 60,000 characters, more than any printed page holds, and was cut there
  - `nextPage` number, nullable, required: The page to continue from, or null when the last page was returned
  - `hasText` boolean, required: False when none of the returned pages has any text. They are scanned, and have to be looked at instead of read; other pages of the same document may still have text

## Other responses

- `400`: Malformed UUID in path parameter (`id`).

---

[API](https://skmtc.dev/korala/apis/korala-public-api.md) · [All operations](https://skmtc.dev/korala/apis/korala-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/korala/apis/korala-public-api/revisions/5c4d7810c507?raw)
