xtract.bot

HTML to Markdown

Try it interactively →
POST /api/html-to-markdown

Convert HTML to Markdown. Headings, lists, tables, blockquotes, links, and images are preserved; presentational tags collapse cleanly.

Converts an HTML document or fragment to Markdown. The output is CommonMark-compatible with GFM table extensions. Element mappings: - `<h1>`–`<h6>` → ATX-style `#` headings. - `<p>` → paragraphs separated by blank lines. - `<ul>` / `<ol>` → `-` / `1.` lists. - `<table>` → GFM-style pipe tables. - `<a href>`, `<img src>`, `<code>`, `<pre>`, `<blockquote>`, `<strong>`, `<em>` → their Markdown equivalents. Useful for ingesting a web article into a Markdown-based pipeline (note-taking apps, documentation systems, LLM context).

Inputs

NameTypeDefaultDescription
html*stringHTML source.
headingStyleenum (atx | setext)"atx"`atx` (`# H1`) or `setext` (`H1\n===`).
bulletListMarkerenum (* | - | +)"*"Unordered list marker character.
codeBlockStyleenum (fenced | indented)"fenced"Fenced (```) or 4-space indented code blocks.

Response

Modes: json, text. Cache: yes (24h TTL).

Code samples

Built from the article example.


curl -X POST https://api.xtract.bot/api/html-to-markdown \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "X-Account-Id: $XTRACT_ACCOUNT_ID" \
  -H "X-Api-Key: $XTRACT_API_KEY" \
  -d '{
  "html": "<h1>Hello</h1><p>This is <strong>bold</strong> and <em>italic</em>.</p><ul><li>One</li><li>Two</li><li>Three</li></ul>"
}'