---
title: "Extract the text of a PDF"
method: POST
path: "/pdf-extract-text"
tags: ["PDF"]
---

# Extract the text of a PDF

`POST /pdf-extract-text`

## Request

- Base URL: `https://api.cofferdock.com`
- URL: `https://api.cofferdock.com/pdf-extract-text`
- Auth: API key in header `x-api-key`

Returns the text of a PDF (not scanned images: there is no OCR). Set pages=true to also get the text page by page.

Costs 1 credit per call.

## Request body

- object
  - `file` string, byte, required: The PDF, base64-encoded.
  - `pages` boolean: Also return the text split by page.

## Response `200`

The extracted text.

- object
  - `success` boolean
  - `text` string
  - `num_pages` integer
  - `pages` object[]
    - `page` integer
    - `text` string
  - `info` object
  - `meta` object
    - `size_bytes` integer
    - `used` integer: Credits used this month, after this call.
    - `remaining` integer, nullable: Credits left this month (null = unlimited).
    - `unlimited` boolean

## Other responses

- `400`: Invalid input (nothing is charged).
- `401`: Missing or invalid API key.
- `403`: Email not verified.
- `429`: Monthly credit limit reached, or too many requests per minute for this key (see Retry-After).
- `503`: Server busy (queue full). Retry after the seconds in the Retry-After header.

---

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