# PDF Text Extractor: PDF to Text & JSON, Bulk URLs, No Start Fee (`delgadolegacy/pdf-text-extractor`) Actor

Extract text from PDF URLs in bulk: full text, per-page text, page ranges, keyword hits, title/page count/dates metadata and a scanned-PDF flag, as JSON, CSV or Excel. Fast, no OCR fees, no start fee. From $0.80 per 1,000 PDFs.

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

## Pricing

from $0.80 / 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.
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 to Text & JSON from URLs, in Bulk

**PDF Text Extractor** turns **PDF URLs into clean text and JSON** in bulk: the **full text**, optional **per-page text** (ideal for RAG chunking and citations), **page ranges**, **keyword counts with page numbers**, and document **metadata** (title, subject, page count, created/modified dates, file size, SHA-256) plus a **scanned-PDF flag**. Export as JSON, CSV or Excel or call it from the API, Make, Zapier or n8n. **No start fee, no OCR surcharges. Pay per result from $0.80 per 1,000 PDFs.**

### Why use this PDF text extractor

- ✅ **Bulk**: paste or upload hundreds of PDF links; 5 are processed in parallel by default.
- ✅ **Per-page text** and **page ranges** (`1-3,7`, `5-`) so you only process what you need.
- ✅ **Keyword finder**: counts each keyword and lists the pages it appears on.
- ✅ **Layout mode** keeps table/column spacing for forms and statements.
- ✅ **Honest failures**: broken links, non-PDF files and password-protected PDFs come back as an item with a clear `error` and are never charged.
- ✅ **Cheapest per PDF**: planned price is about **$1 per 1,000 PDFs with no start fee** (popular alternatives charge $3.45–$5 per 1,000 plus a start fee).
- ✅ **Pay only for results**: $1.20 per 1,000 PDFs on the Free plan, down to $0.80 on Gold+. No start fee.

### Use cases

- **RAG and AI pipelines**: per-page text with page numbers for chunking and citations.
- **Document monitoring**: hash + keyword hits to spot changes in policies, filings or price lists.
- **Research and compliance**: pull text from reports, regulations and public filings at scale.
- **Data entry automation**: extract text from invoices, statements and forms you're allowed to process.

### How to extract text from PDFs

1. Add your PDF URLs (or upload a list).
2. Optional: set page ranges, turn on per-page text, add keywords.
3. Click **Start**, then export the dataset or use the API.

An empty input `{}` runs a demo on three public IRS forms (W-9, W-4, 1040).

### Input example

```json
{
  "pdfUrls": [
    {"url": "https://www.irs.gov/pub/irs-pdf/p15.pdf"},
    {"url": "https://www.irs.gov/pub/irs-pdf/p17.pdf"}
  ],
  "pages": "1-20",
  "includePageTexts": true,
  "keywords": ["deadline", "penalty"],
  "maxTextLength": 2000
}
```

| Field | What it does |
|---|---|
| `pdfUrls` | Direct PDF links |
| `pages` | Page ranges, e.g. `1-3,7` or `5-` (empty = all) |
| `includePageTexts` | Adds a `pages` array: `[{page, text}]` |
| `keywords` | Case-insensitive count + page list per keyword |
| `preserveLayout` | Keep visual spacing (tables, forms) |
| `maxTextLength` | Truncate `text` (0 = full) |
| `maxPagesPerPdf`, `maxFileSizeMb`, `maxConcurrency` | Safety and speed limits |

### Sample results (real rows from our test run, Oct 24, 2026, pages 1-20, keywords "deadline" and "penalty")

| PDF | Title | Pages | Words (p.1-20) | "penalty" hits (pages) | Time |
|---|---|---|---|---|---|
| p17.pdf | 2025 Publication 17 | 142 | 23,809 | 15 (5, 8, 13, 16, 18) | 1.2 s |
| p15.pdf | 2026 Publication 15 | 59 | 19,187 | 6 (10, 12, 17) | 1.9 s |
| i1040gi.pdf | 2025 Instruction 1040 | 126 | 14,025 | 0 | 2.5 s |
| notapdf_xyz.pdf | (error: 404 Not Found, not charged) | | | | 0.8 s |

### Output example

