---
title: "Extract Text from a PDF"
method: POST
path: "/v1/tools/pdf_to_text"
---

# Extract Text from a PDF

`POST /v1/tools/pdf_to_text`

## Request

- Base URL: `https://unstuckapi.com`
- URL: `https://unstuckapi.com/v1/tools/pdf_to_text`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Extract the text from a PDF file at a URL and return it as markdown, page by page. Use it to read a PDF, parse a form, report, paper, invoice, or document, or convert a PDF to text. Works on PDFs with a text layer (scanned image-only PDFs return little or no text; no OCR).

Price: $0.005 per call. Charged once per call that returns a result, including an empty result list. Failed calls are free.

## Request body

- object
  - `url` string, required: The http(s) URL of the PDF file.

## Response `200`

Success

- object
  - `tool` 'pdf_to_text', required
  - `result` object, required
    - `url` string, required: PDF URL after redirects.
    - `title` string, nullable, required: Title from the PDF metadata, if any.
    - `pages` integer, required: Number of pages.
    - `bytes` integer, required: File size in bytes.
    - `markdown` string, required: Text as markdown, one "## Page N" section per page.
    - `truncated` boolean, required: True if the text was cut at the size limit.
    - `likely_scanned` boolean, required: True if the PDF looks image-only (little extractable text).
  - `charged_usd` number, required
  - `balance_usd` number, required

## Other responses

- `400`: Invalid JSON or input. Not charged.
- `401`: Paid tool without a valid API key.
- `402`: Balance too low for this call. Not charged.
- `404`: Unknown tool.
- `422`: The tool failed. Not charged.
- `429`: Rate limited, free tries used up, or the uncharged-result limit reached. See Retry-After.

---

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