# PDF to Markdown Converter for RAG & LLMs (`siteproof/pdf-to-markdown`) Actor

Convert public PDF URLs into clean Markdown for RAG, LLM, and AI-agent pipelines. Keeps headings, lists, and tables when the file has real text, with optional page-level chunks and word counts. No OCR, no API key, no start fee.

- **URL**: https://apify.com/siteproof/pdf-to-markdown.md
- **Developed by:** [siteproof](https://apify.com/siteproof) (community)
- **Categories:** AI, Developer tools, Agents
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 pdf converteds

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

### What does PDF to Markdown Converter for RAG & LLMs do?

**PDF to Markdown Converter** turns public PDF URLs into **clean Markdown** that you can feed to a retrieval pipeline, an LLM, or an AI agent. You get **one JSON row per file** with the title, page count, full Markdown, optional page-level chunks, and character and word counts.

Headings, lists, and tables are preserved when the PDF contains real text. Scanned or image-only files are reported as empty and are not charged. No API keys, no login, no OCR at this price. Built by **siteproof**.

**Price: $0.004 per successfully converted PDF.** Failed or invalid inputs are not charged.

### What you get vs a typical single-site scraper

| | Typical single-site scraper | This Actor |
| --- | --- | --- |
| Input | File uploads or local paths that are hard for agents | Public HTTPS PDF URLs an agent can pass directly |
| Output | Plain text with lost structure, or a start fee plus a per-page fee | Markdown with headings, lists, and tables, plus optional page chunks, for $0.004 per successful PDF |
| Failures | Often billed even when extraction is empty | Invalid URLs, download failures, and empty/scanned PDFs are free |

### Sample output

Shortened from a real run on the public arXiv PDF `1706.03762` (22 Nov 2026, Atlantic time). Character and word counts are rounded in this excerpt.

```json
{
  "url": "https://arxiv.org/pdf/1706.03762",
  "title": "Attention Is All You Need",
  "pageCount": 15,
  "pagesConverted": 15,
  "truncated": false,
  "markdown": "# Attention Is All You Need\n\nAbstract\n\nThe dominant sequence transduction models are based on complex recurrent or convolutional neural networks...",
  "charCount": 43000,
  "wordCount": 7100,
  "status": "ok"
}
```

### How to use

1. Open [PDF to Markdown Converter for RAG & LLMs](https://apify.com/siteproof/pdf-to-markdown) in Apify Console, or call it through the API or the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).
2. Paste one or more public PDF URLs. Turn on page-level chunks if you want one Markdown segment per page for RAG.
3. Run the Actor. A short prefill input is already filled in so you can try it quickly.
4. Open the dataset for labeled JSON, or export CSV / Excel. Schedule the same input for monitoring.

### Pricing

**$0.004 per successfully converted PDF.** That is $4 per 1,000 successful results. There is **no start fee**. Failed, invalid, or empty results are not charged. Optional summary rows, when present, are free.

You only pay for successful results. Platform compute is billed by Apify on top of the event price according to your account plan.

### Use with AI agents / MCP

AI agents discover Apify Store tools through the [Apify MCP server](https://mcp.apify.com): `search-actors` finds candidates, `fetch-actor-details` returns the input schema, README (or summary), output schema, and pricing, then `call-actor` runs the tool. The same search backend is used by Apify AI in Console. Ranking correlates with the [Actor quality score](https://docs.apify.com/actors/publishing/quality-score), so clear titles, field descriptions, and a complete README help agents pick the right tool.

This Actor uses **limited permissions**, so agents can call it without a full-permission approval prompt. It is also eligible for [agentic payments](https://docs.apify.com/agents/payments) (x402, MPP, or a Skyfire prepaid token).

Typical agent flow:

1. `search-actors` with keywords such as `PDF to Markdown RAG`
2. `fetch-actor-details` with actor `siteproof/pdf-to-markdown`
3. `call-actor` with input like:

```json
{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "includeChunks": true
}
```

Or start a run over HTTP:

```http
POST https://api.apify.com/v2/acts/siteproof~pdf-to-markdown/runs
Content-Type: application/json
Authorization: Bearer YOUR_APIFY_TOKEN
```

```json
{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "includeChunks": true
}
```

You can also schedule runs in [Apify Console](https://console.apify.com), export JSON, CSV, or Excel, and attach webhooks. There is no start fee.

### FAQ

#### Does this do OCR?

No. Image-only or scanned PDFs come back empty and are not charged. That keeps the price at $0.004 per successful text PDF.

#### Can I upload a file from my computer?

This Actor takes public PDF URLs. Host the file at an HTTPS URL, or use Apify's key-value store to serve it and pass that URL.

#### What am I charged for?

You pay $0.004 only when a PDF is successfully converted to Markdown. Invalid URLs, download failures, and empty or scanned PDFs are free.

#### Is this good for AI agents?

Yes. The input is a list of URLs, the output is labeled JSON with Markdown and optional chunks, and the Actor uses limited permissions so it can run through the Apify MCP server.

### Related siteproof Actors

- [Website Security Audit](https://apify.com/siteproof/website-trust-audit) — Audit the sites you are collecting PDFs from
- [Topic News Monitor](https://apify.com/siteproof/topic-news-monitor) — Deduplicated RSS headlines your agent can follow with this converter
- [Job Materials List](https://apify.com/siteproof/job-materials-list) — Structured materials lists for trade jobs

Built by [siteproof](https://apify.com/siteproof). Public data only. No personal data on individuals.

# Actor input Schema

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

Public HTTPS URLs of PDF files to convert, one per item. Example: `["https://arxiv.org/pdf/1706.03762"]`.

## `includeChunks` (type: `boolean`):

When enabled, also return one Markdown chunk per converted page, useful for RAG splitting. Default follows the input schema prefill.

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

Maximum pages to convert in each PDF. Leave the default unless you need a shorter excerpt.

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

Skip files larger than this size in megabytes so a huge download cannot stall the run.

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

How many PDFs to convert in parallel.

## `requestTimeoutSecs` (type: `integer`):

HTTP timeout in seconds for downloading each PDF.

## `convertTimeoutSecs` (type: `integer`):

Maximum time in seconds to spend converting one downloaded PDF.

## Actor input object example

```json
{
  "pdfUrls": [
    "https://arxiv.org/pdf/1706.03762"
  ],
  "includeChunks": true,
  "maxPages": 50,
  "maxFileSizeMb": 20,
  "maxConcurrency": 3,
  "requestTimeoutSecs": 60,
  "convertTimeoutSecs": 120
}
```

# Actor output Schema

## `conversionResults` (type: `string`):

Default dataset items. Each item is one PDF with Markdown, optional page chunks, counts, and status.

# 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://arxiv.org/pdf/1706.03762"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("siteproof/pdf-to-markdown").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://arxiv.org/pdf/1706.03762"] }

# Run the Actor and wait for it to finish
run = client.actor("siteproof/pdf-to-markdown").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://arxiv.org/pdf/1706.03762"
  ]
}' |
apify call siteproof/pdf-to-markdown --silent --output-dataset

```

## MCP server setup

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

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/zWCKfg0ZPUMKa8Mag/builds/1Jh8H6xEcTaAdzJnJ/openapi.json
