# PDF Text Extractor: PDF URL to Text, per Page ($2/1K) (`tamnt67/pdf-text-extractor`) Actor

PDF text extractor: full text per PDF or per page, page count, word count, file size and metadata (title, author, dates). Takes PDF URLs, nothing to upload. Use it to turn PDF documents into text for search or LLM input.

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

## Pricing

from $1.40 / 1,000 text records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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: PDF URL to Text, per Page

Turn PDF links into plain text in bulk, with no login and no API key, for $2 per 1,000 text records on the Free plan, down to $1.40 on higher plans.

Paste PDF addresses and get the full text of each file as one record, or one record per page, plus the page count, file size and document metadata (title, author, subject, keywords, creator, producer, creation and modification dates). The Actor downloads each file and reads its text layer, so there is nothing to install and no file to upload.

### What you can do with it

- **Feed an AI or RAG pipeline.** Use page mode to get ready-made chunks with page numbers for embeddings and citations.
- **Search inside many PDFs at once.** Extract reports, papers, price lists and manuals, then search the text in a spreadsheet or database.
- **Index documents.** Store text and metadata such as `title`, `author` and `createdAt` in a search index or database.
- **Monitor PDFs that a website updates.** Schedule a run on the same links and compare `modifiedAt`, `fileSizeBytes` or the text between runs.
- **Check which PDFs are scanned.** `hasText` and `emptyPages` show which files or pages have no text layer and need OCR elsewhere.

### Output fields

Example values below come from a real run on the IRS Form W-9 PDF in page mode.

