# PDF Text Extractor — PDF to Text, Pages & Metadata from URLs (`intelscrape/pdf-text-extractor`) Actor

PDF Text Extractor: convert PDFs from any URL to clean text, page by page, with title, author, dates, page count and word count. Bulk-process hundreds of PDF links for RAG, LLM and AI pipelines, search indexes or data entry. Flags scanned PDFs honestly. No API key. Pay per PDF.

- **URL**: https://apify.com/intelscrape/pdf-text-extractor.md
- **Developed by:** [IntelScrape](https://apify.com/intelscrape) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.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/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, Pages & Metadata from URLs

![PDF Text Extractor — PDF to Text, Pages & Metadata from URLs](https://api.apify.com/v2/key-value-stores/hRabN9WfDGrT4nSvV/records/pdf-text-extractor-banner.png)

🇨🇳 **PDF 文本提取器**：从任意链接批量下载 PDF 并转换为干净的文本，逐页输出，并附带标题、作者、日期、页数和字数。适用于 RAG、大模型与 AI 流程、搜索索引和数据录入。对扫描件如实标注。无需 API 密钥，按 PDF 付费。

🇸🇬 **Pengekstrak Teks PDF**: tukar PDF daripada mana-mana URL kepada teks bersih, halaman demi halaman, dengan tajuk, pengarang, tarikh, bilangan halaman dan perkataan. Sesuai untuk RAG, LLM dan saluran AI. Tiada kunci API.

#### 🤖 NEW: Connect This To Your AI!

Use this actor from Claude, ChatGPT, Cursor or any MCP client through the **[IntelScrape MCP Server](https://apify.com/intelscrape/skip--trace)**, or call it directly over the Apify API.

#### 🏆 Featured Bots by IntelScrape

- [Skip Trace Pro](https://apify.com/intelscrape/skip-trace-pro)
- [TruePeopleSearch Scraper](https://apify.com/intelscrape/truepeoplesearch-scraper)
- [TikTok Email Scraper](https://apify.com/intelscrape/tiktok-scraper)
- [Amazon Product Reviews Scraper](https://apify.com/intelscrape/amazon-product-review-scraper)
- [Website Contact Scraper](https://apify.com/intelscrape/contact-info-scraper)
- [Skip Trace MCP Server](https://apify.com/intelscrape/skip--trace)

⚡ Works with n8n, Make, Zapier, Google Sheets and the Apify API.

![price](https://img.shields.io/badge/price-%242%20per%201K%20PDFs-blue) ![billing](https://img.shields.io/badge/billing-pay%20per%20PDF-green) ![API key](https://img.shields.io/badge/API%20key-not%20required-brightgreen) ![OCR](https://img.shields.io/badge/OCR-not%20included-orange)

**Bulk PDF to text for RAG, LLMs and search: full text, per-page text and metadata from hundreds of PDF links in one run.**

> **Honest coverage & billing:** No OCR: image-only (scanned) PDFs produce little or no text and are flagged. You pay only for results actually delivered, and a built-in cost guard stops the run at your max-charge limit.

🌍 Built for teams in the **US, China and Singapore**, and anyone who needs this data in a spreadsheet or pipeline.

⭐ Found it useful? Please leave a review; it helps others find it.

⚖️ **Lawful business use only.** Collect public data only, and comply with the source site's terms, copyright and data-protection laws (GDPR, CCPA, China PIPL, Singapore PDPA).

*Examples below are illustrative; names and values may be fictional or out of date.*

### What is PDF Text Extractor?

Reports, filings, manuals, research papers and forms still live in PDFs, and most AI and search pipelines need plain text. **PDF Text Extractor** downloads PDFs from any list of URLs and returns the full text, the text of every page and the document metadata in one structured row per file, at a fraction of a cent per document.

### What does it do?

- **Bulk URLs**: paste any number of direct PDF links (or upload a list)
- **Full text + per-page text**: a single text field plus a pages array with page numbers and character counts
- **Metadata**: title, author, subject, keywords, creator, producer, creation and modification dates (UTC), PDF version
- **Counts**: page count, pages extracted, word and character counts, file size
- **Honest scanned-PDF flag**: likelyScanned is true when the file has almost no text layer, so you know which files need OCR
- **Safe limits**: max file size and max pages per PDF to control cost
- **Failed links are free**: non-PDFs, 404s and oversize files are reported with the reason and never charged

### Why choose us over cheaper scrapers?

- **Honest output**: limits are documented, missing data is labeled, never invented
- **Clean, consistent schema** ready for Excel, Sheets, BI tools or an LLM
- **No account risk**: no logins, no cookies, no API keys
- **Pay per result** with a built-in cost guard; no subscription, failed items are never charged
- **Fast and light**: no browser, no residential proxy, so runs finish in seconds and stay cheap
- **Maintained by IntelScrape** and fixed fast when the source changes

### Who is it for?

- **RAG and AI knowledge bases**: turn document libraries into chunks for embeddings and vector databases
- **LLM summarisation**: feed reports, contracts and research papers to ChatGPT, Claude or your own model
- **Compliance and finance**: extract text from filings, annual reports and policy documents for search and review
- **Academic research**: build text corpora from paper PDFs
- **Search indexing**: index PDF content on your website or intranet
- **Data entry automation**: pull text from invoices, forms and catalogs for parsing

### How to use it

#### In Apify Console (no code)

1. Click **Try for free** / **Start**. The form is prefilled with a working example.
2. Change the inputs (see examples below).
3. Click **Start**, then export the results as **JSON, CSV, Excel, XML or HTML**, or open them in Google Sheets.
4. Optional: **Schedule** the actor to run hourly, daily or weekly.

#### Via API

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

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

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("intelscrape/pdf-text-extractor").call(run_input={"pdfUrls": [{"url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"}], "includePages": true})
for item in client.dataset(run["default_dataset_id"]).iterate_items():
    print(item)
```

#### With AI agents (MCP)

Add Apify's MCP server (`https://mcp.apify.com`) or the [IntelScrape MCP Server](https://apify.com/intelscrape/skip--trace) to Claude Desktop, Cursor, ChatGPT or any MCP client, then ask in plain language, e.g. *"Run intelscrape/pdf-text-extractor with the default input and summarise the results."*

### Input examples

**One PDF (default)**

```json
{
  "pdfUrls": [{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" }],
  "includePages": true
}
```

**Several PDFs, full text only**

```json
{
  "pdfUrls": [
    { "url": "https://arxiv.org/pdf/1706.03762" },
    { "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" }
  ],
  "includePages": false
}
```

**First 20 pages of long reports**

```json
{
  "pdfUrls": [{ "url": "https://example.com/annual-report.pdf" }],
  "maxPagesPerPdf": 20,
  "maxFileSizeMb": 100
}
```

### Output fields

| Field | Description |
|---|---|
| `url / fileName` | Source link and file name |
| `status / error` | ok or error (with the reason; errors are not charged) |
| `pageCount / pagesExtracted` | Pages in the file and pages extracted |
| `fileSizeKb` | Downloaded size |
| `title / author / subject / keywords / creator / producer` | Document properties |
| `creationDate / modificationDate` | Dates converted to UTC ISO format |
| `pdfVersion / isEncrypted` | Technical info |
| `wordCount / charCount` | Size of the extracted text |
| `likelyScanned / note` | true when almost no text layer was found (OCR needed) |
| `text` | Full extracted text |
| `pages` | Array of { page, text, charCount } when includePages is on |

#### Sample output

```json
{
  "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf",
  "fileName": "fw9.pdf",
  "status": "ok",
  "pageCount": 6,
  "pagesExtracted": 6,
  "fileSizeKb": 137.5,
  "title": "Form W-9 (Rev. March 2024)",
  "author": "SE:W:CAR:MP",
  "creationDate": "2024-03-06T13:18:13.000Z",
  "wordCount": 6278,
  "charCount": 37693,
  "likelyScanned": false,
  "text": "Form W-9(Rev. March 2024)\nRequest for Taxpayer\nIdentification Number and Certification …",
  "pages": [{ "page": 1, "text": "Form W-9 …", "charCount": 6203 }]
}
```

### Pricing (pay per event)

| Event | When it is charged | Price |
|---|---|---|
| **Actor start** | once per run | $0.005 |
| **PDF** | per PDF extracted (includes the first 10 pages) | $0.002 |
| **Extra page** | each page after the first 10 in a PDF | $0.0001 |

#### Cost examples

| Run | Cost |
|---|---|
| Default run: one 6-page PDF | $0.007 |
| 100 PDFs of up to 10 pages | $0.205 |
| One 300-page report | $0.036 |

Platform usage is included in these prices. Set **Max charge per run** in the run options to cap spend; the actor stops cleanly when the limit is reached and keeps everything collected so far.

### FAQ

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

No. It extracts the existing text layer, which covers almost all digitally created PDFs. Scanned files are flagged with likelyScanned: true so you can route them to an OCR tool; you are not charged extra.

#### How accurate is the text?

For digital PDFs the text is what the file contains. On an IRS Form W-9 test the word count matched the poppler pdftotext reference within 1 word (6,278 vs 6,279). Reading order of complex multi-column layouts and tables can differ from the visual order.

#### Can I upload files instead of URLs?

Yes. Put files in an Apify key-value store or any public storage and pass their URLs.

#### What happens with password-protected PDFs?

Encrypted PDFs that need a password fail with a clear error and are not charged.

#### What if a link is not a PDF?

The row is returned with status error and the reason (for example "Not a PDF"), and it is not charged.

#### Is there a file size limit?

Default 50 MB per file, adjustable up to 200 MB. Larger files are skipped without charge.

#### Does it keep formatting?

It returns plain text with line breaks per text line and blank lines between pages. Fonts, images and exact layout are not preserved.

#### Can I use it from an AI agent?

Yes, call it via the Apify API or MCP and pass PDF links; the agent gets text back in seconds.

### Honest limits

- No OCR: image-only (scanned) PDFs produce little or no text and are flagged.
- Tables and multi-column layouts are returned as text lines; cell structure is not reconstructed.
- Some hosts block cloud servers; set a proxy if a download returns 403.
- Password-protected PDFs cannot be opened.

### Related IntelScrape bots

- [Website Contact Scraper](https://apify.com/intelscrape/contact-info-scraper): emails, phones & socials from sites
- [Google News Scraper](https://apify.com/intelscrape/google-news-scraper): headlines & summaries
- [Username Checker](https://apify.com/intelscrape/username-checker): find a username on 600+ sites
- [Google Autocomplete Scraper](https://apify.com/intelscrape/google-autocomplete-scraper): keyword suggestions from Google, YouTube, Amazon & Bing
- [Skip Trace Pro](https://apify.com/intelscrape/skip-trace-pro): people lookup
- [Skip Trace MCP Server](https://apify.com/intelscrape/skip--trace): IntelScrape tools for AI agents

### Legal

This actor collects publicly available data only. You are responsible for using the results lawfully and in line with the source's terms and applicable privacy laws (GDPR, CCPA, PIPL, PDPA). Process personal data only with a legitimate purpose. IntelScrape is not affiliated with, endorsed by or sponsored by the data source; all trademarks belong to their owners.

# Actor input Schema

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

Direct links to PDF files (http/https).

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

Adds a pages array (page number, text, characters) in addition to the full text.

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

0 = all pages. Use it to cap cost on very long documents.

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

Larger files are skipped and not charged.

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

Only needed if a host blocks cloud servers.

## Actor input object example

```json
{
  "pdfUrls": [
    {
      "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf"
    }
  ],
  "includePages": true,
  "maxPagesPerPdf": 0,
  "maxFileSizeMb": 50,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

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

// Run the Actor and wait for it to finish
const run = await client.actor("intelscrape/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" }] }

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

```

## MCP server setup

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