---
title: Extract PDF Content API
slug: extract-pdf-content
url: https://apyhub.com/sarvasoft/service/extract-pdf-content
provider: SARVASOFT OPC PRIVATE LIMITED
categories: [Ingestion Kit, Document Intelligence Kit]
tags: [pdf-extraction, text-extraction, document-processing, base64, file-upload, url-ingestion]
auth: api_key
version: 2.0.0
service_type: sync
endpoints: 3
atoms: 5-12
mcp: true
---

# Extract PDF Content API

Extract PDF content API: send a PDF file, public URL, or Base64 input and receive its text in plain or page-by-page format. Free tier, no card.

## Endpoints

| Method | URL | Description | Atoms |
| --- | --- | --- | --- |
| POST | `https://api.eu.apyhub.com/sarvasoft/extract-pdf-content/file` | What it does Uploads a PDF file and extracts its text. Returns the text as one string, or page by p… | 12 |
| POST | `https://api.eu.apyhub.com/sarvasoft/extract-pdf-content/url` | What it does Extracts text from a PDF hosted at a public URL. Returns the text as one string, or pa… | 5 |
| POST | `https://api.eu.apyhub.com/sarvasoft/extract-pdf-content/base64` | What it does Extracts text from a Base64-encoded PDF sent in a JSON body. Returns the text as one s… | 11 |

## Endpoint reference

### Extract text from uploaded PDF file

`POST https://api.eu.apyhub.com/sarvasoft/extract-pdf-content/file` · 12 atoms · accepts `multipart/form-data` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `file` | body | string (binary) | yes | The PDF file to upload and extract text from. |
| `structured` | body | boolean | no | Return the text page by page instead of one string. Default: `false`. Example: `false`. |

#### Quickstart

Upload a PDF file to extract its text.

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

#### What you'll get back

Returns a JSON object in one of two shapes: either a `text` string with all extracted text in reading order, or a `page_count` integer plus a `pages` array of strings when structured extraction is enabled.

```json
{
  "text": "Extracted text from the PDF..."
}
```

### Extract text from PDF at remote URL

`POST https://api.eu.apyhub.com/sarvasoft/extract-pdf-content/url` · 5 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pdf_url` | body | string (uri) | yes | Public URL of the PDF to extract text from. Must be http or https. Example: `https://example.com/document.pdf`. |
| `structured` | body | boolean | no | Return the text page by page instead of one string. Default: `false`. Example: `false`. |

#### Quickstart

Extract text from a PDF at a public URL.

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

#### What you'll get back

Returns a JSON object in one of two shapes:

- `{"text": string}` when extraction is plain text.
- `{"page_count": integer, "pages": string[]}` when extraction is structured per page.

```json
{"text":"..."}
```

### Extract text from base64 PDF in JSON

`POST https://api.eu.apyhub.com/sarvasoft/extract-pdf-content/base64` · 11 atoms · accepts `application/json` · returns `application/json`

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `pdf_base64` | body | string | yes | Base64-encoded PDF to extract text from. Example: `JVBERi0xLjQKJeLjz9MK...`. |
| `structured` | body | boolean | no | Return the text page by page instead of one string. Default: `false`. Example: `false`. |

#### Quickstart

Extract text from a PDF provided as base64 in the request body.

```bash
curl -X POST "https://api.eu.apyhub.com/sarvasoft/extract-pdf-content/base64" \
  -H "apy-token: $APY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "pdf_base64": "JVBERi0xLjQKJc..."
  }'
```

#### What you'll get back

Returns a JSON object in one of two shapes:

- A plain-text response with a `text` string containing all extracted text in reading order, or
- A structured response with `page_count` as an integer and `pages` as an array of page text strings.

```json
{
  "text": "Extracted PDF text here."
}
```

```json
{
  "page_count": 2,
  "pages": [
    "Text from page 1.",
    "Text from page 2."
  ]
}
```

## About

## What it does
PDF Text Extractor turns a PDF into plain text or page-by-page text. Send a PDF file, a public PDF URL, or a base64-encoded PDF, and get the extracted text back in the response.

Use the `structured` flag when you need page boundaries preserved. With `structured: false`, the response contains a single `text` field with all content in reading order. With `structured: true`, the response returns `page_count` and a `pages` array, where each entry is the text from one page.

This is useful when you need to index uploaded documents, feed contract or report text into downstream parsing, or extract content from PDFs stored in object storage or fetched from external links. The API handles the transport format; you decide whether you want one continuous string or page-aware output.

Choose the file upload endpoint for direct uploads, the URL endpoint for remote PDFs, or the base64 endpoint when your application already has the document encoded in JSON.

To read a PDF's title, author and page count, use the [Extract PDF Metadata API](https://apyhub.com/sarvasoft/service/extract-pdf-metadata). To get a short summary instead of the full text, use the [Document Summarizer API](https://apyhub.com/apyhub/service/summarize-documents).

## 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/sarvasoft/service/extract-pdf-content
