# PDF Text Extractor - Bulk PDF URLs to Text, Pages & Metadata (`bluemoonstone/pdf-text-extractor`) Actor

Returns the text of each PDF (whole document or one row per page), plus page count, title, author, dates and a flag for scanned PDFs without a text layer. Input: a list of PDF URLs. Built for RAG, AI agents and document pipelines. Pay per PDF and per page.

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

## Pricing

Pay per event

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/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

Give it a list of **PDF URLs**, get back **clean text** plus metadata, as one row per PDF or **one row per page** (ideal for RAG chunking, citations and AI agents).

### What you get

| Field | Example |
|---|---|
| `url`, `finalUrl` | link to the PDF |
| `text` | extracted text (whole document, or one page in page mode) |
| `pageNumber` | page mode only |
| `pageCount`, `pagesExtracted`, `charCount`, `fileSizeBytes` | size info |
| `title`, `subject`, `keywords`, `producer`, `createdAt`, `modifiedAt` | document metadata |
| `hasTextLayer`, `note` | `false` means a scanned PDF that needs OCR |
| `error` | why a file failed (`not_a_pdf`, `http_404`, `file_too_large`...) |

### Features

- Bulk: many PDFs in parallel.
- Whitespace clean-up and re-joined hyphenated words.
- Limit pages per PDF and maximum file size.
- Detects scanned PDFs without a text layer and does **not** charge their pages.
- No API keys, no setup.

### Pricing

- **$0.002 per PDF** processed
- **$0.0005 per page** of text extracted

A 10-page PDF costs $0.007. Failed downloads, non-PDF links and pages of scanned PDFs are free. Set a maximum cost per run in Apify and the Actor stops there.

### Example input

```json
{
  "pdfUrls": ["https://www.irs.gov/pub/irs-pdf/fw8ben.pdf"],
  "outputMode": "pages",
  "maxPages": 100
}
```

### Notes

- Text is read from the PDF's text layer; scanned images are not OCR'd.
- Author and creator metadata fields are intentionally not returned.
- The Actor obeys robots.txt (disallowed links return `error: "skipped_robots_txt"`, free) and does not log in or bypass access controls.

### How to use it

1. Click **Try for free** (an Apify account is free).
2. Fill in the input, or paste the JSON example below.
3. Click **Start** and wait for the run to finish.
4. Download the results as JSON, CSV, Excel or HTML, or get them by API, webhook or an integration (Google Sheets, Zapier, Make, n8n, Slack).

### Run it by API

Run the Actor and get the results in one call:

```bash
curl -X POST 'https://api.apify.com/v2/acts/bluemoonstone~pdf-text-extractor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"pdfUrls": ["https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"], "outputMode": "pages"}'
```

Or use the official [JavaScript](https://docs.apify.com/api/client/js/) and [Python](https://docs.apify.com/api/client/python/) clients.

### Use it from AI agents (MCP)

This Actor works as a tool for Claude, ChatGPT, Cursor, VS Code and other MCP clients through the [Apify MCP server](https://mcp.apify.com/). Add this server URL to your client:

```
https://mcp.apify.com?tools=bluemoonstone/pdf-text-extractor
```

Then ask, for example: *"Extract the text of these 30 PDF reports and summarize each one in three bullet points."*

It also works with LangChain, LlamaIndex, CrewAI and the OpenAI Agents SDK through the Apify integrations.

### FAQ

**Does it do OCR on scanned PDFs?**

No. It extracts the text layer. Scanned pages without a text layer are flagged and are free.

**Can I feed the output to an LLM or RAG pipeline?**

Yes. Use `outputMode: pages` to get one row per page, ready for chunking and embeddings.

**What are the limits?**

Up to 500 pages and 50 MB per PDF by default; both are configurable.

**Something not working, or need a feature?**

Open an issue in the **Issues** tab. Feature requests are welcome and shape what gets built next.

### Related tools by the same developer

- [Greenhouse, Lever & Ashby Jobs Scraper - Company Careers](https://apify.com/bluemoonstone/ats-jobs-scraper)
- [Website Technology Detector - Tech Stack Lookup in Bulk](https://apify.com/bluemoonstone/tech-stack-detector)
- [Sitemap URL Extractor - All Pages of Any Website](https://apify.com/bluemoonstone/sitemap-url-extractor)
- [Broken Link Checker - Find 404s & Dead Links on Any Site](https://apify.com/bluemoonstone/broken-link-checker)
- [SEO Audit Tool - Bulk On-Page SEO Checker for Any URL](https://apify.com/bluemoonstone/seo-page-audit)
- [Website Screenshot & PDF API - Bulk URL to PNG, JPEG or PDF](https://apify.com/bluemoonstone/website-screenshot-pdf)

### Responsible use

- Process only PDFs you have the right to access and use, and follow each site's terms of service and all applicable laws (copyright, privacy and data-protection laws such as GDPR).
- Extracted text may be copyrighted; use it for your own analysis, search or AI workflows, not to republish other people's work.
- Do not use it to collect personal data.
- Not affiliated with, endorsed by or sponsored by Adobe or any other company or website.

### Compliance

2026-11-29: checked against the project compliance checklist. User-directed tool (user supplies the URLs), obeys robots.txt, no login or access-control bypass, outputs no personal data (PDF author/creator fields dropped). Decision: publish.

# Actor input Schema

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

Direct links to PDF files (http or https).

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

Whole document text in one row, or one row per page (best for RAG chunking and citations).

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

Only the first N pages of each PDF are extracted (and charged).

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

Larger files are skipped (not charged).

## `normalizeWhitespace` (type: `boolean`):

Collapse repeated spaces, fix hyphenated line breaks and remove empty lines.

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

How many PDFs are processed at the same time.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "outputMode": "document",
  "maxPages": 500,
  "maxFileSizeMb": 50,
  "normalizeWhitespace": true,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

Dataset items.

# 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.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("bluemoonstone/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.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"] }

# Run the Actor and wait for it to finish
run = client.actor("bluemoonstone/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.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call bluemoonstone/pdf-text-extractor --silent --output-dataset

```

## MCP server setup

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