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

Get a free API key API overview

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

EndpointWhat it does
POST /v1/convertConvert 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/rawSame inputs; the response body is the Markdown itself. Stats come back in X- headers.
POST /v1/chunkSplit your own Markdown or text into heading-aware RAG chunks.
POST /v1/tokensCount tokens with o200k_base or cl100k_base.
GET /v1/formatsSupported formats, OCR languages and your plan's limits.
POST /mcpMCP 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.

OptionWhat it does
urlPublic URL of a page or document
pagesPage selection such as 1-5,8,10- (also slides, sheets and archive entries)
ocrauto, force or off; ocrLanguages takes codes like eng+deu
mainContentOnlyKeep only the main article of a web page (default for URLs)
includeChunksReturn RAG chunks; tune with chunkSize (default 512 tokens) and chunkOverlap
includePagesReturn the content page by page
outputFormatmarkdown or text
tokenizero200k_base (default) or cl100k_base
passwordFor 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

$0 free forever
  • 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
Start free

Pro

$9.99 / month
  • 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
Choose Pro

Ultra

$49.99 / month
  • 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
Choose Ultra

Mega

$149.99 / month
  • 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
Choose Mega

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.