---
title: Extract Text from PDF API
slug: extract-text-from-pdf
url: https://apyhub.com/apyhub/service/extract-text-from-pdf
provider: ApyHub
categories: [Ingestion Kit]
tags: [pdf-to-text, text-extraction, pdf-processing, pdf-parser]
auth: api_key
version: 1.0.0
service_type: sync
endpoints: 2
atoms: 50
mcp: true
alias: extractor-pdf-text
---

# Extract Text from PDF API

PDF to Text API: send a PDF URL or upload a file and get the text back as JSON. Set page ranges or region bounds. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/apyhub/extract-text-from-pdf/url` | What it does Extracts text from a PDF located at a remote URL and returns the extracted content as… | 50 |
| POST | `https://api.eu.apyhub.com/apyhub/extract-text-from-pdf/file` | What it does Uploads a PDF file and extracts text from it. You can optionally limit extraction to a… | 50 |

## Endpoint reference

### submit url: extracted data

`POST https://api.eu.apyhub.com/apyhub/extract-text-from-pdf/url` · 50 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `url` | body | string (uri) | yes | Example: `https://assets.apyhub.com/samples/sample.pdf`. |
| `end_page` | body | integer | no | Default: `0`. |
| `start_page` | body | integer | no | Default: `1`. |
| `ending_x_coordinate` | body | integer | no | Default: `0`. |
| `ending_y_coordinate` | body | integer | no | Default: `0`. |
| `preserve_paragraphs` | body | boolean | no | Default: `false`. |
| `starting_x_coordinate` | body | integer | no | Default: `0`. |
| `starting_y_coordinate` | body | integer | no | Default: `0`. |

#### Quickstart

Extract text from a PDF by sending its URL in a minimal JSON request.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/extract-text-from-pdf/url" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"url":"https://assets.apyhub.com/samples/sample.pdf"}'
```

#### What you'll get back

Returns a JSON object with a `data` string field containing the extracted text from the PDF.

```json
{
  "data": "Chapter 1. Sample PDF text content extracted from the document."
}
```

### upload file: extracted data

`POST https://api.eu.apyhub.com/apyhub/extract-text-from-pdf/file` · 50 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | PDF file (.pdf). |
| `end_page` | body | integer | no | Last page (0 = all pages). Default: `0`. |
| `start_page` | body | integer | no | Default: `1`. |
| `ending_x_coordinate` | body | integer | no | Default: `0`. |
| `ending_y_coordinate` | body | integer | no | Default: `0`. |
| `preserve_paragraphs` | body | string | no | One of: true, false. Default: `false`. |
| `starting_x_coordinate` | body | integer | no | Default: `0`. |
| `starting_y_coordinate` | body | integer | no | Default: `0`. |

#### Quickstart

Upload a PDF file to extract its text.

```bash
curl -X POST "https://api.eu.apyhub.com/apyhub/extract-text-from-pdf/file" \
  -H "apy-token: $APY_TOKEN" \
  -F "file=@/path/to/document.pdf"
```

#### What you'll get back

Returns a JSON object with a `data` string field containing the extracted PDF text.

```json
{
  "data": "Chapter 1. Sample PDF text content extracted from the document."
}
```

## About

## What it does
The PDF to Text API takes a PDF and returns its text. Send a remote `url` or upload a `file` of up to 100 MB, and the response comes back as a single `data` string in JSON.

Two options control what you get. `start_page` and `end_page` limit extraction to a page range, which keeps responses small when you need one section of a long report. The four coordinate parameters (`starting_x_coordinate` through `ending_y_coordinate`) accept values from 0 to 100 and restrict extraction to a region of each page, useful for pulling a header block or a single column. Set `preserve_paragraphs` to true to keep paragraph breaks in the output.

Teams use the PDF to Text API to extract text from PDF documents for search indexing, to feed contracts and reports into AI pipelines, to migrate archived content into a CMS, and to run compliance checks across document sets.

This endpoint reads the text layer a PDF already carries. For scanned pages and photographed documents, run the [OCR Document Data Extraction API](https://apyhub.com/apyhub/service/extract-read-data) first, then send the result here.

It pairs with the [Extract Text from Word API](https://apyhub.com/apyhub/service/extract-text-from-word) when a batch mixes DOC and DOCX files, and with the [Table Extraction API](https://apyhub.com/apyhub/service/extract-table-data) when row and column structure matters. All three are callable by AI agents through ApyHub MCP.

## Usage

Base URL: `https://api.eu.apyhub.com` (default region — see
`GET https://apyhub.com/api/public/regions` for the rest).

Authenticate with an ApyHub API key in the `apy-token` header.
Full docs and a live playground: https://apyhub.com/apyhub/service/extract-text-from-pdf
