# PDF to Text & JSON – Bulk PDF Text Extractor & Parser (`friedl/pdf-text-extractor`) Actor

Extract text from PDF URLs in bulk as clean JSON: full text per document or per page, page count, word count, PDF metadata (title, dates, producer) and scanned-PDF detection. Fast (200 pages in ~2 s), no browser, failed files are not charged. Ideal for RAG, LLM and search pipelines.

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

## Pricing

Pay per usage

This Actor is paid per platform usage. The Actor is free to use, and you only pay for the Apify platform usage, which gets cheaper the higher subscription plan you have.

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

## 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 to Text & JSON in Bulk

Turn PDF links into clean text in bulk. It is fast, reliable and cheap: a 200-page PDF takes about 2 seconds, and you need no API key.

- **Full text** per PDF, or **one result per page**, which helps with chunking for RAG, LLM and vector databases
- **Counts:** total pages, pages extracted, characters and words
- **Document metadata:** title, subject, keywords, creator, producer, creation and modification date, and PDF version
- **Scanned-PDF detection:** `likelyScanned: true` when a PDF has (almost) no text layer
- **Fair billing:** files that fail (404, not a PDF, too large or password-protected) are **not charged**. They are listed in the key-value store record `FAILED_URLS`.
- **Delta mode:** monitor published PDFs, such as price lists, terms or reports, and receive only those whose text changed

### Use cases

- **AI and RAG pipelines:** feed reports, manuals, papers or contracts into LLMs and vector stores.
- **Search and analytics:** index annual reports, tenders, research papers or product data sheets.
- **Monitoring:** run it daily in delta mode to detect changes in published PDFs.
- **Automation:** connect it to Make, Zapier, n8n or the Apify API, and send PDF links from your workflow.

### Input examples

```json
{ "pdfUrls": ["https://www.rfc-editor.org/rfc/rfc9110.pdf", "https://example.com/report.pdf"], "outputMode": "document" }
```

Page-level chunks for a vector database:

```json
{ "pdfUrls": ["https://example.com/manual.pdf"], "outputMode": "pages", "maxPagesPerPdf": 300 }
```

### Output (document mode)

```json
{
  "id": "https://www.rfc-editor.org/rfc/rfc9110.pdf",
  "url": "https://www.rfc-editor.org/rfc/rfc9110.pdf",
  "fileName": "rfc9110.pdf",
  "totalPages": 194,
  "pagesExtracted": 194,
  "metadata": { "title": "RFC 9110: HTTP Semantics", "subject": "The Hypertext Transfer Protocol (HTTP) is ...", "keywords": null, "creator": "xml2rfc 3.12.10", "producer": "cairo 1.16.0", "created": "2022-06-06T11:15:02Z", "modified": "2022-06-06T11:15:19Z", "pdfVersion": "1.5" },
  "text": "RFC 9110\nHTTP Semantics\nAbstract\nThe Hypertext Transfer Protocol (HTTP) is a stateless ...",
  "truncated": false,
  "characters": 460253,
  "words": 71309,
  "likelyScanned": false,
  "fetchedAt": "2026-10-08T14:00:00.000Z"
}
```

In pages mode, each item has `page`, `text`, `characters`, `words` and `likelyScanned` for a single page. Its `id` is `<url>#page=<n>`.

### Pricing

Pay per event: **USD 3.00 per 1,000 results** (event `result`), with lower prices on higher Apify subscription plans. In document mode, one result is one PDF. In pages mode, one result is one page. There is no start fee, and failed files are free. Users on the Apify Free plan are limited to 50 results per run.

### Limits

- **No OCR:** the actor reads the text layer only. Scanned PDFs without a text layer return little or no text and are flagged with `likelyScanned`.
- Password-protected PDFs are skipped.
- The text of a single document is capped at 5 million characters (`truncated: true`). Use pages mode for very large documents.
- The author field of the PDF metadata is not returned on purpose, because it often contains a person's name.
- The actor sends at most 1 request per second to each host and processes 3 PDFs in parallel.

### Responsibility

The actor processes only the documents that you provide. You are responsible for having the right to download and process them, for example your own documents, documents under an open licence, or uses permitted by copyright law. Text is processed in your Apify run and stored only in your own dataset.

### Impressum / Legal notice

Anbieter dieses Actors (Angaben gemäß § 5 DDG) / Provider of this actor:

Friedrich Köhler\
Spatzenweg 7\
04720 Döbeln\
Deutschland\
E-Mail: actorcreater_010@web.de

# Actor input Schema

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

Direct links to PDF files (http/https), one per line. Files from your Apify key-value store work too (use the record's public URL). Duplicates are removed.

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

document = one result per PDF with the full text (cheapest). pages = one result per page (charged per page) – useful for chunking, citations and page-level search.

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

Only the first N pages of each PDF are extracted.

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

Larger files are skipped (not charged).

## `includeMetadata` (type: `boolean`):

Title, subject, keywords, creator, producer, creation/modification date and PDF version (document mode).

## `mode` (type: `string`):

'all' returns every PDF. 'delta' returns only PDFs (or pages) whose extracted text changed since the last run with the same input – useful for monitoring published documents such as price lists or terms.

## `maxResults` (type: `integer`):

Maximum number of results (= charged events: PDFs in document mode, pages in pages mode) per run. Users on the Apify Free plan are limited to 50 results per run.

## `deltaStateName` (type: `string`):

Name for the delta state, e.g. "price-list-monitor". Leave empty to derive it from the input.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://www.rfc-editor.org/rfc/rfc9110.pdf"
  ],
  "outputMode": "document",
  "maxPagesPerPdf": 500,
  "maxFileSizeMb": 50,
  "includeMetadata": true,
  "mode": "all",
  "maxResults": 1000
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# 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://www.rfc-editor.org/rfc/rfc9110.pdf"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("friedl/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://www.rfc-editor.org/rfc/rfc9110.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("friedl/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://www.rfc-editor.org/rfc/rfc9110.pdf"
  ]
}' |
apify call friedl/pdf-text-extractor --silent --output-dataset

```

## MCP server setup

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