<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Solution Simplify</title>
    <description>The latest articles on DEV Community by Solution Simplify (@solplify).</description>
    <link>https://dev.to/solplify</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4265949%2Fe16e7d27-60f7-4877-b472-3018e05c50ad.png</url>
      <title>DEV Community: Solution Simplify</title>
      <link>https://dev.to/solplify</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/solplify"/>
    <language>en</language>
    <item>
      <title>HTML to Markdown API: Clean Markdown From Any Web Page</title>
      <dc:creator>Solution Simplify</dc:creator>
      <pubDate>Sat, 28 Nov 2026 17:06:28 +0000</pubDate>
      <link>https://dev.to/solplify/html-to-markdown-api-clean-markdown-from-any-web-page-55e6</link>
      <guid>https://dev.to/solplify/html-to-markdown-api-clean-markdown-from-any-web-page-55e6</guid>
      <description>&lt;p&gt;&lt;em&gt;Disclosure: I work on APIBox, the API used in this guide. The first draft was written with AI assistance; I tested the code and edited it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Markdown has quietly become the exchange format of the AI era. LLMs read it well, it costs far fewer tokens than raw HTML, note apps like Obsidian store it natively, and every static site generator speaks it.&lt;/p&gt;

&lt;p&gt;The web, however, still ships HTML: navigation bars, cookie banners, inline scripts, tracking pixels and a dozen nested &lt;code&gt;&amp;lt;div&amp;gt;&lt;/code&gt;s around three paragraphs of actual content.&lt;/p&gt;

&lt;p&gt;This guide shows how to use the APIBox &lt;code&gt;/v1/html-to-markdown&lt;/code&gt; endpoint to turn HTML strings or live URLs into clean Markdown, and how to wire it into four common jobs: LLM prompts, scrapers, content migration and HTML email.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the endpoint does
&lt;/h2&gt;

&lt;p&gt;You send either an &lt;code&gt;html&lt;/code&gt; string or a public &lt;code&gt;url&lt;/code&gt;. You get back Markdown plus a little metadata:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Clean output.&lt;/strong&gt; &lt;code&gt;script&lt;/code&gt;, &lt;code&gt;style&lt;/code&gt;, &lt;code&gt;iframe&lt;/code&gt;, &lt;code&gt;svg&lt;/code&gt; and &lt;code&gt;canvas&lt;/code&gt; elements are dropped.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub-flavored Markdown.&lt;/strong&gt; Tables, strikethrough and task lists are converted, not flattened.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Absolute links.&lt;/strong&gt; Relative &lt;code&gt;href&lt;/code&gt; and &lt;code&gt;src&lt;/code&gt; values are resolved against the fetched URL or your &lt;code&gt;base_url&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Article mode.&lt;/strong&gt; &lt;code&gt;readability=true&lt;/code&gt; runs Mozilla Readability (the engine behind Firefox Reader View) to keep only the main article and return an &lt;code&gt;excerpt&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Counts.&lt;/strong&gt; &lt;code&gt;words&lt;/code&gt; and &lt;code&gt;characters&lt;/code&gt; let you budget prompt size before you send anything to a model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Style options.&lt;/strong&gt; &lt;code&gt;heading_style&lt;/code&gt; (&lt;code&gt;atx&lt;/code&gt; / &lt;code&gt;setext&lt;/code&gt;), &lt;code&gt;bullet&lt;/code&gt; (&lt;code&gt;-&lt;/code&gt;, &lt;code&gt;*&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;), &lt;code&gt;code_block_style&lt;/code&gt; (&lt;code&gt;fenced&lt;/code&gt; / &lt;code&gt;indented&lt;/code&gt;), &lt;code&gt;link_style&lt;/code&gt; (&lt;code&gt;inlined&lt;/code&gt; / &lt;code&gt;referenced&lt;/code&gt;), &lt;code&gt;keep_links&lt;/code&gt;, &lt;code&gt;keep_images&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Limits worth knowing up front
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;HTML input up to &lt;strong&gt;5 MB&lt;/strong&gt; (request body up to 6 MB).&lt;/li&gt;
&lt;li&gt;URL fetches read up to &lt;strong&gt;5 MB&lt;/strong&gt;, time out after &lt;strong&gt;10 seconds&lt;/strong&gt; and follow at most &lt;strong&gt;8 redirects&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Only &lt;strong&gt;public http/https hosts&lt;/strong&gt;. No localhost, no private IPs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No JavaScript rendering.&lt;/strong&gt; The API fetches the HTML the server returns; it does not run a headless browser. Single-page apps that build their content client-side will come back mostly empty. For those, render the page yourself (Playwright, Puppeteer) and send the resulting HTML.&lt;/li&gt;
&lt;li&gt;It does not bypass logins, paywalls or bot protection. Respect each site's terms and &lt;code&gt;robots.txt&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;Create a free APIBox account (Free plan: 1,000 requests per month, 30 per minute, no card) and generate an API key:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="kd"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;APIBOX_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"your_key_here"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The key can go in &lt;code&gt;Authorization: Bearer&lt;/code&gt;, an &lt;code&gt;x-api-key&lt;/code&gt; header, or an &lt;code&gt;api_key&lt;/code&gt; query parameter. Prefer a header so keys don't end up in logs.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Convert an HTML string (curl)
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://apibox.io.vn/v1/html-to-markdown \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $APIBOX_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{
    "html": "&amp;lt;h1&amp;gt;Getting started&amp;lt;/h1&amp;gt;&amp;lt;p&amp;gt;APIBox turns &amp;lt;strong&amp;gt;HTML&amp;lt;/strong&amp;gt; into clean &amp;lt;a href=\"/docs\"&amp;gt;Markdown&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;ul&amp;gt;&amp;lt;li&amp;gt;Fast&amp;lt;/li&amp;gt;&amp;lt;li&amp;gt;Simple&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;th&amp;gt;Plan&amp;lt;/th&amp;gt;&amp;lt;th&amp;gt;Requests&amp;lt;/th&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Free&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;1,000&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;",
    "base_url": "https://example.com"
  }'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"markdown"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"# Getting started\n\nAPIBox turns **HTML** into clean [Markdown](https://example.com/docs).\n\n-   Fast\n-   Simple\n\n| Plan | Requests |\n| --- | --- |\n| Free | 1,000 |"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"characters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;162&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"words"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;28&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Notice three things: the relative &lt;code&gt;/docs&lt;/code&gt; link became &lt;code&gt;https://example.com/docs&lt;/code&gt; thanks to &lt;code&gt;base_url&lt;/code&gt;, the HTML table became a real Markdown table, and &lt;code&gt;title&lt;/code&gt; is empty because the fragment has no &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; element.&lt;/p&gt;

