# PDF to Text API | Document Extraction for LLMs & RAG (`andok/pdf-text-converter`) Actor

Convert bulk PDF documents via URL into clean, raw text. The perfect document scraper for LLMs, vector databases, and RAG pipelines.

- **URL**: https://apify.com/andok/pdf-text-converter.md
- **Developed by:** [Andok](https://apify.com/andok) (community)
- **Categories:** AI, Developer tools, Business
- **Stats:** 27 total users, 0 monthly users, 96.9% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.47 / 1,000 document converteds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## PDF to Text Converter for AI & RAG

Extract clean text and metadata from PDF documents at scale for RAG pipelines, search indexing, and LLM ingestion. Point the actor at any PDF URL and get structured text output without installing local tools. Process entire document libraries in a single run.

### Features

- **Full text extraction** — extracts all readable text from PDF documents using pdf-parse
- **Metadata parsing** — captures page count, PDF version, author, title, and creation date
- **Bulk processing** — convert hundreds of PDFs in a single run
- **URL-based input** — no file uploads needed, just provide URLs pointing to PDF files
- **Configurable concurrency** — process 1 to 50 PDFs in parallel
- **Error resilience** — failed documents are reported with error details, not skipped silently

### Input

| Field | Type | Required | Default | Description |
|-------|------|----------|---------|-------------|
| `urls` | `array` | Yes | — | List of URLs pointing to PDF files to extract text from |
| `timeoutSeconds` | `integer` | No | `30` | Maximum seconds to wait for each PDF download |
| `concurrency` | `integer` | No | `5` | Number of PDFs to process in parallel (1-50) |

#### Input Example

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "timeoutSeconds": 30,
  "concurrency": 5
}
```

### Output

Each PDF produces one dataset item containing the extracted text and document metadata.

Key output fields:

- `inputUrl` (`string`) — the original PDF URL provided
- `status` (`number`) — HTTP status code from the download
- `pageCount` (`number`) — number of pages in the PDF
- `info` (`object`) — PDF metadata including title, author, creator, producer, and dates
- `text` (`string`) — the full extracted text content
- `error` (`string`) — error message if extraction failed, otherwise absent

#### Output Example

```json
{
  "inputUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
  "status": 200,
  "pageCount": 1,
  "info": {
    "Title": "Dummy PDF file",
    "Author": null,
    "Creator": "Writer",
    "Producer": "OpenOffice.org 2.1",
    "CreationDate": "D:20070223175637+02'00'"
  },
  "text": "Dummy PDF file\n\nThis is a dummy PDF file for testing purposes."
}
```

### Pricing

| Event | Cost |
|-------|------|
| Document Converted | Pay-per-event (see actor pricing page) |

The actor respects the per-run max charge limit. Processing stops automatically when the spending cap is reached.

### Use Cases

- **RAG document ingestion** — extract text from PDF knowledge bases for vector database indexing
- **Search indexing** — make PDF content searchable by extracting and indexing the text
- **Compliance review** — bulk-extract text from policy documents and contracts for automated analysis
- **Academic research** — convert research papers to plain text for NLP processing and citation analysis
- **Data migration** — extract content from legacy PDF archives into structured text formats

### Related Actors

| Actor | What it adds |
|-------|-------------|
| [Web Page to Markdown Converter for LLMs](https://apify.com/andok/markdown-extractor) | Convert web pages to Markdown alongside your PDF pipeline |
| [Article Text Extractor for TTS & AI](https://apify.com/andok/tts-reader) | Extract article text from web pages for a complete content pipeline |
| [HTML Table Extractor](https://apify.com/andok/html-table-extractor) | Extract structured table data from web pages |

# Actor input Schema

## `urls` (type: `array`):

List of URLs pointing to PDF files. Each PDF will be downloaded and its text content extracted along with document metadata.

## `timeoutSeconds` (type: `integer`):

Maximum seconds to wait for each PDF download before timing out. Increase for large files or slow servers.

## `concurrency` (type: `integer`):

Number of PDFs to process in parallel. Lower this for very large files to avoid memory issues.

## Actor input object example

```json
{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ],
  "timeoutSeconds": 30,
  "concurrency": 5
}
```

# Actor output Schema

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

No description

## `resultsCsv` (type: `string`):

No description

## `run` (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 = {
    "urls": [
        "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("andok/pdf-text-converter").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 = { "urls": ["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("andok/pdf-text-converter").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 '{
  "urls": [
    "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf"
  ]
}' |
apify call andok/pdf-text-converter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,andok/pdf-text-converter"
        }
    }
}

```

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/NTSFvJdzSu1R2QzPU/builds/fa63Njc6a6dKvTxmv/openapi.json
