Questions & answers
Everything people ask about converting Markdown to PDF with this API — the endpoint, the limits, and what does and does not render.
How do I convert Markdown to PDF with an API?
Send a POST request to https://md2pdf-api-service-git-501785607868.europe-west1.run.app/convert with your Markdown as the raw request body and an "x-api-key" header. The response is the PDF itself, with Content-Type application/pdf. In curl: curl -X POST "https://md2pdf-api-service-git-501785607868.europe-west1.run.app/convert" -H "x-api-key: YOUR_API_KEY" --data-binary @doc.md -o doc.pdf
Is the Markdown to PDF API free?
Yes. MD to PDF is free with no payment and no credit card. You get an API key by entering an email address on the landing page, and the key works immediately.
Does it render Mermaid diagrams in the PDF?
Yes, natively. Any ```mermaid fenced code block is rendered to a real diagram through headless Chromium before the PDF is produced. No flag is needed — the renderer only pays the Chromium cost when a mermaid block is actually present. Cap the diagram height with the ?mermaid_max_height query parameter; a bare number means millimetres and the default is 70vh.
Does it support LaTeX or KaTeX math?
Yes. Inline math written as $x$ and display math written as $$x$$ are rendered with KaTeX automatically, with no flag and no browser involved. It is a pure JavaScript layout pass, so math costs almost nothing per request.
How do I get an API key?
Enter your email address on the landing page and the key is issued instantly. There is no confirmation email and no password. The endpoint is idempotent, so submitting the same address again returns the same key rather than creating a second one.
What are the rate limits and size limits?
Each API key is limited to 5 requests per minute on a sliding window, 10 MB of Markdown per request, and a 60 second render timeout. Exceeding the rate limit returns 429 with a Retry-After header giving the seconds until the window frees up.
Do I send the Markdown as JSON?
No. The request body is raw UTF-8 Markdown, read verbatim. Do not wrap it in JSON or multipart form data. With curl use --data-binary @file rather than -d, because -d strips the newlines that Markdown depends on.
Are my documents stored on the server?
No. Conversion happens in a temporary directory that is discarded when the request finishes. The PDF is streamed back in the response and nothing about the document is retained.
How is this different from running pandoc yourself?
It is the same engine — pandoc plus WeasyPrint — with the parts that are painful to set up already solved: a headless Chromium pipeline for Mermaid, a KaTeX pass for math, a print stylesheet tuned for A4 page breaks, and the specific Mermaid configuration (htmlLabels disabled) without which SVG labels vanish under WeasyPrint. You get that over HTTP instead of maintaining a container of your own.
Which Markdown file extensions are accepted?
The API reads the request body directly, so the extension is irrelevant to it. The in-browser demo on the landing page accepts .md, .markdown, .mdown and .mkd.
Why do emoji not appear in my PDF?
Emoji are omitted by design. The renderer ships no emoji font, because including one broke number rendering under WeasyPrint. Text, code, CJK characters and Mermaid diagrams all render correctly.
Why was my first request slow?
The converter scales to zero when idle, so the first request after a quiet period pays a cold start of a few seconds. Set a generous client timeout — 120 seconds is a safe value — and subsequent requests are fast.
Full endpoint reference, error codes and code samples are in the API documentation.