&lt;p&gt;You can also skip JSON entirely and POST raw HTML with &lt;code&gt;Content-Type: text/html&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://apibox.io.vn/v1/html-to-markdown \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $APIBOX_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: text/html"&lt;/span&gt; \
  --data-binary &lt;span class="s1"&gt;'&amp;lt;h2&amp;gt;Raw&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;Hello &amp;lt;em&amp;gt;world&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"markdown"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="s2"&gt;"## Raw\n\nHello _world_"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"characters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;21&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="nl"&gt;"words"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. Web page → LLM prompt (JavaScript)
&lt;/h2&gt;

&lt;p&gt;Feeding a whole page's HTML to a model wastes tokens on markup and boilerplate. Fetch it as Markdown with &lt;code&gt;readability=true&lt;/code&gt;, check the size, then build the prompt:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="no"&gt;KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="no"&gt;APIBOX_KEY&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;pageAsMarkdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://apibox.io.vn/v1/html-to-markdown'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="n"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'POST'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nc"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sb"&gt;`Bearer ${KEY}`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'Content-Type'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'application/json'&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="n"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;readability&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;keep_images&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;!&lt;/span&gt;&lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ok&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`html-to-markdown ${r.status}: ${await r.text()}`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// { title, markdown, excerpt, words, characters }&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;page&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;pageAsMarkdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'https://en.wikipedia.org/wiki/Markdown'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Rough budget check before calling your model&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;words&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;6000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;warn&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`Long page (${page.words} words) – consider chunking`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;prompt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sb"&gt;`Summarise the article below in 5 bullet points.\n\n# ${page.title}\n\n${page.markdown}`&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;prompt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;slice&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What came back on 2026-11-25 (first lines of the prompt, then the metadata):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Summarise the article below in 5 bullet points.

# Markdown

From Wikipedia, the free encyclopedia

