Document to Markdown API
One HTTP call turns PDFs, Office files, web pages, e-mails and scans into LLM-ready Markdown, with RAG chunks and exact token counts. Built for AI apps, RAG pipelines, agents and automations.
- 30+ formats
- RAG chunks
- Token counts
- OCR in 11 languages
- MCP server
- Free plan
Quick start
Subscribe to the free plan on RapidAPI, copy your key, and send a file:
curl -X POST "https://anytomarkdown-pdf-to-markdown-and-document-parser-api.p.rapidapi.com/v1/convert/raw?includeChunks=true" \
-H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
-H "X-RapidAPI-Host: anytomarkdown-pdf-to-markdown-and-document-parser-api.p.rapidapi.com" \
-F "file=@report.pdf" Or from JavaScript:
const form = new FormData();
form.append("file", fileInput.files[0]);
const res = await fetch("https://anytomarkdown-pdf-to-markdown-and-document-parser-api.p.rapidapi.com/v1/convert/raw", {
method: "POST",
headers: { "X-RapidAPI-Key": process.env.RAPIDAPI_KEY, "X-RapidAPI-Host": "anytomarkdown-pdf-to-markdown-and-document-parser-api.p.rapidapi.com" },
body: form,
});
const markdown = await res.text();Response
/v1/convert returns JSON. Chunks follow the document's sections, never cut through a table, and carry their heading path and page numbers for citations.
{
"success": true,
"metadata": { "title": "Employee Handbook", "author": "HR Team", "pageCount": 3 },
"content": "# Employee Handbook\n\n## 1. Introduction\n\n...",
"chunks": [
{ "index": 0, "content": "...", "tokens": 498,
"headings": ["Employee Handbook", "1. Introduction"], "pageStart": 1, "pageEnd": 1 }
],
"stats": { "words": 423, "tokens": 537, "tokenizer": "o200k_base", "pagesProcessed": 3, "ocrPages": 0 },
"warnings": []
}Endpoints
| Endpoint | What it does |
|---|---|
POST /v1/convert | Convert an uploaded file, raw bytes, base64 or a URL. JSON with Markdown, metadata, stats, and optional pages and chunks. |
GET /v1/convert?url= | Convert a web page or an online document. |
POST /v1/convert/raw | Same inputs; the response body is the Markdown itself. Stats come back in X- headers. |
POST /v1/chunk | Split your own Markdown or text into heading-aware RAG chunks. |
POST /v1/tokens | Count tokens with o200k_base or cl100k_base. |
GET /v1/formats | Supported formats, OCR languages and your plan's limits. |
POST /mcp | MCP server for AI agents. |
Useful options
Every option works as a query parameter, form field or JSON property. The interactive API reference lists all of them.
| Option | What it does |
|---|---|
url | Public URL of a page or document |
pages | Page selection such as 1-5,8,10- (also slides, sheets and archive entries) |
ocr | auto, force or off; ocrLanguages takes codes like eng+deu |
mainContentOnly | Keep only the main article of a web page (default for URLs) |
includeChunks | Return RAG chunks; tune with chunkSize (default 512 tokens) and chunkOverlap |
includePages | Return the content page by page |
outputFormat | markdown or text |
tokenizer | o200k_base (default) or cl100k_base |
password | For encrypted PDFs and spreadsheets |
What you can build
RAG pipelines
Index PDFs, Word files and web pages as structured chunks with page numbers for citations.
Chat with documents
Give an LLM the Markdown of an uploaded file instead of broken copy-pasted text.
AI agents
Let agents read any link or attachment through the MCP server.
No-code automations
Turn e-mail attachments into text in n8n, Make or Zapier with one HTTP step.
Docs migration
Move Word and Confluence exports into Markdown-based docs and wikis.
Search indexing
Extract clean text and metadata from mixed document collections.
Pricing
Monthly plans through RapidAPI. Start free and upgrade when you need more; cancel any time.
Basic
- 1,000 conversions / month
- Files up to 10 MB
- 50 pages per file
- OCR on 5 pages per file
- All formats, chunks and token counts
Pro
- 5,000 conversions / month
- Files up to 25 MB
- 500 pages per file
- OCR on 50 pages per file
- All formats, chunks and token counts
- 5 requests/s
Ultra
- 25,000 conversions / month
- Files up to 50 MB
- 2,000 pages per file
- OCR on 200 pages per file
- All formats, chunks and token counts
- 10 requests/s
Mega
- 100,000 conversions / month
- Files up to 100 MB via URL
- 5,000 pages per file
- OCR on 500 pages per file
- All formats, chunks and token counts
- 20 requests/s
Frequently asked questions
How do I convert a PDF to Markdown with an API?
Send the file as multipart form data to POST /v1/convert/raw; the response body is the Markdown. Use /v1/convert for JSON with metadata, pages and chunks.
How do I get an API key?
Subscribe to the free Basic plan on RapidAPI. Your key works immediately.
Can I use it in n8n, Make or Zapier?
Yes. Send the file as a binary body to /v1/convert/raw?fileName=report.pdf and use the response text in the next step. See the n8n guide.
Are files stored?
No. Files are processed in memory (and in short-lived temporary folders for OCR) and never stored or used for training.
What happens when I exceed my quota?
Paid plans continue with a small per-conversion overage fee; the free plan stops at its limit. Errors (HTTP 500 and above) do not count against your quota.
Is there an SLA or a self-hosted version?
For custom volumes, private plans or on-premise deployment, write to kupatadze2000@outlook.com.