Turn a web page into LLM-ready Markdown

Fetch a page with curl, convert the HTML to Markdown with the mdkit API — a two-line pipeline for feeding web content to an LLM.

Last updated

mdkit deliberately does not fetch URLs for you — you stay in control of what gets fetched, with your own client, headers and cookies. The pipeline is two commands: fetch the page, then convert the HTML.

curl

curl -s https://example.com/article -o article.html
curl -F "file=@article.html;type=text/html" https://api.mdkit.online/v1/convert

Or in one pipe, uploading from stdin:

curl -s https://example.com/article | \
  curl -F "file=@-;type=text/html;filename=article.html" https://api.mdkit.online/v1/convert

Python

import httpx

html = httpx.get("https://example.com/article").text
resp = httpx.post(
    "https://api.mdkit.online/v1/convert",
    files={"file": ("article.html", html.encode(), "text/html")},
)
print(resp.json()["markdown"])

Try it

Try it free — or paste the page source into the free HTML→Markdown tool.

FAQ

Can mdkit fetch a URL for me?
No. mdkit converts files you upload; it does not crawl or fetch. Fetch the page yourself and POST the HTML, or use a reader/crawler API such as Jina Reader or Firecrawl when fetching is the actual job.
What is the best way to get a web page into an LLM prompt?
Fetch the HTML, POST it to /v1/convert, and prompt with the Markdown. Markdown costs far fewer tokens than raw HTML and carries the heading structure a model can navigate.
Why not just send the raw HTML to the model?
Tags, scripts and inline styles can dominate the token count while adding no meaning, and they push the actual content further from the model's attention.