# Any URL to Markdown — Web Pages, PDF, Word, Excel & OCR (`actor-forge/any-url-to-markdown`) Actor

Turn any URL into clean, LLM-ready Markdown: web pages, PDFs, Word, Excel, PowerPoint, EPUB, CSV and JSON, plus OCR for images and scanned PDFs. One url in, Markdown plus a token estimate out. Built for AI agents, MCP, RAG, Clay and n8n. From $1 per 1,000 pages.

- **URL**: https://apify.com/actor-forge/any-url-to-markdown.md
- **Developed by:** [ActorForge](https://apify.com/actor-forge) (community)
- **Categories:** AI, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 page results

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

## Any URL to Markdown — Web Pages, PDF, Word, Excel & OCR

Turn any URL into clean, LLM-ready Markdown: web pages, PDFs, Word, Excel, PowerPoint, EPUB, CSV and JSON, plus OCR for images and scanned PDFs. One url in, Markdown plus a token estimate out. Built for AI agents, MCP, RAG, Clay and n8n. From $1 per 1,000 pages.

**Convert any URL to Markdown with one call.** Give it one `url` (or a list) and it works out what the link really is: a **web page**, a **PDF**, a **Word, Excel or PowerPoint** file, an **OpenDocument** or **EPUB** file, **CSV**, **JSON**, or an **image or scanned PDF** that needs **OCR**. It then sends the link to the right converter and returns clean, **LLM-ready Markdown**, with headings, lists, tables and links kept. Each result also has a `tokenEstimate`, the title, metadata (author, dates, page count, word count) and the `route` that was used. It is built as an **AI agent tool**. One string goes in and one Markdown string comes out, so it is easy to call from **MCP** clients (Claude, Cursor, ChatGPT), **LangChain/LlamaIndex RAG** pipelines, **Clay** enrichments and **n8n/Make/Zapier** flows. It replaces four tools: a web scraper, a PDF parser, an Office converter and an OCR engine. Typical uses: **convert any file to Markdown** for a vector store, read the documents an agent finds while browsing, and turn linked reports, spreadsheets and slide decks into context for an LLM. Web pages: Mozilla Readability keeps the main content, and robots.txt is respected. PDFs: the text layer is read with layout-aware heading and paragraph detection. Pages with no text layer are read with **Tesseract OCR** (7 languages). Office files keep their tables as Markdown tables. **Simple pay-per-result pricing: $1 per 1,000 web pages, $2 per 1,000 documents, $3 per 1,000 OCR pages**, with no compute bill on top. Failed downloads, unsupported files, pages blocked by robots.txt and empty results are never charged.

📘 **Step-by-step guide:** [How to Convert PDF to Markdown for RAG Pipelines](https://devtaonas.github.io/actorforge-site/guides/convert-pdf-to-markdown-for-rag/)

### What data does it return?

Every run outputs clean, schema-validated rows like these:

| url | detectedFormat | route | title | tokenEstimate | markdown |
| --- | --- | --- | --- | --- | --- |
| https://arxiv.org/pdf/1706.03762 | pdf | pdf-text | Attention Is All You Need | 9600 | Provided proper attribution is provided, Google hereby grants permission to reproduce the tables and figures… |
| https://en.wikipedia.org/wiki/Retrieval-augmented_generation | html | html | Retrieval-augmented generation - Wikipedia | 5811 | **Retrieval-augmented generation** (**RAG**) is a technique that enables large language models… |
| https://calibre-ebook.com/downloads/demos/demo.docx | docx | office | DOCX Demo | 2604 | # Demonstration of DOCX support in calibre\n\nThis document demonstrates the ability of the calibre DOCX Input plugin… |
| https://raw.githubusercontent.com/apache/poi/trunk/test-data/spreadsheet/SampleSS.xlsx | xlsx | office | Sample Spreadsheet | 96 | ## First Sheet\n\n| Test spreadsheet | column_B |\n| --- | --- |\n| 2nd row | 2nd row 2nd column |… |
| https://github.com/tesseract-ocr/tessdoc/raw/main/images/eurotext.png | png | image-ocr | eurotext.png | 120 | The (quick) \[brown] {fox} jumps!\nOver the $43,456.78 \<lazy> #90 dog… |

### How much does it cost?

Transparent pay-per-event pricing — you only pay for what you get, and the
actor **always respects your run budget**: set a maximum total charge and it
stops cleanly at the cap instead of overrunning.

| Event | Price | Charged | Worked example |
| --- | --- | --- | --- |
| `page-result` | $0.001 | per web page converted to Markdown | 1,000 web pages = $1.00 |
| `document-converted` | $0.002 | per PDF (each started 50 text pages), Word, Excel, PowerPoint, OpenDocument, EPUB, CSV or JSON file converted | A 15-page PDF = $0.002; a 120-page PDF = $0.006; 1,000 Word files = $2.00 |
| `page-ocr` | $0.003 | per image, or scanned PDF page, read by OCR | A 10-page scanned PDF = $0.03 |
| `apify-actor-start` | $0.00005 | per run per GB of memory (platform start fee) | One run at 1 GB = $0.00005 |

### Input options

| Field | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| `url` | string | no | — | One link to convert: a web page, PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), OpenDocument, EPUB, CSV, JSON or image. The file type is detected automatically. |
| `urls` | array | no | — | Optional: more links to convert in the same run (up to 1,000 in total, duplicates removed). |
| `includeText` | boolean | no | `false` | Add a text field with the Markdown syntax removed. |
| `onlyMainContent` | boolean | no | `true` | Keep only the article or main content of web pages (navigation, footers and cookie banners removed). Turn off to convert the whole page body. |
| `ocr` | boolean | no | `true` | Read text from images (PNG, JPEG, TIFF, WebP, GIF, BMP) and from PDF pages that have no text layer, with Tesseract OCR. Turn off to never pay for OCR: images and scanned pages are then reported as errors (free). |
| `ocrLanguages` | array | no | `["eng"]` | Languages in your scanned documents (up to 3). For 29 languages and word boxes use the OCR to Text actor. |
| `maxOcrPages` | integer | no | `20` | Upper limit of scanned pages read by OCR in one PDF ($0.003 each). Pages beyond it are left out and the row is marked truncated. |
| `maxPdfPages` | integer | no | `500` | Read at most this many pages of each PDF. |
| `maxRowsPerSheet` | integer | no | `1000` | Excel, OpenDocument and CSV tables are cut after this many rows (marked truncated). |
| `respectRobotsTxt` | boolean | no | `true` | Skip URLs that the site's robots.txt disallows. It is checked before every request: web pages, direct file links and every redirect target. A robots.txt that answers with a server error counts as disallow-all (RFC 9309). |

### Limits & honest notes

- Web pages are fetched as static HTML, with no browser. Pages that build their content with JavaScript (an empty app shell) are reported, not charged; use a browser-based crawler for those. This actor converts the URLs you give it and does not crawl sites (see Website to Markdown for that).
- PDF pages with a text layer are read exactly; pages without one are read by OCR when it is on (up to 20 per PDF by default, set by maxOcrPages). OCR covers 7 languages (English, German, French, Spanish, Italian, Portuguese, Dutch). Handwriting and low-resolution photos come out poorly. For 29 languages, word boxes and per-page output, use OCR to Text.
- Legacy binary Office files (.doc, .xls, .ppt), RTF, OpenDocument presentations (.odp), HEIC/AVIF images and SVG are not supported. They are reported with a clear reason and never charged.
- Spreadsheets are cut at 1,000 rows per sheet by default (maxRowsPerSheet), and very large results are cut at about 3.5 million characters. Cut rows are marked truncated: true.
- Files up to 50 MB. Password-protected PDFs and pages behind a login can't be read.
- Polite by design: it sends an honest crawler user agent (ActorForge-AnyUrlToMarkdown) and does not pose as a browser. When a site answers 429 (rate limited) or 403 (refused), that URL is retried at most once (429 only, after Retry-After up to 30 s) and the remaining URLs on the same host are skipped as free error rows.
- tokenEstimate is characters divided by 4. That is a good guide for English with GPT and Claude tokenizers, not an exact count.
- Respects your run budget: set a maximum total charge and processing stops cleanly at the cap. No result is delivered without being paid for, and none is charged twice.

### Related ActorForge actors

- [Web Fetch](https://apify.com/actor-forge/web-fetch) — Markdown and plain text in one row, tuned for fast agent and MCP calls
- [Website to Markdown](https://apify.com/actor-forge/website-to-markdown) — crawl a whole site, not single URLs
- [PDF to Markdown](https://apify.com/actor-forge/pdf-to-markdown) — PDF-only, with per-page output and RAG chunks
- [Word, Excel & PowerPoint to Markdown](https://apify.com/actor-forge/office-to-markdown) — sheets as JSON rows, slides and RAG chunks
- [OCR to Text](https://apify.com/actor-forge/ocr-to-text) — 29 OCR languages, word boxes and confidence per page
- **Learn more:** [How to Convert PDF to Markdown for RAG Pipelines](https://devtaonas.github.io/actorforge-site/guides/convert-pdf-to-markdown-for-rag/)

### Changelog

- **2026-10-19** — Initial release: a single url input with automatic format detection. Web pages (Readability), PDFs (text layer, plus OCR for scanned pages), DOCX/PPTX/XLSX/ODT/ODS/EPUB/CSV/JSON, and image OCR (Tesseract, 7 languages). Returns tokenEstimate and route.
- **2026-10-20** — Hardening: stricter internal-address guard (all IPv6 forms, checked on every redirect), honest crawler user agent, robots.txt checked before every request incl. file links and redirects (5xx = disallow-all per RFC 9309), per-host stop after a 429/403, 50 MB file cap with lower memory use.

***

*Built and maintained by **ActorForge**. Reliability first: every actor in the
portfolio is monitored by an automated nightly self-test, and breakages are
typically fixed the same day.*

# Actor input Schema

## `url` (type: `string`):

One link to convert: a web page, PDF, Word (.docx), Excel (.xlsx), PowerPoint (.pptx), OpenDocument, EPUB, CSV, JSON or image. The file type is detected automatically.

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

Optional: more links to convert in the same run (up to 1,000 in total, duplicates removed).

## `includeText` (type: `boolean`):

Add a text field with the Markdown syntax removed.

## `onlyMainContent` (type: `boolean`):

Keep only the article or main content of web pages (navigation, footers and cookie banners removed). Turn off to convert the whole page body.

## `ocr` (type: `boolean`):

Read text from images (PNG, JPEG, TIFF, WebP, GIF, BMP) and from PDF pages that have no text layer, with Tesseract OCR. Turn off to never pay for OCR: images and scanned pages are then reported as errors (free).

## `ocrLanguages` (type: `array`):

Languages in your scanned documents (up to 3). For 29 languages and word boxes use the OCR to Text actor.

## `maxOcrPages` (type: `integer`):

Upper limit of scanned pages read by OCR in one PDF ($0.003 each). Pages beyond it are left out and the row is marked truncated.

## `maxPdfPages` (type: `integer`):

Read at most this many pages of each PDF.

## `maxRowsPerSheet` (type: `integer`):

Excel, OpenDocument and CSV tables are cut after this many rows (marked truncated).

## `respectRobotsTxt` (type: `boolean`):

Skip URLs that the site's robots.txt disallows. It is checked before every request: web pages, direct file links and every redirect target. A robots.txt that answers with a server error counts as disallow-all (RFC 9309).

## Actor input object example

```json
{
  "url": "https://arxiv.org/pdf/1706.03762",
  "includeText": false,
  "onlyMainContent": true,
  "ocr": true,
  "ocrLanguages": [
    "eng"
  ],
  "maxOcrPages": 20,
  "maxPdfPages": 500,
  "maxRowsPerSheet": 1000,
  "respectRobotsTxt": true
}
```

# Actor output Schema

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

One row per URL with Markdown, optional plain text, token estimate, detected format, route and metadata.

## `summary` (type: `string`):

URLs converted per route, and URLs that failed or were skipped (never charged).

# 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 = {
    "url": "https://arxiv.org/pdf/1706.03762"
};

// Run the Actor and wait for it to finish
const run = await client.actor("actor-forge/any-url-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 = { "url": "https://arxiv.org/pdf/1706.03762" }

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

```

## MCP server setup

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