URL to Markdown API for LLMs

Send up to 50 public URLs in one POST and get clean, structured Markdown back for prompts, RAG chunks, search indexes, and AI agents.

The short answer

Web2MD is a URL-to-Markdown REST API for LLM input. Send one or many public web page URLs and receive cleaned Markdown with headings, lists, tables, code, links, source metadata, and token counts preserved. Use it before prompting a model, chunking pages for RAG, building a search index, or giving an AI agent web context.

How should I choose a URL-to-Markdown API for RAG?

Choose by testing the pages your RAG system will actually index, not by comparing a feature checklist. A useful API should preserve document structure, return source metadata, expose failures per URL, and make its limits clear. If your corpus includes authenticated or browser-only pages, pair the API with a browser-side path instead of assuming a remote fetcher can see them.

CheckWhat to verify on your own corpus
Extraction qualityHeadings, tables, code, links, and reading order survive while navigation and cookie noise disappear.
Retrieval coveragePublic, JavaScript-rendered, blocked, and authenticated pages have an explicit supported path or an honest failure.
RAG provenanceEach result keeps its source URL and useful metadata so generated answers can be traced and cited.
Batch reliabilityOne slow or failed URL does not hide the status of the rest, and retries do not duplicate successful work.
Context efficiencyToken counts let you compare raw HTML with cleaned Markdown before chunking, embedding, or prompting.

For a production workflow and example architecture, see webpage-to-Markdown for RAG and AI engineers.

URL to Markdown API quickstart

Create an API key in your dashboard, then POST one URL or a list of URLs. Each result includes LLM-ready Markdown plus token counts for the original HTML and cleaned output, so you can measure context saved before indexing or prompting.

curl -X POST https://web2md.org/api/v1/batch \
  -H "Authorization: Bearer w2m_your_key" \
  -H "Content-Type: application/json" \
  -d '{"urls":["https://example.com/a","https://example.com/b"]}'

Up to 50 URLs per request. Responses stream back per URL, so one slow page does not block the rest.

Choose the right Markdown path

InputBest optionWhy
Public URLs at scaleREST APIBatch up to 50 URLs and return deterministic Markdown for pipelines.
Agent-driven researchMCP serverClaude Code, Cursor, and other agents can call the conversion tools directly.
Logged-in or heavily rendered pagesAgent BridgeUses the page already rendered inside your own Chrome session.

Why use a URL to Markdown API for LLM input?

Fetching HTML is the easy half. The hard half is deciding what on the page is the article and what is navigation, cookie banners, related-posts rails, and inline scripts — then keeping headings, lists, tables, and code blocks intact through the conversion. A generic HTML-to-Markdown library gives you Markdown-shaped noise.

The other half is the pages that refuse to be fetched. Reddit blocks datacenter IPs and renders comments in a React shadow DOM; many docs and dashboards render client-side. This API reads Reddit through its JSON endpoints and falls back across old.reddit.com, api.reddit.com, and www.reddit.com so a thread comes back with its comment tree rather than an empty shell.

And it reports the number that justifies the whole exercise: tokens before and after. A long article routinely drops by an order of magnitude once the markup is gone, which is the difference between fitting three sources in a context window and fitting thirty.

URL-to-Markdown use cases

  • SEO and content teams mining Reddit threads for what real people actually ask — then feeding the cleaned text to a model for clustering or summarising.
  • Ecommerce and sourcing teams pulling product and listing pages in bulk to compare specs, pricing, and copy.
  • RAG pipelines that need clean chunks. splitByTokens-style chunking is easier when the input is already structured Markdown rather than tag soup.
  • Agents and coding assistants that need to read a list of URLs as part of a task, without a human clicking through each one.

Or let the agent call it directly (MCP)

If your workflow lives in Claude Desktop, Cursor, or another MCP client, skip the HTTP layer. The MCP server exposes conversion as a tool the agent can call on its own, including batch conversion, so you describe the job in plain language instead of writing the loop.

npx web2md-mcp-server

Verify the API and MCP claims

Do not choose an ingestion tool from a feature list alone. Inspect the machine-readable contract, run the public examples against your own URLs, and compare downloadable output. The package and source links below are hosted outside web2md.org; they identify the same Web2MD product, but they are not independent endorsements.

Markdown API — FAQ

How should I choose a URL-to-Markdown API for RAG?

Test representative pages from your own corpus. Compare structure preservation, fetch coverage, source metadata, per-URL failure handling, batch limits, token counts, privacy, and price. Use a browser-side path for authenticated pages because a remote API cannot access your session.

How many URLs can one request take?

50. Beyond that the request is rejected rather than silently truncated, so you always know what was processed. For larger jobs, chunk your list — each request is independent.

How does authentication work?

A bearer token: Authorization: Bearer w2m_your_key. Keys are created and revoked from your dashboard, and usage is counted against your plan rather than per key, so you can rotate freely.

What about pages behind a login or anti-bot wall?

Server-side fetching has a hard ceiling here: if a page needs your session, no API can see it from a datacenter. Reddit and similar public-but-hostile sites are handled through dedicated fallbacks. For genuinely authenticated pages, the browser extension reads the rendered DOM inside your own session — that is the path to use, and the API is not a substitute for it.

Is it free to try?

Yes. The free plan covers 3 conversions per day, which is enough to test the shape of the response and see the token numbers on your own pages. Paid plans lift the daily cap for pipeline use.

Full endpoint reference, response shape, and error codes are in the docs.

Build the ingestion pipeline: Web2MD with LangChain and LlamaIndex, including failure handling and provenance.