Skip to content
Now in public beta

The markdown API for developers

Render markdown to safe HTML, beautify and validate documents, and extract headings, links, and reading time — all behind a fast, predictable REST API. The same engine that powers our editor, with a free tier built for real apps.

100 free requests / day · No credit card required

const res = await fetch("https://trymarkdownviewer.com/api/v1/render", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MDV_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    markdown: "# Hello, world\n\nThis is **markdown** rendered by the API.",
  }),
});

const { data } = await res.json();
console.log(data.html);

Built to stay out of your way

Boring API design done well. Conventions everywhere, surprises nowhere.

Built for speed

Sub-100 ms p95 latency on the core endpoints. Server-rendered, edge-friendly, no cold-start drama.

Safe rendering

Output is sanitised with DOMPurify on every request. No surprise scripts, no inline handlers, no leaks.

Revocable keys

Salted hashes on disk, prefix-only display, one-click revoke or regenerate. Keys never leave your control.

Predictable errors

Stable error codes, structured details, and proper status codes. Wire up retries without guesswork.

Versioned from day one

All routes live under /api/v1/. Breaking changes ship behind /api/v2 — old code keeps working.

Same engine as the editor

Pixel-for-pixel parity with what you see in our editor. Format, validate, render — it's all one library.

How the markdown API works

Three steps from zero to production. No SDKs to install. No webhooks to configure.

  1. 1

    Create an API key

    Sign up for free, head to API Keys in the dashboard, and mint a key in two clicks. Keys are hashed at rest — we never store the raw value.

  2. 2

    Send a request

    POST your markdown to /api/v1/render with a Bearer auth header. No SDK required — every HTTP client works out of the box.

  3. 3

    Ship the response

    Get back sanitised HTML, structured analysis, or lint issues in a stable JSON envelope. Predictable errors, rate-limit headers, and sub-100ms latency on cached payloads.

Drop in. Ship in minutes.

Standard REST. Bearer-token auth. Same call shape across every endpoint — curl, JavaScript, TypeScript, Python, Go, Ruby, anything that speaks HTTP.

Render markdown to HTML

Convert markdown into sanitised HTML — perfect for user-generated content, comments, AI output, and CMS pages.

curl -X POST 'https://trymarkdownviewer.com/api/v1/render' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown": "# Hello\n\nMarkdown with **bold** and a [link](https://example.com)."}'
Same envelope on every endpoint
Success: { data: ... }Error: { error: { code, message } }

What you can build with the markdown API

One small set of endpoints, dozens of real-world uses. Drop the API into any product that touches markdown — comments, docs, dashboards, AI output, CMS pipelines, and more.

Render user-generated markdown

Power comments, docs, wikis, and forum posts with safe HTML rendered server-side from user input. DOMPurify sanitisation built in.

Process AI / LLM output

Convert ChatGPT, Claude, or Gemini responses to clean HTML in your product. Validate the structure before showing it to users.

Build a CMS or knowledge base

Author content in markdown, render to HTML on demand, and extract outlines for table-of-contents and search indexing.

Format inbound markdown

Normalise markdown coming from webhooks, email, support tickets, or third-party APIs before storing it.

Lint markdown in CI

Run the validator on every pull request to catch heading jumps, inconsistent bullets, and missing alt text before merge.

Generate documentation sites

Parse markdown source, extract headings into a TOC, compute reading time, and render to HTML — all from one API.

Markdown for chat apps

Render messages with code blocks, lists, links, and tables. Predictable sub-100ms latency keeps the UI snappy.

Static site generators

Drop the API into your build pipeline to render markdown without bundling a parser. Same engine across every project.

28 endpoints · one engine

Everything markdown. One API.

Render, convert, extract, audit, transform, diff. Built on the same engine that powers our online editor — sanitised output, predictable responses, no surprises.

Metrics

1

Honest reading-time and content statistics.

Why developers pick Markdown Viewer