```json
{
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "fileName": "fw9.pdf",
  "success": true,
  "fileSizeBytes": 140815,
  "sha256": "2d420cbb4123dcf1fb82595b2359cfbb5d81f00b9df9d359fcc7af361d093f53",
  "title": "Form W-9 (Rev. March 2024)",
  "subject": "Request for Taxpayer Identification Number and Certification",
  "producer": "Designer 6.5",
  "createdAt": "2024-03-06T08:18:13",
  "pageCount": 6,
  "pagesExtracted": 6,
  "encrypted": false,
  "charCount": 37734,
  "wordCount": 6520,
  "hasTextLayer": true,
  "text": "Form W-9\n(Rev. March 2024)\nRequest for Taxpayer\nIdentification Number and Certification\n...",
  "textTruncated": false,
  "durationSec": 0.31
}
```

With `includePageTexts` you also get `"pages": [{"page": 1, "text": "..."}]`, and with `keywords` you get `"keywordHits": {"penalty": {"count": 6, "pages": [10, 12, 17]}}`.

### Limits

- Reads the PDF's **text layer**. Scanned image-only PDFs return little or no text and are flagged with `hasTextLayer: false` (no OCR).
- Password-protected PDFs return an error.
- Author/creator personal names in PDF metadata are intentionally not output.

### Pricing

**Pay per result**, live since Oct 24, 2026: you pay only for PDFs saved to the dataset. No start fee, no monthly rental. Failed or skipped PDFs are never charged.

| Apify plan | Price per 1,000 PDFs |
|---|---|
| Free | $1.20 |
| Bronze | $1.00 |
| Silver | $0.90 |
| Gold, Platinum, Diamond | $0.80 |

Apify platform usage is included. Set *Maximum cost per run* in the run options to cap spend; the run stops charging at your limit.

### FAQ

**Does it work with Google Drive or Dropbox links?** Use a direct-download link that returns the PDF file itself.

**Does it follow robots.txt?** Yes. URLs disallowed by a site's robots.txt are skipped and reported.

**Is this legal?** Only process PDFs you have the right to use. The Actor downloads only the links you provide; it does not crawl sites.

**Found a bug or need a field?** Open an issue on the Issues tab.

### More free tools from the same developer

- [Career Page Jobs Scraper](https://apify.com/delgadolegacy/career-page-jobs-scraper): every open job from company career pages on Greenhouse, Lever, Ashby and Workable in one dataset.
- [SAM.gov Contract Opportunities](https://apify.com/delgadolegacy/samgov-opportunities): federal bids and solicitations from SAM.gov's official public data, no API key.
- [Remote Jobs Aggregator](https://apify.com/delgadolegacy/remote-jobs-aggregator): remote jobs from We Work Remotely and Remote OK, deduplicated, with salary and a new-jobs monitor.
- [Sitemap URL Extractor](https://apify.com/delgadolegacy/sitemap-url-extractor): every URL from a website's sitemap.xml with lastmod, hreflang and regex/date filters.

# Actor input Schema

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

Direct links to PDF files (http/https). Add as many as you like or upload a list.

## `pages` (type: `string`):

Page ranges to extract, e.g. '1-3,7' or '5-'. Empty = all pages.

## `includePageTexts` (type: `boolean`):

Add a 'pages' array with the text of each page (great for RAG chunking and citations).

## `keywords` (type: `array`):

Count each keyword (case-insensitive) and list the pages it appears on.

## `preserveLayout` (type: `boolean`):

Keep the visual column/table spacing (useful for tables and forms). Off = clean reading-order text.

## `maxTextLength` (type: `integer`):

Truncate the 'text' field to this many characters (0 = full text).

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

Only read the first N selected pages of each PDF (0 = no limit).

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

Skip files larger than this.

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

How many PDFs to process at the same time.

## Actor input object example

```json
{
  "pdfUrls": [
    {
      "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    },
    {
      "url": "https://www.irs.gov/pub/irs-pdf/fw4.pdf"
    }
  ],
  "includePageTexts": false,
  "preserveLayout": false,
  "maxTextLength": 0,
  "maxPagesPerPdf": 0,
  "maxFileSizeMb": 50,
  "maxConcurrency": 5
}
```

# Actor output Schema

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

One item per PDF: text, metadata, optional per-page text and keyword hits, or an error.

## `runSummary` (type: `string`):

Counts of extracted, failed and robots.txt-skipped PDFs.

# 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": [
        {
            "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
        },
        {
            "url": "https://www.irs.gov/pub/irs-pdf/fw4.pdf"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("delgadolegacy/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": [
        { "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" },
        { "url": "https://www.irs.gov/pub/irs-pdf/fw4.pdf" },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("delgadolegacy/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": [
    {
      "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    },
    {
      "url": "https://www.irs.gov/pub/irs-pdf/fw4.pdf"
    }
  ]
}' |
apify call delgadolegacy/pdf-text-extractor --silent --output-dataset

```

## MCP server setup

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