Getting started
Markdown API quickstart
Make your first authenticated Markdown Viewer API call in under a minute. This guide walks you through creating a key, sending a request, and reading the response — with copy-paste snippets for curl, JavaScript, TypeScript, and Python.
No SDK to install. No webhooks to configure. Just HTTPS, JSON, and a Bearer token.
Create an API key
Sign in to your account and head to the API Keys page. Click “New key”, give it a label that identifies the environment (eg. production-web), and copy the secret. We only display the full key once — store it in your secrets manager or environment variables right away.
Production keys look like mdv_live_…. They're hashed on our side with a salted SHA-256, so we can't recover the raw value after creation — keep them safe.
Send your first request
Authenticate every request with the Authorization header and pass the markdown in the JSON body. Pick your language:
curl -X POST 'https://trymarkdownviewer.com/api/v1/render' \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markdown":"# Hello world\n\nWelcome to **Markdown Viewer**."}'Replace YOUR_API_KEY with the value you copied in step 1. In production, read it from process.env or your secrets manager — never hard-code it.
Read the response
Successful responses are always wrapped in a data field:
{
"data": {
"html": "<h1 id=\"hello\">Hello</h1>\n<p>Welcome to <strong>Markdown Viewer</strong>.</p>",
"characters": 78
}
}Errors use the same shape with an error field instead:
{
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}The code field is stable — switch on it in your code. See the full error reference for every code and how to recover.
What to explore next
- POST
/api/v1/renderRender markdown
Convert markdown into safe, sanitised HTML.
- POST
/api/v1/formatFormat markdown
Beautify and normalise a markdown document.
- POST
/api/v1/analyzeAnalyze markdown
Word count, reading time, links, images, structure.
- POST
/api/v1/validateValidate markdown
Lint markdown for common issues.
- POST
/api/v1/convert/html-to-markdownHTML → Markdown
Convert any HTML snippet into clean CommonMark + GFM.
- POST
/api/v1/convert/markdown-to-textMarkdown → Plain text
Strip markdown formatting and return prose.
- POST
/api/v1/convert/csv-to-tableCSV → Markdown table
Convert CSV (or TSV) to a GFM pipe table.
- POST
/api/v1/convert/table-to-csvMarkdown table → CSV
Extract the first GFM table to CSV/TSV.
- POST
/api/v1/convert/json-to-markdownJSON → Markdown
Render JSON as a table or nested list.
- POST
/api/v1/extract/outlineExtract outline
Headings with level, slug, and line number.
- POST
/api/v1/extract/linksExtract links
Every link with kind + status.
- POST
/api/v1/extract/imagesExtract images
Image audit with alt text and source classification.
- POST
/api/v1/extract/code-blocksExtract code blocks
Fenced code with language and suggested filename.
- POST
/api/v1/extract/tasksExtract tasks
Task-list items with section + progress.
- POST
/api/v1/extract/urlsExtract URLs
Deduped URL list with frequency.
- POST
/api/v1/extract/frontmatterExtract frontmatter
Parse YAML frontmatter + body.
- POST
/api/v1/generate/tocGenerate table of contents
Markdown TOC from headings.
- POST
/api/v1/generate/slugsGenerate slugs
Slugify a list of heading titles.
- POST
/api/v1/audit/headingsAudit headings
Skipped levels + duplicate H1 detection.
- POST
/api/v1/audit/gfmAudit GFM compliance
Single H1, fence langs, link/image hygiene.
- POST
/api/v1/audit/readme-scoreREADME health score
0–100 score across 5 weighted sections.
- POST
/api/v1/transform/typographyTypography transforms
Smart quotes, em-dashes, ellipsis, NBSP.
- POST
/api/v1/transform/redactRedact secrets
Strip emails, IPs, tokens, keys, JWTs, UUIDs.
- POST
/api/v1/transform/normalize-listsNormalize list markers
Rewrite `*` / `+` bullets to `-`.
- POST
/api/v1/transform/calloutBuild a callout / admonition
GitHub, Docusaurus, MkDocs, Obsidian flavours.
- POST
/api/v1/diffDiff markdown
Line-oriented added / removed / unchanged.
- POST
/api/v1/reading-timeReading time
WPM + image + code-aware estimate.
- POST
/api/v1/split/sectionsSplit into sections
Chunk by every heading or by level.
- Try every endpoint in the playground with your own key.
- Watch your usage on the usage analytics page.
- Implement rate-limit handling with exponential backoff before going to production.
Quickstart FAQ
- No — it's a plain REST API. Anything that speaks HTTPS works: curl, fetch in JavaScript or TypeScript, requests in Python, Go's net/http, Ruby's Net::HTTP, etc. We give you snippets for all the common languages.
- Sign in and open the API Keys page from your dashboard. Click 'New key', give it a label, and copy the secret. The full key is shown exactly once — store it in a secrets manager.
- Yes. The playground at /api/playground lets you call any endpoint with your own key. Errors there link straight back to the matching docs entry.
- Send a POST with Content-Type: application/json, an Authorization: Bearer <YOUR_KEY> header, and a JSON body containing the markdown field. The response is always wrapped in { data: … } on success or { error: { code, message } } on failure.
- Treat API keys like passwords — never embed them in client-side code. For browser use cases, call your own backend which holds the key and forwards requests to the Markdown Viewer API.