Most markdown APIs were built as side-projects. We treat ours like a product — the same engine powering our editor runs every API request, with predictable performance, transparent pricing, and a generous free tier.

Built for production

Markdown rendering is sandboxed and sanitised. Rate limits and request quotas protect your quota from runaway loops. Errors come back in a stable JSON shape with codes you can switch on.

Same engine, end-to-end

The rendering, formatting, and validation logic is shared between the public editor and the API — what you see in your browser is exactly what the API returns. No surprises in production.

Honest pricing

Free for hobby projects. Pro is $3/month — or $19/year, saving you over 45%. No hidden per-request fees. No vendor lock-in — the rendering engine is open source.

Developer-first DX

Interactive API playground, copy-paste code samples in curl, JavaScript, TypeScript, and Python, and a clean dashboard with usage charts, rotation, and billing in one place.

Honest, simple pricing

Start free, upgrade when you need more. No seat counts, no usage cliffs hidden in the fine print.

Free

Get started

Free

  • 100 API requests / day
  • All endpoints
  • 1 active API key
Most popular
Pro

For production

$3/mo

or $19/yr — save 47%

  • 10,000 API requests / day
  • Unlimited API keys
  • Usage analytics
  • Priority email support

Frequently asked questions

Everything developers ask before integrating the Markdown Viewer API.

What is the Markdown Viewer API?
A simple, fast REST API for rendering, formatting, analyzing, and validating markdown. Send markdown over HTTPS, get back sanitised HTML or structured data. There's no SDK to install — any HTTP client works.
Is there a free tier?
Yes. The Free plan includes 100 requests per day with full access to every endpoint. Upgrade to Pro for 10,000 requests per day at $3/month — or $19/year, saving you over 45%.
How do I convert markdown to HTML?
POST your markdown to /api/v1/render with an Authorization: Bearer <key> header. You'll get sanitised HTML back in a JSON response: { "data": { "html": "..." } }. The renderer supports CommonMark + GFM (tables, task lists, strikethrough, autolinks).
Is the HTML output safe to render?
Yes. Every response runs through DOMPurify with a conservative allowlist. Inline scripts, event handlers, javascript: URLs, and other XSS vectors are stripped before the HTML leaves our server.
What's the rate limit?
Two layers: every key is burst-limited to 20 requests per 10 seconds, and your plan enforces a daily request quota. Both reset automatically and rate-limit headers tell you exactly how much you have left.
Which markdown flavour is supported?
CommonMark + GitHub Flavored Markdown (GFM) — headings, lists, task lists, tables, fenced code blocks, autolinks, strikethrough, and inline HTML on the allowlist. The same engine powers our editor and the API, so output is identical.
Can I use the API for AI / LLM output?
Absolutely — it's one of the most popular uses. Pipe ChatGPT, Claude, or Gemini responses straight through /api/v1/render to display them safely, or through /api/v1/validate to lint them before storing.
Do you store the markdown I send?
No. Request bodies are processed in memory and discarded as soon as the response is sent. We log a small amount of metadata (endpoint, status, latency, bytes) for billing and abuse prevention — but never your content.
How fast is the API?
Most render requests complete in under 100ms. Analysis and validation are similarly fast for typical documents (<32KiB). The maximum request body is 256 KiB and there's a per-request CPU budget of one second.
Can I cancel my subscription?
Yes. Manage everything from the Stripe billing portal accessible from your dashboard. Cancellation takes effect at the end of the current billing period and you keep Pro access until then.
Is the API open source?
The frontend editor and markdown engine are MIT-licensed and open source. The hosted API platform itself (auth, billing, rate-limiting layer) is closed source, but you can self-host the core engine from the repository.
How do I get support?
Free users can open issues on our GitHub repository. Pro subscribers get priority email support — replies typically within one business day.

Start building with the markdown API

Sign up free, mint an API key, and render your first markdown document in the next 60 seconds. No credit card required.

100 requests/day on the free tier · Upgrade any time · Cancel any time