URL to Markdown API
Convert any website to Markdown for LLMs.
To convert a website or URL to Markdown for an LLM, fetch the page and return clean Markdown you can put in context or a RAG index. Webcrawl does that in one call: POST /v1/scrape returns LLM-ready Markdown from any public URL, and agents can use the same path over MCP with web_read. The hosted API is MIT open source under the hood, with 1,000 free credits a month.
Examples
How to call it
Step 1: scrape a URL to Markdown (curl)
curl -s -X POST https://webcrawl.app/v1/scrape \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com"}'Step 2: same path with @webcrawl/client
import { createClient } from "@webcrawl/client";
const client = createClient({ apiKey: process.env.WEBCRAWL_API_KEY });
const page = await client.scrape({ url: "https://example.com" });
console.log(page.markdown);Step 3: agents via MCP (web_read)
{
"mcpServers": {
"webcrawl": { "url": "https://webcrawl.app/mcp" }
}
}Response shape (illustrative)
{
"success": true,
"url": "https://example.com",
"title": "Example Domain",
"markdown": "# Example Domain\n\nThis domain is for use in illustrative examples in documents.\n",
"links": ["https://www.iana.org/domains/example"],
"structuredData": null,
"cached": false,
"credits": { "charged": 1 }
}For agents
Why developers use a URL to Markdown API.
- POST /v1/scrape returns clean Markdown for LLM context and retrieval indexes
- Same scrape path over REST, @webcrawl/client, CLI and @webcrawl/mcp (web_read)
- Optional prompt or schema extraction on the same request when you need JSON fields
- Open source and self-hostable from the MIT webcrawl-anything engine
Endpoint POST /v1/scrape. Credits: 1 per page; +2 when structured extraction is requested. MCP tool: web_read.
Detail
How to convert a URL to Markdown
1. Create a free API key on /signup, or connect hosted MCP at /docs/mcp. 2. Call POST /v1/scrape with a public URL (see the curl example below) and read the markdown field. 3. Pass that Markdown into your LLM prompt, chunker or vector store, and keep the source URL for citations. Optional: use @webcrawl/client scrape, npx webcrawl scrape <url>, or web_read from @webcrawl/mcp. Set onlyMainContent to true to trim chrome; use includeTags, excludeTags and retainImages for tighter control. Matching /v2/scrape and /api/v1/scrape aliases exist. For what HTML to Markdown keeps and strips, see /glossary/html-to-markdown.
Detail
Convert a whole site with map and crawl
Map first with POST /v1/map to list page URLs without reading full bodies (1 credit per call). Then scrape the URLs you need with POST /v1/scrape, or start a multi-page job with POST /v1/crawl from a start URL (1 credit per page). Use path include and exclude filters on crawl when you want a docs subtree. Store each markdown field with its source URL so your RAG pipeline can cite pages later.
Detail
Built for RAG pipelines
Store the markdown field, keep the source URL for citations, and refresh pages on a schedule or from an agent tool call when context goes stale. We return Markdown and optional structured extracts; you own chunking and the vector store. Pair scrape with map or crawl when you need many URLs, and with extract when fields must be JSON instead of prose.
Questions
What is a URL to Markdown API?
A URL to Markdown API fetches a web page and returns clean Markdown instead of raw HTML, so you can feed live pages into an LLM prompt, agent tool or RAG index without writing a custom parser for every site.
How is URL to Markdown different from HTML to Markdown?
HTML to Markdown is the conversion step that turns page markup into Markdown. URL to Markdown is the product path that fetches a public URL and returns that Markdown in one API or MCP call. See /glossary/html-to-markdown for what the converter keeps and strips.
How do I feed the Markdown to an LLM or RAG pipeline?
Read the markdown field from POST /v1/scrape (or web_read over MCP). Put it in the prompt for short context, or chunk and embed it with your own retrieval stack. Keep the source URL for citations. Pair with /v1/map or /v1/crawl when you need many pages.
Can AI agents convert URLs to Markdown via MCP?
Yes. Point MCP clients at https://webcrawl.app/mcp, run npx @webcrawl/mcp with WEBCRAWL_API_KEY, or follow /docs/mcp. Agents call web_read to scrape a URL to Markdown on the same path as POST /v1/scrape.
Is there a free tier, and how does pricing work?
Free includes 1,000 credits a month with no card. Pro starts at $20 for 10,000 credits on /pricing. Live per-endpoint costs are on GET /health as creditSchedule. Scrape is 1 credit per page (+2 when structured extraction is requested).
How is this different from the free website to Markdown tool?
The free tool at /tools/website-to-markdown is a capped browser preview of the same scrape capability. The API is for production keys, SDKs, MCP and higher volume.