Endpoint
Authentication
| Header | Required | Value |
|---|---|---|
X-API-Key | Yes | Your API key (bun_...) |
Content-Type | Yes | application/json |
Overview
Convert Markdown source into sanitized HTML ready for rendering in browsers or email clients. Supports GitHub Flavored Markdown (GFM), tables, task lists, fenced code blocks with syntax highlighting, and strikethrough. Output is sanitized to prevent XSS.Use cases
- Render user-generated Markdown content safely in web apps
- Convert README or documentation files to HTML for display
- Process blog post drafts written in Markdown
- Generate HTML emails from Markdown templates
Details
Parsing follows the CommonMark specification with GFM extensions. HTML in the input is sanitized. Code blocks are wrapped in<pre><code> tags with a language class for CSS-based highlighting.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
markdown | string | Yes | Markdown source text to convert |
Example
Response
200 OK
| Field | Type | Description |
|---|---|---|
html | string | Rendered, sanitized HTML |
word_count | integer | Number of words in the input Markdown source |
reading_time_minutes | integer | Estimated reading time in minutes (minimum 1, based on 200 wpm) |
chars | integer | Character count of the input Markdown source |

