URL and PDF to Markdown for LLMs and RAG avatar

URL and PDF to Markdown for LLMs and RAG

Pricing

from $1.20 / 1,000 url converteds

Go to Apify Store
URL and PDF to Markdown for LLMs and RAG

URL and PDF to Markdown for LLMs and RAG

Convert web pages, PDF, Word, PowerPoint and Excel files to clean Markdown for LLMs and RAG: tables kept, headings, metadata, token counts and chunks. OCR for scanned PDFs, Arabic kept in order. Failed sources are free.

Pricing

from $1.20 / 1,000 url converteds

Rating

0.0

(0)

Developer

abdulrahman alrashid

abdulrahman alrashid

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 days ago

Last modified

Features

Limited permissions

Share

Turn web pages, PDF, Word, PowerPoint and Excel files into clean Markdown that an LLM can read: tables stay tables, headings and lists stay in place, and every result comes with its title, author, date, language and token count. Add token-sized chunks for your vector store with one setting. You pay only for sources that were converted; failed links and files are free, and the 5 USD of free monthly credit covers about 3,333 web pages or short documents.

What is URL and PDF to Markdown?

URL and PDF to Markdown is a document parser API on Apify. Give it links, upload files or point it at the URL field of any dataset, and it saves one row per source with the content as Markdown. It is built for RAG pipelines, AI agents and knowledge-base imports, where clean text means fewer tokens and fewer errors downstream.

  • Web pages and documents in one Actor and one output format.
  • Tables kept as Markdown tables in every format, with the table count in each row.
  • Arabic and other right-to-left text kept in logical order, also inside PDF tables.
  • Optional chunks of a chosen token size, cut at headings first, with overlap and the page each chunk starts on.
  • Two document modes: fast (text layer) and accurate (layout model, complex tables, OCR for scanned pages).
  • Optional JSON structure of every heading, paragraph, list item and table with its page number.

What can it convert?

SourceHow it is readNotes
Web pages (HTML)Main content found with trafilatura (menus, footers and banners removed); headings, lists, tables and code keptA headless browser opens pages that need JavaScript (renderJs)
PDF, fast modeText layer read with PDFium (pypdfium2): rows, aligned columns become tables, two-column pages read column by column, repeated headers, footers and page numbers removedScanned pages have no text layer: they are skipped and listed in warnings
PDF, accurate modeDocling layout model and TableFormer table model on CPU, Tesseract OCR in English and Arabic for pages without a text layerSlower, priced per page
Word (.docx)python-docx: headings, numbered and bullet lists, tables (merged cells kept in place), content controls, text boxes, linksPages are the count Word saved in the file
PowerPoint (.pptx)python-pptx: one section per slide with its title, text in reading order, tables, speaker notesPages are slides
Excel (.xlsx)openpyxl: one Markdown table per sheet with cached formula values, up to 500 rows per sheetPages are sheets

The type is read from the file's own bytes, not from its name or the server's Content-Type, so a PDF served as application/octet-stream or a link without an extension still works. Older binary formats (.doc, .xls, .ppt), macro-enabled files (.docm, .xlsm, .pptm), images, CSV and plain text are not converted; such sources are listed in FAILED with the reason.

How to convert a PDF or web page to Markdown

  1. Paste links into URLs of pages and documents, upload files in Upload documents, or choose a dataset in Dataset with URLs and name the field with the links.
  2. Pick the Document mode (fast or accurate) and, for RAG, a Chunk size in tokens.
  3. Click Start, then open the Output tab: the Overview view lists every source with its type, title and tokens, Markdown shows the text and Chunks lists one line per chunk. Export to JSON, CSV or Excel, or read the dataset with the Apify API.

How much does it cost?

You pay per converted web page or document, plus a small fee per page for long documents. Failed links, blocked addresses, unsupported, damaged or password-protected files, and documents without text cost nothing.

EventCharged whenFree planBronzeSilverGold
URL converted (url-converted)One web page or document converted and its row saved. Failed sources are not charged.1.50 USD per 1,000 events1.50 USD per 1,000 events1.35 USD per 1,000 events1.20 USD per 1,000 events
Actor start (apify-actor-start)Charged by Apify when the run starts: once up to 1 GB of memory, then once for each extra GB.0.05 USD per 1,000 runs0.05 USD per 1,000 runs0.05 USD per 1,000 runs0.05 USD per 1,000 runs
Extra page (extra-page)Fast mode: each document page beyond the first 5 (PDF pages, slides, sheets, Word pages).0.50 USD per 1,000 events0.50 USD per 1,000 events0.45 USD per 1,000 events0.40 USD per 1,000 events
Accurate page (accurate-page)Accurate mode: each PDF page converted with the layout model and OCR.4.00 USD per 1,000 events4.00 USD per 1,000 events3.60 USD per 1,000 events3.20 USD per 1,000 events

Example: 1,000 web pages or documents on the Bronze plan cost 1,000 x 0.0015 USD = 1.50 USD, plus 0.00005 USD for the run start. Platform usage (compute, storage, traffic) is included in these prices.

