
HTML to Markdown Converter API
Content
Free HTML to Markdown converter with full formatting control. Transform web content for blogs, documentation, and more.
Authentication
All API requests require a valid API key passed in the Authorization header as a Bearer token.
Rate Limit
100 requests per minute
Endpoints
1 endpoint available
Overview
The HTML to Markdown Converter API transforms HTML content into clean Markdown with extensive formatting options using the Turndown library.
Features
- Convert HTML to clean, readable Markdown
- Configurable heading styles (ATX or Setext)
- Customizable list markers, code block styles, and delimiters
- Control link formatting (inline or referenced)
Use Cases
- Migrate web content to Markdown-based CMS platforms
- Convert HTML documentation for GitHub repositories
- Extract content from web pages in portable format
- Integrate HTML-to-Markdown conversion in content pipelines
Endpoints
POST
/v1/tools/html-to-markdownConvert HTML content to Markdown
Request Body
Content-Type: application/json
| Parameter | Type | Required | Description |
|---|---|---|---|
| html | string | Required | The HTML content to convert |
| options | object | Optional | Conversion options |
| options.headingStyle | string | Optional | Heading format: "setext" (default, underline style) or "atx" (# style) |
| options.hr | string | Optional | Horizontal rule string (default: "* * *") |
| options.bulletListMarker | string | Optional | List marker: "*" (default), "-", or "+" |
| options.codeBlockStyle | string | Optional | Code block style: "indented" (default) or "fenced" |
| options.fence | string | Optional | Fence style: "```" (default) or "~~~" |
| options.emDelimiter | string | Optional | Emphasis delimiter: "_" (default) or "*" |
| options.strongDelimiter | string | Optional | Strong delimiter: "**" (default) or "__" |
| options.linkStyle | string | Optional | Link style: "inlined" (default) or "referenced" |
| options.linkReferenceStyle | string | Optional | Reference style: "full" (default), "collapsed", or "shortcut" |
Response Example
{
"success": true,
"data": {
"markdown": "# Hello World\n\nThis is **bold** and _italic_ text.\n\n* List item 1\n* List item 2\n\n[Link](https://example.com)",
"inputLength": 156,
"outputLength": 98
}
}Error Codes
400
Bad Request - Missing HTML content401
Unauthorized - Invalid or missing API key429
Too Many Requests - Rate limit exceeded500
Internal Server ErrorCode Examples
curl -X POST https://api.opentools.ca/v1/tools/html-to-markdown \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Hello World</h1><p>This is <strong>bold</strong> and <em>italic</em> text.</p><ul><li>List item 1</li><li>List item 2</li></ul>",
"options": {
"headingStyle": "atx",
"bulletListMarker": "-",
"codeBlockStyle": "fenced"
}
}'