| Field | Example |
|-------|---------|
| `url` / `finalUrl` | https://www.irs.gov/pub/irs-pdf/fw9.pdf / https://www.irs.gov/pub/irs-pdf/fw9.pdf |
| `text` | full text of the document, or of one page in page mode |
| `pageNumber` | 1 (page mode only) |
| `totalPages` | 6 |
| `pagesExtracted` / `emptyPages` | pages read and pages without text (document mode only) |
| `charCount` / `wordCount` | 5658 / 932 (length of `text`) |
| `hasText` | true |
| `title` / `author` | Form W-9 (Rev. March 2024) / SE:W:CAR:MP |
| `subject` / `keywords` | Request for Taxpayer Identification Number and Certification / Fillable |
| `creator` / `producer` | Designer 6.5 / Designer 6.5 |
| `createdAt` / `modifiedAt` | 2024-03-06T08:18:13.000Z / 2024-03-06T08:18:13.000Z |
| `fileSizeBytes` | 140815 |
| `scrapedAt` | 2026-11-13T05:34:30.977Z |
| `fileName` | fw9.pdf (from the server's file name header or the link; null for base64 input) |
| `pdfVersion` | 1.7 (from the file header) |
| `pages` | document mode with **Per-page text** only: `[{ "pageNumber": 1, "text": "...", "wordCount": 932 }]` |
| `base64Index` | only for PDFs sent as base64: position in `base64Pdfs`, starting at 0 (`url` is null) |

Metadata fields are null when the PDF does not set them.

Download results as JSON, CSV, Excel or XML, or read them through the Apify API.

### Example output

One real record from a run in page mode (the page text is shortened):

```json
{
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "finalUrl": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "fileSizeBytes": 140815,
  "totalPages": 6,
  "title": "Form W-9 (Rev. March 2024)",
  "author": "SE:W:CAR:MP",
  "subject": "Request for Taxpayer Identification Number and Certification",
  "keywords": "Fillable",
  "creator": "Designer 6.5",
  "producer": "Designer 6.5",
  "createdAt": "2024-03-06T08:18:13.000Z",
  "modifiedAt": "2024-03-06T08:18:13.000Z",
  "pageNumber": 2,
  "text": "Form W-9 (Rev. 3-2024) Page 2\nmust obtain your correct taxpayer identification number (TIN), which\nmay be your social security number (SSN), ...",
  "charCount": 8168,
  "wordCount": 1349,
  "hasText": true,
  "scrapedAt": "2026-11-13T05:34:30.977Z"
}
```

### How to use

1. Paste **PDF URLs**, one per line. Each link should lead to a PDF file; article pages that name their PDF in a `citation_pdf_url` tag (for example `https://arxiv.org/abs/1706.03762`) are followed to the PDF.
2. Choose **Output mode**: one record per document, or one record per page (better for chunking in AI pipelines). Optionally lower **Max pages per PDF** or **Max file size (MB)**, or change **Parallel downloads**.
3. Optional: set **Page range** (for example `1-3, 5, 10-`) to read only some pages, turn on **Per-page text in document mode** to get the full text and a `pages` array in one record, enter a **PDF password** for protected files, or send files as **PDFs as base64** in an API call.
4. Click **Start**. Records appear in the dataset as each file is read. Export them or read them through the API.

#### Example input

```json
{
  "pdfUrls": ["https://arxiv.org/pdf/1706.03762", "https://www.irs.gov/pub/irs-pdf/fw9.pdf"],
  "outputMode": "page",
  "maxPagesPerPdf": 100,
  "maxFileSizeMb": 50,
  "maxConcurrency": 3,
  "proxyConfiguration": { "useApifyProxy": true }
}
```

### Pricing and cost examples

You pay per text record saved to the dataset ("Text record" event). In document mode each PDF is one record; in page mode each page is one record. Platform usage and proxy traffic are included in the per-record price.

| Apify plan | Price per 1,000 text records |
|------------|------------------------------|
| Free (default price) | $2.00 |
| Bronze | $1.80 |
| Silver | $1.60 |
| Gold, Platinum, Diamond | $1.40 |

Cost examples on the Free plan:

- 100 records ≈ $0.20 (for example 100 PDFs in document mode, or one 100-page PDF in page mode)
- 1,000 records ≈ $2.00
- 10,000 records ≈ $20.00 (≈ $14.00 on Gold and higher plans)

The Apify Free plan includes $5 of platform credit every month. If you spend it only on this Actor, that covers about 2,500 records per month. Choose document mode if you do not need page-level chunks; it is the cheaper option for long files.

You are charged only for records pushed to the dataset. Files that cannot be downloaded or read are not saved and not charged: links that answer with an error such as 404 or 403, downloads that still fail after 3 attempts, files larger than **Max file size**, files that are not PDFs, and PDFs that cannot be opened (for example password-protected ones without the right **PDF password**). Their addresses and the reason are listed in the key-value store record `FAILED_URLS`. A PDF that opens but has no text layer is still saved with `hasText: false` and is charged; in page mode that is one charged record per page. Repeated links in the input are read once. To set a hard cap, enter a maximum total charge per run in the run options. The Actor stops as soon as that limit is reached.

### Use it via API, on a schedule, or from an AI agent

**JavaScript** (`npm install apify-client`):

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

const client = new ApifyClient({ token: 'YOUR_API_TOKEN' });

const run = await client.actor('tamnt67/pdf-text-extractor').call({
    pdfUrls: ['https://www.irs.gov/pub/irs-pdf/fw9.pdf'],
    outputMode: 'page',
});

const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**Python** (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_API_TOKEN")

run = client.actor("tamnt67/pdf-text-extractor").call(run_input={
    "pdfUrls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"],
    "outputMode": "page",
})

items = client.dataset(run["defaultDatasetId"]).list_items().items
print(items)
```

**cURL** (runs the Actor and returns the records in one call):

```bash
curl -X POST "https://api.apify.com/v2/acts/tamnt67~pdf-text-extractor/run-sync-get-dataset-items?token=YOUR_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"pdfUrls": ["https://www.irs.gov/pub/irs-pdf/fw9.pdf"], "outputMode": "page"}'
```

The sync endpoint waits for the run to finish, so use it for a few files and the client libraries for large batches.

**Schedules:** create an Apify Schedule for this Actor or a saved task to re-read the same PDF links regularly, then connect it to a webhook or Google Sheets to notice when a file changes.

**AI agents:** the Apify MCP server at https://mcp.apify.com lets AI assistants such as Claude or Cursor run this Actor and read its results.

### FAQ

#### How much does PDF Text Extractor cost?

PDF Text Extractor costs $2 per 1,000 text records on the Free plan and $1.80, $1.60 or $1.40 per 1,000 on higher Apify plans. In document mode a PDF is one record, so 100 PDFs cost about $0.20 on the Free plan. In page mode each page is one record. The Free plan's $5 monthly credit covers about 2,500 records.

#### How many pages can it read per PDF?

PDF Text Extractor reads up to `maxPagesPerPdf` pages from each file (default 500, maximum 5,000) and skips files larger than `maxFileSizeMb` (default 50 MB, maximum 200 MB). `totalPages` always shows the full page count of the file.

#### Can I run it on a schedule or through the API?

Yes. PDF Text Extractor works with Apify Schedules for regular re-reads, and with the Apify API through the JavaScript and Python clients or a single cURL call. See the API section above for working examples.

#### How fresh is the data?

PDF Text Extractor downloads each file at the time of each run. Nothing is cached, so you always get the current version of the PDF behind the link. Every record has a `scrapedAt` timestamp.

#### What happens to my PDF files?

PDF Text Extractor downloads each file from the link you give into the run's memory, reads it and saves only the extracted text and metadata to the run's dataset in your Apify account. The PDF file itself is not stored. Only use links you are allowed to access and process.

#### Can it read scanned PDFs?

No. PDF Text Extractor reads the PDF's text layer and does not include OCR. Scanned PDFs (images of pages) come back with empty `text` and `hasText: false`, and a warning in the log.

### Limitations

- Text is read from the PDF's text layer. Scanned PDFs (images of pages) have no text layer, and OCR is not included, so `hasText` is false for them.
- Tables and multi-column layouts come out as plain text in reading order as stored in the file. Cell structure is not kept.
- Password-protected PDFs need **PDF password**; one password is used for every PDF in the run.
- The link must lead to a PDF file, or to an article page with a `citation_pdf_url` tag (followed once). Pages that need a login or show a bot challenge are skipped.
- Markdown output is not included: the text layer has no reliable heading or table structure, so the text comes out as plain text.
- **Page range** is applied before **Max pages per PDF**. A PDF with no page inside the range is not saved and not charged.
- A PDF without a text layer is still charged, once per document or once per page in page mode.
- The size limit is checked against the file size the server announces before the download starts, and again while the file arrives, so an oversized file is dropped as soon as it passes the limit instead of being downloaded in full.
- Metadata comes from the PDF itself and can be missing or odd, for example an internal code in `author`.

### Changelog

- 1.0 update (2026-11-23): new optional **Page range**, per-page `pages` array in document mode, **PDF password** for protected files and **PDFs as base64** for API calls; article pages such as arXiv abstract pages are followed to their PDF; every record now also has `fileName` and `pdfVersion`. Existing inputs give the same records as before.
- 1.0 update (2026-11-19): an API call that leaves out `pdfUrls` no longer gets the example value added; the example is used only when the run has no input source at all.
- 1.0 (2026-11-19): files larger than **Max file size** are now rejected from the announced size or as soon as the download passes the limit, instead of after a full download; README states that scanned PDFs without text are saved and charged (per page in page mode).

### Integrations

Works with every Apify integration: API, webhooks, Zapier, Make, Google Sheets, Slack, n8n, LangChain and the Apify MCP server.

### Support

Found a problem or missing field? Report it in the Issues tab of this Actor.

# Actor input Schema

## `pdfUrls` (type: `array`):

Links to PDF files, one per line. Article pages that name their PDF in a citation_pdf_url tag (arXiv, many journals and repositories) are followed to the PDF.

## `outputMode` (type: `string`):

One record per PDF document, or one record per page.

## `maxPagesPerPdf` (type: `integer`):

Read at most this many pages from each file.

## `pageRange` (type: `string`):

Optional: only read these pages, for example 1-3, 5, 10- (pages start at 1; 10- means page 10 to the end). Empty reads every page up to Max pages per PDF.

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

In document mode, also add a pages array with the text and word count of each page, so you get full text and page chunks in one record.

## `base64Pdfs` (type: `array`):

Optional, for API calls: PDF files given as base64 strings (a data: URL prefix is allowed) instead of URLs. The record has url null and base64Index set.

## `pdfPassword` (type: `string`):

Optional password for protected PDFs. Used for every PDF in the run; PDFs without a password open as before.

## `maxFileSizeMb` (type: `integer`):

Skip files larger than this.

## `maxConcurrency` (type: `integer`):

How many PDFs to process at the same time.

## `proxyConfiguration` (type: `object`):

Proxy for the downloads. Datacenter proxy works for most sites.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "outputMode": "document",
  "maxPagesPerPdf": 500,
  "includePages": false,
  "maxFileSizeMb": 50,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `texts` (type: `string`):

Dataset with one record per result.

## `textsCsv` (type: `string`):

The same dataset exported as CSV.

# 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 = {
    "pdfUrls": [
        "https://arxiv.org/pdf/1706.03762"
    ],
    "maxPagesPerPdf": 500,
    "maxFileSizeMb": 50,
    "maxConcurrency": 3,
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("tamnt67/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 = {
    "pdfUrls": ["https://arxiv.org/pdf/1706.03762"],
    "maxPagesPerPdf": 500,
    "maxFileSizeMb": 50,
    "maxConcurrency": 3,
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("tamnt67/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 '{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "maxPagesPerPdf": 500,
  "maxFileSizeMb": 50,
  "maxConcurrency": 3,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call tamnt67/pdf-text-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,tamnt67/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/R8LdtplkDCvC7Hx8C/builds/eTm8bhxDrF1THft2p/openapi.json
