What it does
AI agents and RAG pipelines keep running into links they cannot read directly: a PDF report, a linked spreadsheet, a slide deck, an article page full of navigation. Each format usually means another library. Any URL to Markdown works out what the link actually is and routes it to the right converter, so your code only ever handles Markdown.
It handles web pages (main content kept with Mozilla Readability, robots.txt respected), PDFs (text layer read with heading and paragraph detection), Word, Excel and PowerPoint, OpenDocument, EPUB, CSV and JSON. Images and PDF pages without a text layer go through Tesseract OCR in 7 languages. Headings, lists, tables and links are kept, and every result includes a title, metadata, the route used and a tokenEstimate.
Pricing follows what was converted: $1 per 1,000 web pages, $2 per 1,000 documents (a PDF counts once per started 50 text pages) and $3 per 1,000 OCR pages. Failed downloads, unsupported files, robots-blocked pages and empty results are not charged. It fits MCP clients, LangChain or LlamaIndex pipelines, Clay enrichments and n8n, Make or Zapier flows.
How it works
- You pass a single
url, or a list inurls(up to 1,000 per run, duplicates removed). - The actor checks robots.txt (on by default), downloads the link and detects its real format rather than trusting the file extension.
- It routes the file to a converter: Readability for HTML, a layout-aware PDF text reader, Office and EPUB converters, or Tesseract OCR for images and scanned pages when
ocris on. - The result is one row per URL with
markdown,title,detectedFormat,route,tokenEstimateand metadata such as author, dates and page count. - Limits such as
maxPdfPages,maxOcrPagesandmaxRowsPerSheetkeep large files in check, and truncated results are flagged.
Input example
A typical run input (JSON). Every field is also available as a form in the Apify console.
{
"url": "https://arxiv.org/pdf/1706.03762",
"urls": [
"https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
"https://calibre-ebook.com/downloads/demos/demo.docx"
],
"onlyMainContent": true,
"ocr": true,
"ocrLanguages": [
"eng"
],
"maxPdfPages": 500,
"respectRobotsTxt": true
}All input fields
| Field | Type | Required | Default | What it does |
|---|---|---|---|---|
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). |
Output example
The sample shows a PDF, a Wikipedia article, a Word file, a spreadsheet and an image, each converted to Markdown with the route and token estimate.
| url | detectedFormat | route | title | tokenEstimate | markdown |
|---|---|---|---|---|---|
| https://arxiv.org/pdf/1706.03762 | 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 |… |
Pricing
Pay per event: you are charged only for the results you receive, with no subscription. Set a maximum total charge on any run and it stops cleanly at the cap.
| Charged for | When | Price | Per 1,000 | Worked example |
|---|---|---|---|---|
| Page result | Charged per web page converted to Markdown | $0.001 | $1 | 1,000 web pages = $1.00 |
| Document converted | Charged per PDF (each started 50 text pages), Word, Excel, PowerPoint, OpenDocument, EPUB, CSV or JSON file converted | $0.002 | $2 | A 15-page PDF = $0.002; a 120-page PDF = $0.006; 1,000 Word files = $2.00 |
| Page ocr | Charged per image, or scanned PDF page, read by OCR | $0.003 | $3 | A 10-page scanned PDF = $0.03 |
| Actor Start (platform start fee) | Charged when the Actor starts running. Number of events charged depends on Actor memory (one event per GB, minimum one event). | $0.00005 | — | One run at 1 GB = $0.00005 |
Prices are read from the live Apify Store listing when this page is built. The listing is always authoritative.
Try Any URL to Markdown on Apify. Pay only for the results you get.
Run on Apify →Use cases
Document ingestion for RAG
Point it at the PDFs, docs and pages you want in a vector store and chunk the returned Markdown by heading. The tokenEstimate helps plan chunk sizes and embedding costs. See the PDF to Markdown for RAG guide.
Reading tool for AI agents
Give an MCP agent one tool that reads whatever it finds while browsing. One string goes in and one Markdown string comes out, so the agent does not need to know whether a link is a PDF or a spreadsheet.
Spreadsheets and decks as LLM context
Excel sheets become Markdown tables and slide decks become readable text, so a linked financial table or pitch deck can be summarised or queried by an LLM.
Enrichment in Clay or n8n
Add a step that turns a company's linked report or policy page into Markdown inside a no-code flow, then pass it to a summarisation step.
How it compares
| ActorForge Any URL to Markdown | Web scraper plus separate file parsers | Browser-based crawler | |
|---|---|---|---|
| PDF, Office, EPUB, CSV and JSON in one call | Yes | Only with several libraries | Usually HTML only |
| OCR for images and scanned pages | Yes, 7 languages | Separate OCR tool needed | No |
| JavaScript-rendered pages | No, static HTML only (reported, not charged) | Depends | Yes |
| Crawls a whole site | No, converts the URLs you give it | Yes, if you build it | Yes |
| Token estimate per result | Yes | No | Rarely |
| Pages behind a login | No | Possible with your own code | Often possible |
If your sources are JavaScript-heavy apps or sit behind a login, a browser-based crawler is the better choice. For mixed links to documents and ordinary pages, one converter is simpler than maintaining a scraper, a PDF parser, an Office converter and an OCR engine.
Limits and 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.
FAQ
How do I convert a URL to Markdown for an LLM?
Pass the link as url and read the markdown field of the result. The actor detects whether it is a web page, PDF, Office file, EPUB, CSV, JSON or image and picks the converter for you.
How accurate is the token estimate?
tokenEstimate is the character count divided by 4. It is a good guide for English text with GPT and Claude tokenizers, but not an exact count.
Which files can it not convert?
Legacy binary Office files (.doc, .xls, .ppt), RTF, OpenDocument presentations, HEIC/AVIF images and SVG are not supported. Password-protected PDFs and pages behind a login cannot be read either. These are reported with a reason and never charged.
How much does converting a long PDF cost?
A PDF is charged $0.002 per started 50 text pages, so a 15-page PDF costs $0.002 and a 120-page PDF costs $0.006. Scanned pages read by OCR cost $0.003 each, up to maxOcrPages (20 by default) per PDF.
Can I turn off OCR to keep costs predictable?
Yes. Set ocr to false and images or scanned pages are reported as errors instead of being read, at no charge. For 29 OCR languages and word boxes, use OCR to Text.
Use it from code
Run the actor through the Apify API with the input above.
cURL
curl -X POST "https://api.apify.com/v2/acts/actor-forge~any-url-to-markdown/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"url": "https://arxiv.org/pdf/1706.03762", "urls": ["https://en.wikipedia.org/wiki/Retrieval-augmented_generation", "https://calibre-ebook.com/downloads/demos/demo.docx"], "onlyMainContent": true, "ocr": true, "ocrLanguages": ["eng"], "maxPdfPages": 500, "respectRobotsTxt": true}'JavaScript (Node.js)
// Node.js 18+ (built-in fetch). Set APIFY_TOKEN in your environment.
const input = {
"url": "https://arxiv.org/pdf/1706.03762",
"urls": [
"https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
"https://calibre-ebook.com/downloads/demos/demo.docx"
],
"onlyMainContent": true,
"ocr": true,
"ocrLanguages": [
"eng"
],
"maxPdfPages": 500,
"respectRobotsTxt": true
};
const res = await fetch(
"https://api.apify.com/v2/acts/actor-forge~any-url-to-markdown/run-sync-get-dataset-items",
{
method: "POST",
headers: {
Authorization: `Bearer ${process.env.APIFY_TOKEN}`,
"Content-Type": "application/json",
},
body: JSON.stringify(input),
}
);
const items = await res.json();
console.log(items.length, items[0]);Python
# pip install apify-client (set APIFY_TOKEN in your environment)
import os
from apify_client import ApifyClient
client = ApifyClient(os.environ["APIFY_TOKEN"])
run_input = {
"url": "https://arxiv.org/pdf/1706.03762",
"urls": [
"https://en.wikipedia.org/wiki/Retrieval-augmented_generation",
"https://calibre-ebook.com/downloads/demos/demo.docx"
],
"onlyMainContent": True,
"ocr": True,
"ocrLanguages": [
"eng"
],
"maxPdfPages": 500,
"respectRobotsTxt": True
}
run = client.actor("actor-forge/any-url-to-markdown").call(run_input=run_input)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item)The run-sync-get-dataset-items endpoint waits for the run (up to 5 minutes) and returns the dataset rows directly. For longer runs, start the run asynchronously and read the dataset when it finishes, as the Python example does. Replace APIFY_TOKEN with your own token from the Apify console.
Step-by-step guides
How to Convert PDF to Markdown for RAG Pipelines
Send your PDF links to the Any URL to Markdown actor, read the markdown field of each result, then split it by heading into token-sized chunks…
Related actors
OCR — Scanned PDF & Image to Text (Tesseract, 29 Languages)
Extract text from scanned PDFs and images (PNG, JPEG, TIFF, WebP, GIF, BMP) with Tesseract 5 OCR in 29 languages. PDF pages that already have text…
$3 per 1,000 · page ocrPDF OCR — Scanned PDF to Searchable Text (29 Languages)
OCR scanned PDFs to text page by page with Tesseract 5 in 29 languages. Pages that already have a text layer are read directly at a tenth of the…
$3 per 1,000 · page ocrWayback Machine Scraper — Archive.org Snapshots & URL History
Every Wayback Machine (archive.org) capture of a URL, folder, host or domain: timestamp, status, MIME type, digest and archive links. Unique…
$2 per 1,000 · snapshotTry Any URL to Markdown on Apify. Pay only for the results you get.
Run on Apify →