Documents to Markdown/JSON for RAG (PDF, Office, OCR) avatar

Documents to Markdown/JSON for RAG (PDF, Office, OCR)

Pricing

from $3.00 / 1,000 document converteds

Go to Apify Store
Documents to Markdown/JSON for RAG (PDF, Office, OCR)

Documents to Markdown/JSON for RAG (PDF, Office, OCR)

Pricing

from $3.00 / 1,000 document converteds

Rating

0.0

(0)

Developer

Bravona

Bravona

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

3 days ago

Last modified

Security

Limited permissions

Share

Documents to Markdown/JSON for RAG converts PDF, Word (DOCX), PowerPoint (PPTX), Excel (XLSX/CSV), HTML pages and images into clean Markdown plus RAG-ready JSON chunks with page references, heading paths and tables. Scanned pages are read with OCR only when a page has no text layer, so digital documents stay fast and cheap.

Give it public document links or files in your own Apify key-value store, and download the results as JSON, CSV or Excel, or feed them straight into a vector database.

What does it do?

  • One output for every format. PDF, DOCX, PPTX, XLSX, XLS, ODS, CSV, HTML, TXT/Markdown, PNG/JPEG/TIFF/WebP/GIF/BMP images.
  • Structure kept. Headings (#, ##…), bullet and numbered lists, bold/italic (DOCX/HTML), and tables as GitHub-flavored Markdown tables.
  • Page references. Every page (PDF page, slide, or 3,000-character block for flowing formats) is numbered, and every chunk says which pages it covers (pageStart, pageEnd).
  • RAG chunks. Heading-aware chunks of a size you choose (default 1,500 characters, 150 overlap). Each chunk carries its headingPath (e.g. ["Part 2", "Deposits"]). Chunks never cut a table row; split tables repeat their header row in every chunk.
  • OCR only where needed. In auto mode only pages without a usable text layer are OCR'd (Tesseract 5, 7 languages). Each OCR'd page reports a confidence score.
  • Speaker notes for slides (optional), every sheet of a workbook, document title and author when the file has them.
  • Error records instead of crashes. A file that is missing, too large, encrypted, unsupported or blocked becomes one error record with a clear errorCode and is not charged.

Who is it for?

AI / RAG builders loading documentation, reports, contracts or manuals into a vector database. Data teams extracting tables and text from public reports and filings. Automation builders who need a single "any document → Markdown" step in a workflow.

Input

FieldWhat it doesDefault
urlsPublic, logged-out document links–
keyValueStoreId / keyValueStoreKeysConvert files you uploaded to your own Apify key-value store (all records if no keys are given; INPUT is skipped)–
ocrModeauto (pages without text only), always (every page), offauto
ocrLanguageeng, deu, fra, spa, ita, por, nld, or combinations like eng+deueng
maxFileSizeMbBigger files are not downloaded (error FILE_TOO_LARGE)25 (max 100)
maxPagesPerDocumentPage cap per document200 (max 1,000)
onPageLimittruncate (convert the first pages) or fail (error TOO_MANY_PAGES, nothing charged)truncate
maxOcrPagesPerDocumentPages past this that need OCR are returned empty and flagged ocrSkipped (not charged)50 (max 500)
maxDocumentsDocuments per run100 (max 2,000)
maxConcurrencyDocuments converted in parallel2 (max 8)
requestTimeoutSecsDownload timeout per file60
includeMarkdown / includePages / includeChunksWhich outputs to includeall on
chunkSize / chunkOverlapChunk size and overlap in characters1,500 / 150
includeSpeakerNotesPPTX speaker notesoff

Example:

{
"urls": [{ "url": "https://www.irs.gov/pub/irs-pdf/fw9.pdf" }],
"chunkSize": 1200,
"chunkOverlap": 120
}

Output

One dataset record per document (status: "ok" or "error"):

FieldDescription
status, sourceIndex, sourceResult and which input it came from ({url} or {keyValueStoreId, key})
finalUrl, fileName, contentType, format, sizeBytes, sha256File facts after redirects; format is detected from the content, not only the extension
title, authorFrom document metadata when present
pageUnitpdf-page, slide, image, or chars-3000 (DOCX, HTML, text, sheets: one page per ~3,000 characters)
pageCountInFile, pagesProcessed, textPages, ocrPages, ocrSkippedPages, truncatedPage accounting
chars, markdownFull document Markdown
pages[]{pageNumber, markdown, chars, ocr, ocrConfidence, ocrSkipped}
chunks[]{chunkIndex, text, chars, pageStart, pageEnd, headingPath}
chunkCount, warnings
billable{document, page, ocrPage} events this document counts for (0 for errors)
fullRecordKey, fullRecordUrlSet when a record is over Apify's 9 MB item limit: the dataset item keeps the metadata, and markdown, pages and chunks are in that record of the run's key-value store
errorCode, errorMessageFor errors: INVALID_URL, BLOCKED_ADDRESS, ROBOTS_DISALLOWED, ROBOTS_UNAVAILABLE, AUTH_REQUIRED, CAPTCHA_OR_BOT_WALL, HTTP_ERROR, NETWORK_ERROR, TIMEOUT, FILE_TOO_LARGE, TOO_MANY_PAGES, UNSUPPORTED_FORMAT, ENCRYPTED_OR_CORRUPT, NO_TEXT, OCR_FAILED, KV_RECORD_NOT_FOUND, CONVERSION_FAILED
processingMs, convertedAt

Dataset views: Overview, Chunks (one row per chunk, ready for embedding) and Errors. A run summary (counts, totals, errors by code, per-document status, events charged) is saved as the OUTPUT record of the run's key-value store.

How fetching works (responsible access)

  • Only public, logged-out URLs. No cookies, no logins, no proxies. Links that need a login (HTTP 401/407, or credentials in the URL) get AUTH_REQUIRED, other refusals such as 403 get HTTP_ERROR; CAPTCHA or bot-check pages get CAPTCHA_OR_BOT_WALL. The Actor never tries to get past them.
  • robots.txt is read for every host and followed (user agent Bravona-DocsToMarkdown, RFC 9309 rules, Crawl-delay honored up to 10 s).
  • At most 1 request per second per host; up to 5 redirects; private, loopback and cloud metadata addresses are refused (BLOCKED_ADDRESS).
  • Only convert documents you have the right to process.

Limits and known gaps

  • Heading detection in PDFs uses font sizes, so heading levels are a best guess; figure labels set in a large font can appear as headings.
  • PDF tables come out as text lines (DOCX, PPTX, XLSX and HTML tables are real Markdown tables).
  • Encrypted/password-protected files are not opened (ENCRYPTED_OR_CORRUPT).
  • OCR quality depends on the scan; low ocrConfidence (below ~80) means the text needs review.
  • Old binary formats (.doc, .ppt) are not supported; .xls is.

Memory

The default is 2 GB. OCR is CPU-bound, and Apify gives CPU in proportion to memory, so 2 GB finishes OCR about twice as fast as 1 GB for the same cost ($0.0156 vs $0.0150 for a 10-page scan; 137 s vs 263 s). Peak memory in tests was 265 MB. The minimum is 512 MB, which is enough for text-only documents. 4 GB is the maximum, and it costs more ($0.0188) without being faster per CPU-second.

Pricing

Pay per event:

EventPrice
Actor Start$0.00005 per run
Document converted (primary)$0.003 per document converted
Page processed$0.0003 per page (PDF page, PPTX slide; for HTML, DOCX, text and spreadsheets, 1 page = 3,000 characters)
OCR page processed$0.006 per OCR page, charged instead of the page price, not in addition to it

Failed documents are not charged. See PRICING.md for details.

Works on Apify's free plan; you pay a tiny start fee plus only for results returned (each converted document and its pages). Charges come out of your Apify account's prepaid usage; on the Free plan, once that monthly usage is used up, runs stop until the next billing cycle.