# PDF Text Extractor (`properscraper/pdf-text-extractor`) Actor

Extract the text of PDF files in bulk from their web addresses: the full text, page by page if you want it, plus title, author, dates and page count. For reports, papers, manuals, price lists and filings. Fast, with no browser.

- **URL**: https://apify.com/properscraper/pdf-text-extractor.md
- **Developed by:** [jake mcclure](https://apify.com/properscraper) (community)
- **Categories:** AI, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.50 / 1,000 pdf extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PDF Text Extractor

Extract the text of PDF files in bulk from their web addresses. For each PDF you get the full text, the text of each page if you want it, and the document's own details: title, author, creation date and page count.

It is built for reports, research papers, manuals, price lists, contracts and filings that are published as PDFs. No browser is used, so hundreds of documents take minutes.

Use it to:

- feed PDF documents to an AI assistant, a RAG pipeline or a search index
- turn a folder of reports or papers into text you can analyse
- pull the text out of every PDF linked from a site (get the links with a crawler first)
- check what a set of documents contains without opening each one

### Input

| Field | What it does |
|---|---|
| **PDF addresses** | One per line: the web address of each PDF. |
| **Also give the text page by page** | Adds a list with the text of each page, useful when you need page numbers for citations. Off by default. |
| **Pages to read** | Read only this many pages from the start of each PDF. 0 (default) reads every page. |
| **Obey robots.txt** | On by default: a file its website asks crawlers not to read is skipped and not charged for. |

```json
{
    "urls": ["https://arxiv.org/pdf/1706.03762", "https://example.com/reports/annual-2025.pdf"],
    "includePages": true
}
```

### Output

One record per PDF:

```json
{
    "input": "https://example.com/reports/annual-2025.pdf",
    "url": "https://example.com/reports/annual-2025.pdf",
    "fileSizeBytes": 2215244,
    "title": "Annual Report 2025",
    "author": "Example Ltd",
    "subject": "Finance",
    "keywords": "report, finance",
    "creator": "Writer",
    "producer": "PDF Library 2.1",
    "createdAt": "2026-01-15T08:30:00.000Z",
    "modifiedAt": "2026-02-01T12:00:00.000Z",
    "pageCount": 48,
    "pagesRead": 48,
    "wordCount": 18240,
    "characterCount": 112904,
    "text": "Annual report for 2025\n\nRevenue grew by ten percent…",
    "pages": [
        { "page": 1, "text": "Annual report for 2025" },
        { "page": 2, "text": "Revenue grew by ten percent…" }
    ],
    "scrapedAt": "2026-11-18T12:00:00.000Z"
}
```

- `text` is the whole document, pages separated by a blank line. `pages` is `null` unless you ask for the page-by-page text.
- `title`, `author` and the dates are what the document's author filled in; many PDFs leave them empty.
- `url` is the address the file was finally served from, after any redirects.

A `SUMMARY` record in the run's key-value store lists any PDFs that could not be read and why.

### Pricing

Pay per result. You are charged once for each PDF whose text is saved, at the per-result price shown on this page, whatever its length.

Nothing is charged for a file that could not be downloaded, is not a PDF, is password protected or damaged, or contains no text. Lines that are not web addresses and repeated addresses cost nothing. The run stops as soon as it reaches the maximum charge you set for it.

### Limits

- **Scanned documents are not read.** A scan is a set of pictures of pages with no text inside it; reading it needs OCR, which this Actor does not do. Such files are reported as "no text" and not charged.
- Text comes out in reading order as the PDF stores it. Tables lose their grid, and multi-column layouts can interleave on some documents.
- Images, charts and form fields are not extracted.
- Files up to 40 MB are read. Password-protected files are skipped.
- The address must lead straight to the PDF file, not to a page that shows it in a viewer.

### Is this allowed, and how may I use the text?

The Actor downloads each file once, identifies itself in its User-Agent, obeys robots.txt by default and paces its requests to each site. Most documents are protected by copyright; check the publisher's terms before republishing their text or training on it.

# Actor input Schema

## `urls` (type: `array`):

One per line: the web address of each PDF file.

## `includePages` (type: `boolean`):

Add a list with the text of each page, as well as the full text. Useful when you need to cite page numbers.

## `maxPages` (type: `integer`):

Read only this many pages from the start of each PDF. 0 reads every page.

## `respectRobotsTxt` (type: `boolean`):

Skip a file its website's robots.txt asks crawlers not to read. Skipped files are not charged for.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "includePages": false,
  "maxPages": 0,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `pdfs` (type: `string`):

One record per PDF whose text was extracted.

## `summary` (type: `string`):

Totals for the run and, for each batch of PDFs, how many results were saved and any error.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "urls": [
        "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("properscraper/pdf-text-extractor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "urls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("properscraper/pdf-text-extractor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call properscraper/pdf-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,properscraper/pdf-text-extractor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/AHzauSguxSc0UDLt5/builds/bxJD8h5baFvGj0z5d/openapi.json
