Langsung ke konten
POST AI agent ready /v1/html-to-markdown

HTML to Markdown API - Convert HTML to Clean Markdown

Converts common HTML elements to Markdown: h1-h6 → # through ######, <pre><code> → fenced code blocks, <ul>/<ol> → bullet/numbered lists, <a> → [text](url), <img> → ![alt](src), <strong>/<b> → **bold**, <em>/<i> → *italic*, <blockquote> → > quote, <hr> → ---. HTML entities are decoded.

Parameters

stringrequired

HTML source to convert.

Code examples

curl -X POST https://api.botoi.com/v1/html-to-markdown \
  -H "Content-Type: application/json" \
  -d '{"html":"<h1>Hello</h1><p>Visit <a href=\"https://github.com\">GitHub</a>.</p>"}'

When to use this API

Migrate content from CMS exports to Markdown

WordPress and Ghost exports give you HTML posts. Convert each post to Markdown so you can commit them to a Git-based site (Astro, Hugo, Next.js) without manual rewrites.

Email to newsletter pipeline

Transactional email services often return HTML versions of your newsletters. Convert to Markdown to publish the same content on your blog without formatting drift.

Save HTML responses as notes

When scraping articles with /v1/url-metadata or a headless browser, convert the extracted content to Markdown for storage. Markdown is smaller, grep-able, and plays well with AI workflows.

Frequently asked questions

What HTML elements are supported?
Headings (h1-h6), paragraphs (<p>), line breaks (<br>), horizontal rules (<hr>), lists (<ul>/<ol>/<li>), blockquotes (<blockquote>), links (<a>), images (<img>), inline code (<code>), code blocks (<pre><code>), bold (<strong>/<b>), and italic (<em>/<i>). Other tags are stripped but their text is preserved.
Does it handle tables?
Tables are stripped to inline text. GitHub-Flavored Markdown tables are not emitted. If you need table fidelity, pre-process HTML tables separately before conversion.
How are nested lists handled?
Nested lists flatten to a single level. The inner list items appear alongside outer ones. Full nesting support is a planned enhancement.
Are HTML entities preserved?
No. Entities (&amp;, &lt;, &gt;, &quot;, &nbsp;) are decoded to their literal characters. Numeric entities (&#39;) and common named entities are all handled.
What about scripts and styles?
<script> and <style> tags and their content are stripped along with every other unsupported tag. Text inside them is lost; that is intentional since it is not readable content.

Get your API key

Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.