Free plan: the 5 USD of monthly Apify credit covers about 3,333 web pages or documents a month when no other Actor is used.

Worked examples on the Bronze plan:

  • Web pages: 1,000 pages cost 1,000 x 0.0015 USD = 1.50 USD.
  • Documents in fast mode: a 10-page PDF costs 0.0015 USD plus 5 x 0.0005 USD for pages 6 to 10, so 0.004 USD; 1,000 of them cost 4.00 USD.
  • Accurate mode: a 20-page PDF costs 0.0015 USD plus 20 x 0.004 USD, so 0.0815 USD.

Only converted pages are charged: pages left out by Pages to convert or cut by Max pages per document cost nothing. Set a maximum cost per run in the run options: the Actor counts a document's pages before converting it, converts only the pages that fit (with a warning in the row), and then starts no new source.

Input example

{
"urls": [
"https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
"https://example.com"
],
"documentMode": "fast",
"chunkTokens": 500,
"chunkOverlap": 100,
"pageRange": "1-20",
"includeLinks": false
}

A crawler's dataset as input, with the links in page.url:

{
"datasetId": "YOUR_DATASET_ID",
"urlField": "page.url",
"renderJs": "never",
"chunkTokens": 800
}

Output example with chunks

A row from a real run of the dummy PDF above in accurate mode with a chunk size of 100 tokens:

{
"url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
"finalUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
"source": "urls",
"sourceType": "pdf",
"mode": "accurate",
"title": null,
"language": null,
"author": "Evangelos Vlachogiannis",
"publishedAt": "2007-02-23T17:56:37+02:00",
"pages": 1,
"pageCount": 1,
"markdown": "## Dummy PDF file\n",
"markdownTruncated": false,
"markdownUrl": null,
"fullResultUrl": null,
"tokenCount": 5,
"chunks": [
{"index": 0, "text": "## Dummy PDF file", "tokenCount": 4, "startPage": 1}
],
"structure": null,
"tablesCount": 0,
"ocrPages": 0,
"renderedWithBrowser": false,
"warnings": [],
"bytes": 13264,
"convertedAt": "2026-11-12T23:36:16Z"
}

The run's key-value store also holds:

  • OUTPUT: counts of converted, failed and skipped sources, why the run stopped (if it stopped early) and the events charged.
  • FAILED: each source that gave no result, with the reason (for example HTTP 404, password-protected PDF, no text: the selected pages are scanned images, blocked: 10.0.0.1 is a private or reserved address) and the number of attempts.
  • Texts above 2 MB: the whole Markdown as a .md record (linked by markdownUrl) and, with chunks or structure, a .json record (linked by fullResultUrl); the row keeps the first 100,000 characters.

Output fields