| Markdown |
| --- |
| [](https://en.wikipedia.org/wiki/File:Markdown-mark.svg) |
| [Filename extensions](https://en.wikipedia.org/wiki/Filename_extension "Filename extension") | `.md`, `.markdown`[\[1\]](https://en.wikipedia.org/wiki/Markdown#cite_note-df-2022-1)… (truncated)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"Markdown"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"excerpt"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"From Wikipedia, the free encyclopedia"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"words"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3360&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nl"&gt;"characters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;47587&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;About 47,000 characters for a long encyclopedia article, well under the 6,000-word warning, so it can go to a model in one piece. Two things to notice: Readability kept the infobox as a Markdown table, and &lt;code&gt;keep_images: false&lt;/code&gt; removed the logo image but left an empty &lt;code&gt;[](…)&lt;/code&gt; link where the image had been wrapped in a link. If empty links bother your model, strip &lt;code&gt;[](...)&lt;/code&gt; with a one-line regex.&lt;/p&gt;

&lt;p&gt;Why these options:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;readability: true&lt;/code&gt; strips nav, footers and sidebars, which are pure noise for a summariser.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;keep_images: false&lt;/code&gt; drops image syntax the model can't see anyway.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;words&lt;/code&gt; lets you decide whether to chunk &lt;em&gt;before&lt;/em&gt; you pay for tokens.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you are building retrieval (RAG), split on Markdown headings: &lt;code&gt;##&lt;/code&gt; sections make natural chunks that keep context together.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Lightweight scraper output (Python)
&lt;/h2&gt;

&lt;p&gt;Many scrapers end with a messy "extract text" step. Markdown keeps structure (headings, lists, tables, links) that plain text loses, while staying easy to diff and store:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;

&lt;span class="no"&gt;KEY&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;os&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;environ&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"APIBOX_KEY"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;to_markdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="s2"&gt;"https://apibox.io.vn/v1/html-to-markdown"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;json&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"url"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"readability"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;True&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"link_style"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"referenced"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;headers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s2"&gt;"Authorization"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="s2"&gt;"Bearer {KEY}"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="n"&gt;timeout&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;raise_for_status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="n"&gt;doc&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;to_markdown&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"https://keepachangelog.com/en/1.1.0/"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;with&lt;/span&gt; &lt;span class="nb"&gt;open&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"changelog.md"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"w"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;encoding&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"utf-8"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;write&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"markdown"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;doc&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;"words"&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s2"&gt;"words saved"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1142 words saved
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And the start and end of &lt;code&gt;changelog.md&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight markdown"&gt;&lt;code&gt;&lt;span class="gu"&gt;### [][1]What is a changelog?
&lt;/span&gt;
A changelog is a file which contains a curated, chronologically ordered list of notable changes for each version of a project.

&lt;span class="gu"&gt;### [][2]Why keep a changelog?
&lt;/span&gt;… (truncated)



&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;[][1]&lt;/code&gt; before each heading is the page's own empty anchor link (&lt;code&gt;&amp;lt;a href="#what"&amp;gt;&lt;/code&gt;), kept as a reference.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;link_style: "referenced"&lt;/code&gt; moves URLs to the bottom as &lt;code&gt;[1]: https://...&lt;/code&gt; references, which keeps long documents readable and makes link changes easy to spot in a git diff.&lt;/p&gt;

&lt;p&gt;Stay on the Free plan's 30 requests/minute by adding a short sleep between URLs, and store results so you don't re-fetch unchanged pages.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Migrating a blog or CMS to Markdown
&lt;/h2&gt;

&lt;p&gt;Moving from WordPress or a legacy CMS to a static site generator usually means exporting HTML bodies from a database. Send each body with &lt;code&gt;base_url&lt;/code&gt; set to the old site so images and internal links stay absolute:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl -s https://apibox.io.vn/v1/html-to-markdown \
  -H &lt;span class="s2"&gt;"Authorization: Bearer $APIBOX_KEY"&lt;/span&gt; \
  -H &lt;span class="s2"&gt;"Content-Type: application/json"&lt;/span&gt; \
  -d &lt;span class="s1"&gt;'{"html": "&amp;lt;p&amp;gt;See &amp;lt;a href=\"/2019/05/old-post\"&amp;gt;my old post&amp;lt;/a&amp;gt;.&amp;lt;/p&amp;gt;&amp;lt;img src=\"/wp-content/uploads/a.png\"&amp;gt;", "base_url": "https://old-blog.example", "heading_style": "atx", "bullet": "-"}'&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight json"&gt;&lt;code&gt;&lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;"title"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;""&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"markdown"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;"See [my old post](https://old-blog.example/2019/05/old-post).\n\n![](https://old-blog.example/wp-content/uploads/a.png)"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"characters"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;117&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;"words"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Both the link and the image now point at the old domain. Keep it that way while migrating, then search-and-replace the domain once the new site is up. Notice also that the empty &lt;code&gt;alt&lt;/code&gt; on the image gave &lt;code&gt;![]&lt;/code&gt;. That is a good moment to fill in missing alt text.&lt;/p&gt;

&lt;p&gt;Pin &lt;code&gt;heading_style&lt;/code&gt;, &lt;code&gt;bullet&lt;/code&gt; and &lt;code&gt;code_block_style&lt;/code&gt; explicitly so every converted file follows the same style, then run your usual Markdown linter once over the output.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. HTML email and rich-text editors
&lt;/h2&gt;

&lt;p&gt;The same endpoint works for HTML produced by email clients and WYSIWYG editors. A common pattern: store user content as Markdown (easy to diff, search and render anywhere), and convert editor output on save. Pair it with the companion &lt;code&gt;/v1/markdown-to-html&lt;/code&gt; endpoint, which sanitises output by default, when you need to render it back.&lt;/p&gt;

&lt;h2&gt;
  
  
  Build it yourself or call an API?
&lt;/h2&gt;

&lt;p&gt;Converting HTML to Markdown is a solved problem in most languages: Turndown in JavaScript, markdownify or html2text in Python, and full open-source services you can self-host. If you already run a Node or Python backend and only convert HTML you control, a library is the simplest choice.&lt;/p&gt;

&lt;p&gt;An API makes more sense when:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You also need &lt;strong&gt;fetching&lt;/strong&gt; (redirects, size limits, timeouts, private-IP blocking) and &lt;strong&gt;article extraction&lt;/strong&gt;, not just conversion.&lt;/li&gt;
&lt;li&gt;You call it from an environment where adding dependencies is awkward: edge functions, no-code tools, shell scripts, low-code automations.&lt;/li&gt;
&lt;li&gt;You want the same output from several codebases in different languages.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are other hosted HTML-to-Markdown services too; pick the one whose limits and pricing fit your workload.&lt;/p&gt;

&lt;h2&gt;
  
  
  FAQ
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Can I convert a page by URL instead of pasting HTML?&lt;/strong&gt;&lt;br&gt;
Yes. Send &lt;code&gt;url&lt;/code&gt; instead of &lt;code&gt;html&lt;/code&gt;. If both are present, &lt;code&gt;url&lt;/code&gt; wins (we checked: sending &lt;code&gt;html: "&amp;lt;p&amp;gt;X&amp;lt;/p&amp;gt;"&lt;/code&gt; together with &lt;code&gt;url: "https://example.com"&lt;/code&gt; returned the Example Domain text).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Are HTML tables converted?&lt;/strong&gt;&lt;br&gt;
Yes. Tables, strikethrough and task lists follow GitHub-flavored Markdown rules.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How do I remove links or images?&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;keep_links=false&lt;/code&gt; keeps only the link text; &lt;code&gt;keep_images=false&lt;/code&gt; drops &lt;code&gt;img&lt;/code&gt;, &lt;code&gt;picture&lt;/code&gt; and &lt;code&gt;figure&lt;/code&gt; elements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Does it render JavaScript?&lt;/strong&gt;&lt;br&gt;
No. It converts the HTML the server returns. Render client-side apps yourself first, then send the HTML.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Is there a request size limit?&lt;/strong&gt;&lt;br&gt;
HTML up to 5 MB, request body up to 6 MB, and fetched pages are read up to 5 MB.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;p&gt;Free plan: 1,000 requests per month, no credit card.&lt;/p&gt;

&lt;p&gt;Full parameter reference: &lt;a href="https://apibox.io.vn/docs/html-to-markdown/?utm_source=devto&amp;amp;utm_medium=community&amp;amp;utm_campaign=html-to-markdown-api" rel="noopener noreferrer"&gt;HTML to Markdown API docs&lt;/a&gt;. Try it without code: &lt;a href="https://apibox.io.vn/tools/html-to-markdown/?utm_source=devto&amp;amp;utm_medium=community&amp;amp;utm_campaign=html-to-markdown-api" rel="noopener noreferrer"&gt;online HTML to Markdown converter&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>api</category>
      <category>markdown</category>
      <category>llm</category>
      <category>webdev</category>
    </item>
  </channel>
</rss>
