API Documentation
Integrate HTML to Markdown conversion into your applications with our fast, reliable REST API
Base URL
Production:
https://api.htmltomarkdown.ioStaging:
https://api-staging.htmltomarkdown.ioFast & Reliable
Global edge network with <100ms response time
Secure
Optional API key authentication & rate limiting
No Signup Required
Public endpoints available for immediate use
Health Check
GET
/api/v1/healthCheck API status and availability
Example Request
curl https://api.htmltomarkdown.io/api/v1/healthExample Response
{
"success": true,
"status": "healthy",
"version": "1.0.0",
"timestamp": "2025-11-05T14:51:56.532Z"
}HTML to Markdown
POST
/api/v1/public/convertConvert HTML content to Markdown format
Request Body
{
"html": "<h1>Hello World</h1><p>This is a <strong>test</strong>.</p>",
"options": {
"headingStyle": "atx",
"bulletListMarker": "-",
"codeBlockStyle": "fenced",
"useGFM": true,
"preserveTables": true
}
}Example Request
curl -X POST https://api.htmltomarkdown.io/api/v1/public/convert \
-H "Content-Type: application/json" \
-d '{
"html": "<h1>Hello World</h1><p>Test</p>",
"options": {
"headingStyle": "atx",
"useGFM": true
}
}'Example Response
{
"success": true,
"markdown": "# Hello World\n\nTest",
"requestId": "uuid-here",
"metadata": {
"processingTimeMs": 5,
"inputSizeBytes": 42,
"outputSizeBytes": 18,
"elementsProcessed": 3
}
}URL to Markdown
POST
/api/v1/public/convert-urlFetch and convert HTML from a URL to Markdown
Request Body
{
"url": "https://example.com",
"options": {
"headingStyle": "atx",
"useGFM": true
}
}Example Request
curl -X POST https://api.htmltomarkdown.io/api/v1/public/convert-url \
-H "Content-Type: application/json" \
-d '{"url": "https://example.com"}'Markdown to HTML
POST
/api/v1/public/markdown-to-htmlConvert Markdown content to HTML
Example Request
curl -X POST https://api.htmltomarkdown.io/api/v1/public/markdown-to-html \
-H "Content-Type: application/json" \
-d '{"markdown": "# Hello World"}'Table Extraction
POST
/api/v1/public/convert-tableExtract and convert HTML tables to Markdown format
Example Request
curl -X POST https://api.htmltomarkdown.io/api/v1/public/convert-table \
-H "Content-Type: application/json" \
-d '{"html": "<table><tr><td>Cell 1</td></tr></table>"}'Conversion Options
| Option | Type | Default | Description |
|---|---|---|---|
headingStyle | string | "atx" | Heading style: "atx" (#) or "setext" |
bulletListMarker | string | "-" | List marker: "-", "*", or "+" |
codeBlockStyle | string | "fenced" | Code block style: "fenced" or "indented" |
useGFM | boolean | true | Enable GitHub Flavored Markdown |
preserveTables | boolean | true | Convert HTML tables to Markdown tables |
Error Responses
All errors return a JSON response with the following structure:
{
"success": false,
"error": {
"code": "error_code",
"message": "Human-readable error message"
},
"requestId": "uuid-here"
}Common Error Codes
- •
invalid_request- Invalid request parameters - •
rate_limit_exceeded- Too many requests - •
internal_error- Server error - •
not_found- Endpoint not found
Rate Limits
Public Endpoints
- • 100 requests per minute per IP
- • 5 MB max HTML size
- • No authentication required
Rate Limit Headers
- •
X-RateLimit-Limit - •
X-RateLimit-Remaining - •
X-RateLimit-Reset
Code Examples
JavaScript / Node.js
const response = await fetch('https://api.htmltomarkdown.io/api/v1/public/convert', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
html: '<h1>Hello</h1>',
options: { useGFM: true }
})
});
const result = await response.json();
console.log(result.markdown);Python
import requests
response = requests.post(
'https://api.htmltomarkdown.io/api/v1/public/convert',
json={
'html': '<h1>Hello</h1>',
'options': {'useGFM': True}
}
)
result = response.json()
print(result['markdown'])cURL
curl -X POST https://api.htmltomarkdown.io/api/v1/public/convert \
-H "Content-Type: application/json" \
-d '{"html":"<h1>Hello</h1>","options":{"useGFM":true}}'Need Help?
Questions about the API? Check out our resources or get in touch