Document to Markdown
Give your agent PDF and Office files as markdown
Document to Markdown is an API that returns PDF, Word, PowerPoint and Excel files as markdown, for $0.01 per document. Send the URLs of PDF, Word, PowerPoint or Excel files and get each one back as clean markdown, one item per document. For agents and RAG pipelines that need the text, not the file.
$0.01 per document delivered. Failed documents are not charged.
{
"url": "https://example.com/annual-report.docx",
"type": "docx",
"title": "Annual Report",
"markdown": "# Annual Report\n\n...",
"truncated": false
}Values shortened. type is pdf, docx, pptx or xlsx; title is the document’s own title, or null. truncated is true when the markdown passed 500,000 characters and was cut.
Use cases
Let an agent read a document link
One tool call turns the URL of a report, a manual or a deck into text the agent can quote and answer from.
Feed a RAG pipeline
Word and PowerPoint files keep their headings, lists and tables as markdown, and Excel sheets become tables, ready to split and embed.
Turn a batch of files into text
Send up to 50 URLs in a run and get one item per document; a repeated URL is read once. Documents run one at a time, so a run of 50 large ones can reach its time limit and charges only what it delivered.
Input and output
{
"urls": [
"https://www.rfc-editor.org/rfc/rfc9309.pdf",
"https://example.com/annual-report.docx"
]
}urls takes 1 to 50 URLs of PDF, DOCX, PPTX or XLSX files. Public URLs only: there are no file uploads.
{
"url": "https://example.com/photo.png",
"error": "This URL is not a PDF, DOCX, PPTX or XLSX document. Nothing was charged for it."
}Too big, not a document, scanned, damaged or blocked by robots.txt: the item says why.
Pricing
$0.01 per document
Pay per event on Apify, no subscription: one document event per document delivered as markdown. Documents that fail, are too big, are not PDF, DOCX, PPTX or XLSX files, have no text or are blocked by robots.txt are not charged, and a run never charges more than the maximum you set. AI agents can pay for each run on their own, per request, via x402.
Limits
- 1 to 50 URLs per run; a repeated URL is read once.
- Up to 10 MB per document, 30 s per download attempt (a download that runs out of time, cannot connect or gets a server error is tried once more) and 120 s to convert it.
- Markdown longer than 500,000 characters is cut, marked
truncatedand still charged. - Word and PowerPoint keep headings, lists and tables, and Excel sheets become tables; PDFs come back as plain text, page by page, without tables. No OCR: scanned PDFs have no text and are not charged.
- Respects robots.txt for
FrameskimFetch, for every document and every redirect.
Use it by API or from Claude
curl -X POST "https://api.apify.com/v2/acts/emttn~document-markdown/run-sync-get-dataset-items" \
-H "Authorization: Bearer $APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"urls": ["https://www.rfc-editor.org/rfc/rfc9309.pdf"]}'{ "mcpServers": { "apify": {
"url": "https://mcp.apify.com/?actors=emttn/document-markdown"
} } }Then ask: "Read https://www.rfc-editor.org/rfc/rfc9309.pdf and summarize it."
FAQ
What is charged and what is not?
One document event per document delivered as markdown. A document that fails, is larger than 10 MB, is not a PDF, DOCX, PPTX or XLSX file, has no text or is blocked by robots.txt is not charged. What was delivered stays charged if the run later stops or fails, and the run never charges more than the maximum you set.
Which files work, and what comes back?
PDF, Word (DOCX), PowerPoint (PPTX) and Excel (XLSX) files, recognized by their content type or, when the server does not say, by their extension. Word and PowerPoint files keep headings, lists and tables as markdown, and Excel sheets become tables. PDFs come back as plain text, page by page, without tables; a PDF’s title is the one in its metadata, or null.
What about large, slow or scanned documents?
Each document can be up to 10 MB, with 30 s per download attempt and 120 s to convert it. A download that runs out of time, cannot connect or gets a server error is tried once more on a new connection; if that fails too, or the document passes any of these limits, it fails and is not charged, and a partial download is never converted. There is no OCR, so scanned PDFs have no text and are not charged. Documents run one at a time, so a run of 50 large ones can reach its time limit: the documents done by then are delivered and charged, and the run’s message says why it stopped.
How are the documents read?
Only public URLs, fetched over HTTP with the user agent FrameskimFetch; there are no file uploads. robots.txt is respected for FrameskimFetch and for *, for every document and every redirect.
How can a site keep its documents out?
Disallow FrameskimFetch in your robots.txt. Each run reads a host’s robots.txt once, so a run already in progress may not see the change; runs that start after it read the new file. Rights holders and people whose personal data appears in a document can also write to [email protected] about a document this actor fetched; each request gets an answer that says what can be done. Neither a robots.txt rule nor a request removes documents from datasets that users already hold.