FieldTypeDescription
urlstringThe source as requested: a web page or document link, or the link of an uploaded file.
finalUrlstringThe address that answered, after all redirects (for uploaded files: the record link).
sourcestringWhere the source came from: urls, files or dataset.
sourceTypestringType read from the file's bytes, not from its name: html, pdf, docx, pptx or xlsx.
modestringHow it was converted: fast, or accurate (PDFs in accurate mode only).
titlestring or nullTitle from the page or document metadata, or from the main heading of a web page.
languagestring or nullLanguage as declared by the page (html lang) or document properties; null when not declared.
authorstring or nullAuthor from the page or document metadata, when present.
publishedAtstring or nullDate from the page or document metadata (ISO 8601); for documents the creation date.
pagesinteger or nullDocuments only: pages (PDF), slides (PPTX), sheets (XLSX) or saved or estimated pages (DOCX) converted and charged. Null for web pages.
pageCountinteger or nullDocuments only: all pages, slides or sheets in the file, also those not converted.
markdownstringThe content as Markdown: headings, paragraphs, lists and tables. Cut to the first 100,000 characters when the text is above 2 MB (see markdownUrl).
markdownTruncatedbooleanTrue when markdown holds only the start of the text; the whole text is at markdownUrl.
markdownUrlstring or nullLink to the whole Markdown in the run's key-value store, when the text is above 2 MB; null otherwise.
fullResultUrlstring or nullLink to a JSON record with the whole Markdown, chunks and structure, when they were too large for the row; null otherwise.
tokenCountintegerTokens in the whole Markdown, counted with the cl100k_base tokenizer.
chunksarray or nullChunks for RAG when chunkTokens is above 0: index, text, tokenCount and startPage (page of the chunk's first text; null for web pages). Null otherwise.
structurearray or nullWhen includeStructure is on: every block in order with its type (heading, paragraph, list, table, code, quote), text, level, page and, for tables, rows of cells. Null otherwise.
tablesCountintegerTables found and kept as Markdown tables.
ocrPagesintegerPages without a text layer read with OCR (accurate mode only).
renderedWithBrowserbooleanTrue when the page was opened in a headless browser to run its JavaScript.
warningsarrayNotes about this source, for example scanned pages skipped in fast mode, pages cut by maxPagesPerDocument, or sheets cut at 500 rows.
bytesintegerSize of the downloaded file or page in bytes.
convertedAtstringTime the source was converted (ISO 8601, UTC).

Fast versus accurate mode

FastAccurate
PDF textText layer (PDFium)Layout model (Docling)
TablesSimple tables: one line per row, columns that line upComplex tables, merged cells, cells over several lines
Multi-column pagesTwo columns detectedAny reading order the layout model finds
Scanned pagesSkipped, listed in warningsOCR in English and Arabic (Tesseract)
Speed (one core)About 0.01 s per pageAbout 4.3 s per page
Price per pagePages beyond 5: 0.50 USD per 1,000Every page: 4.00 USD per 1,000
MemoryDefault 2,048 MB is plentyAt least 3,072 MB; 4,096 MB recommended

Accurate mode applies to PDFs. Word, PowerPoint, Excel and web pages already carry their structure, so they are always converted the fast way and priced as fast documents, also in accurate mode.

Use in RAG pipelines, n8n, Make and MCP clients

  • RAG: set Chunk size (for example 500 tokens with 100 tokens of overlap) and load the chunks of each row into your vector store; startPage and url give the citation for each chunk. Token counts use the cl100k_base tokenizer.
  • n8n and Make: call the Actor with the Apify node or module, then read the dataset items of the run. Schedule a saved task to convert a document folder or a sitemap's pages every day.
  • After a crawler: set Dataset with URLs to the crawler's dataset, or add this Actor as an integration that starts when the crawler's run finishes.
  • AI agents and MCP clients: add the Actor as a tool in Apify's MCP server, give it a URL and read back the Markdown.

Limits

  • No log-in or paywalled pages: a page shows what an anonymous visitor sees. The Actor does not solve captchas or pass bot protection, and it sends an honest user agent.
  • Fast mode reads only the text layer: scanned pages are skipped, and complex PDF layouts (tables with cells over several lines, three or more text columns, text inside images) can still merge or split cells. Use accurate mode for those.
  • Accurate mode is slower and needs more memory: about 4.3 seconds per page on one core (measured), and about 1,600 MB for the models and the pages in progress (pages are converted 8 at a time to keep memory flat). It refuses to start below 3,072 MB of memory; use 4,096 MB. Apify gives one CPU core per 4,096 MB, so more memory also means more speed.
  • OCR quality depends on the scan: short words in table cells of scanned Arabic pages can be misread, and scanned pages are read in English and Arabic only.
  • One document may take at most 120 seconds plus half a second per page in fast mode, and 90 seconds plus 30 seconds per page in accurate mode; a document that takes longer or needs more memory than the run allows is listed in FAILED.
  • Files above Max file size (50 MB by default, at most 200 MB) and web pages above 10 MB are skipped. Up to 10,000 sources per run.
  • Excel sheets are cut at 500 rows below the header row and 200 columns. Images, charts and embedded files inside documents are not described.
  • Password-protected, damaged, empty and legacy-format files fail with a clear reason and are not charged. Files with entity declarations in their XML or extreme compression ratios are refused as unsafe.
  • Word files have no fixed pages: Pages to convert does not apply to them, and their page count is the one Word saved (or one page per 3,000 characters when none was saved).
  • Only public http and https addresses are fetched. Private, loopback and link-local addresses are refused before every request and every redirect, the browser's requests included.
  • Language is the one the page or document declares; it is not guessed from the text.

Libraries and licences

Each type is converted by open-source libraries with licences that allow commercial use: trafilatura (Apache-2.0), lxml (BSD-3-Clause), pypdfium2 and PDFium (Apache-2.0 and BSD-3-Clause), python-docx, python-pptx and openpyxl (MIT), Docling (MIT) with its layout model (Apache-2.0) and TableFormer model (CDLA-Permissive-2.0), PyTorch (BSD-3-Clause), OpenCV (Apache-2.0), Tesseract and its language data (Apache-2.0), tiktoken (MIT), Playwright (Apache-2.0) and Chromium (BSD-3-Clause and others). The full list with versions is in NOTICE.md.

FAQ

Am I charged for failed links? No. A source is charged only after its row is saved. Links that fail, blocked addresses, unsupported or damaged files and documents without text are listed in FAILED and are free.

Why is a PDF table split into odd rows in fast mode? Fast mode reads the text layer line by line, so a cell with two lines of text becomes two rows. Run the document in accurate mode, where the table model rebuilds the cells.

Does it keep Arabic in the right order? Yes. Text is returned in logical (reading) order, shaped letters are turned back into plain letters, and the first column of a right-to-left table is the rightmost one. Accurate mode reads scanned Arabic pages with OCR.

Can it read only some pages? Yes. Set Pages to convert, for example 1-10, 15, for PDF pages, PowerPoint slides and Excel sheets. Only converted pages are charged.

What happens with very long documents? They stop at Max pages per document (200 by default) with a warning. Texts above 2 MB are saved whole in the key-value store and linked from the row.

Are my files safe? Each file is parsed in a separate process with time and memory limits and without access to your Apify token; macros and embedded content are never run. Files stay in your own run storage.

Other Actors by the same author