For Developers

HTML to Markdownbuilt for your workflow

Powerful API, CLI tools, and integrations designed for developers who need reliable HTML to Markdown conversion in their automation pipelines, CI/CD workflows, and applications.

Developer-First Features

🚀

RESTful API

Simple HTTP API with JSON responses. No SDK required - works with any language or framework.

curl -X POST \
  https://api.htmltomarkdown.io/convert \
  -H "Content-Type: application/json" \
  -d '{"html": "<h1>Hello</h1>"}'

Edge Network

Deployed on Cloudflare Workers. <100ms response times from 275+ cities worldwide.

P99 latency: 85ms
🔑

API Key Management

Simple API key authentication. Generate keys instantly, no signup friction.

  • Free tier: 1,000 requests/day
  • Pro tier: Unlimited requests
  • Rate limit headers included
📦

Batch Processing

Convert up to 100 HTML documents in a single API call. Perfect for bulk migrations.

{
  "batch": [
    {"html": "<h1>Doc 1</h1>"},
    {"html": "<h2>Doc 2</h2>"}
  ]
}
🌐

URL Conversion

Point to any public URL and get Markdown back. Great for web scraping and content archival.

{
  "url": "https://example.com/article"
}
🛠️

Customizable Options

Fine-tune output with heading styles, code block fences, list markers, and more.

  • ATX/Setext headings
  • Fenced/indented code blocks
  • Table preservation
  • Link reference styles

Integration Examples

Copy-paste examples to get started in seconds

JavaScript / Node.js

convert.js
// Using fetch (Node 18+ or browser)
async function convertHtmlToMarkdown(html) {
  const response = await fetch('https://api.htmltomarkdown.io/convert', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': 'Bearer YOUR_API_KEY'
    },
    body: JSON.stringify({ html })
  });

  const data = await response.json();
  return data.markdown;
}

// Usage
const markdown = await convertHtmlToMarkdown('<h1>Hello World</h1>');
console.log(markdown); // # Hello World

Python

convert.py
import requests

def convert_html_to_markdown(html: str) -> str:
    response = requests.post(
        'https://api.htmltomarkdown.io/convert',
        headers={
            'Content-Type': 'application/json',
            'Authorization': 'Bearer YOUR_API_KEY'
        },
        json={'html': html}
    )
    response.raise_for_status()
    return response.json()['markdown']

# Usage
markdown = convert_html_to_markdown('<h1>Hello World</h1>')
print(markdown)  # # Hello World

Go

convert.go
package main

import (
    "bytes"
    "encoding/json"
    "net/http"
)

type ConvertRequest struct {
    HTML string `json:"html"`
}

type ConvertResponse struct {
    Markdown string `json:"markdown"`
}

func ConvertHTMLToMarkdown(html string) (string, error) {
    reqBody, _ := json.Marshal(ConvertRequest{HTML: html})

    req, _ := http.NewRequest("POST",
        "https://api.htmltomarkdown.io/convert",
        bytes.NewBuffer(reqBody))

    req.Header.Set("Content-Type", "application/json")
    req.Header.Set("Authorization", "Bearer YOUR_API_KEY")

    client := &http.Client{}
    resp, err := client.Do(req)
    if err != nil {
        return "", err
    }
    defer resp.Body.Close()

    var result ConvertResponse
    json.NewDecoder(resp.Body).Decode(&result)
    return result.Markdown, nil
}

Bash / Shell Script

convert.sh
#!/bin/bash

# Convert HTML file to Markdown
html_content=$(cat input.html)

curl -X POST https://api.htmltomarkdown.io/convert \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d "{\"html\": \"$html_content\"}" \
  | jq -r '.markdown' > output.md

echo "Converted to output.md"

# Or convert a URL directly
curl -X POST https://api.htmltomarkdown.io/convert \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{"url": "https://example.com"}' \
  | jq -r '.markdown' > output.md

Common Developer Use Cases

Documentation Site Generation

Migrate legacy HTML documentation to modern static site generators like Next.js, Hugo, or Jekyll.

Example:

Convert PHP.net docs to Markdown for Docusaurus site

Typical Workflow:

  1. 1Scrape HTML documentation pages
  2. 2Convert to Markdown via API
  3. 3Process frontmatter and metadata
  4. 4Generate static site

Web Scraping & Archival

Extract and archive web content in a portable, future-proof Markdown format.

Example:

Archive blog posts for personal knowledge base

Typical Workflow:

  1. 1Identify target URLs
  2. 2Batch convert via API
  3. 3Store in Git repository
  4. 4Full-text search with tools like ripgrep

Content Migration

Move content from legacy CMSs (WordPress, Drupal) to modern Git-based workflows.

Example:

Migrate 1000+ WordPress posts to Markdown

Typical Workflow:

  1. 1Export HTML from CMS
  2. 2Batch process with API
  3. 3Parse and structure content
  4. 4Import to new system

CI/CD Integration

Automate HTML to Markdown conversion in your deployment pipeline.

Example:

Convert API responses to documentation on every release

Typical Workflow:

  1. 1GitHub Actions trigger on push
  2. 2Generate HTML from API specs
  3. 3Convert to Markdown
  4. 4Deploy to docs site

Email to Markdown

Convert HTML emails to Markdown for archival or note-taking apps.

Example:

Save newsletters to Obsidian vault

Typical Workflow:

  1. 1Fetch email via IMAP
  2. 2Extract HTML body
  3. 3Convert to Markdown
  4. 4Save with metadata

Browser Automation

Use with Playwright/Puppeteer to extract rendered page content as Markdown.

Example:

Extract dynamic SPA content

Typical Workflow:

  1. 1Navigate to page with headless browser
  2. 2Wait for content to load
  3. 3Extract outerHTML
  4. 4Convert to clean Markdown

Start building today

Free tier includes 1,000 requests per day. No credit card required.

<100ms
Response Time
99.9%
Uptime SLA
275+
Global Cities