You want a website in your vector database or in a prompt, not its menus, cookie banners and footers. Here is the free way for a few pages, and the API way for a whole site: a list of URLs, a sitemap or a crawl from one start page, returned as clean Markdown with chunks ready to embed.
The free way: one page at a time
For a handful of pages you don't need an API. Open the page, select the article, copy it and paste it into our free HTML to Markdown converter. It runs in your browser, keeps only the main content (the same Readability engine as Firefox Reader View) and gives you GitHub-flavored Markdown with tables and code blocks.
In Python, requests + readability-lxml + markdownify does the same for static pages. It stops working when the site renders with JavaScript (React, Vue, most modern docs), when you need every page of a site, or when you need the text split into chunks for embeddings.
The API way: a whole site in one run
- Open Website to Markdown on Apify and sign in (the free plan needs no card).
- Give it URLs, a sitemap.xml, or one start URL with Crawl on. Crawl scope
path stays inside the section you start from, e.g. only /docs/. - Set chunkSize (for example 800 tokens) if you want RAG chunks. Each chunk carries its heading path and a link to the nearest #anchor, so answers can cite the exact section.
- Run it. Download Markdown, JSON or CSV, or call it from code, n8n, Make or an AI agent.
Calling it from code returns the pages in the same HTTP response:
curl -X POST "https://api.apify.com/v2/acts/blueberry_rainstorm~web-page-to-markdown/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"urls": [
{
"url": "https://docs.python.org/3/tutorial/"
}
],
"crawl": true,
"crawlScope": "path",
"maxPages": 200,
"chunkSize": 800
}'
# pip install apify-client
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("blueberry_rainstorm/web-page-to-markdown").call(run_input={
"sitemapUrls": [
{
"url": "https://react.dev/sitemap.xml"
}
],
"maxPages": 500,
"chunkSize": 800
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
for chunk in item.get("chunks", []):
print(chunk["headingPath"], chunk["approxTokens"], chunk["url"])
Full working example on GitHub: keep a RAG index in sync with a docs site (MIT licence, copy and adapt).
What you get for each page
One row per page: url, title, description, language, canonicalUrl, markdown, wordCount, approxTokens, whether a browser was needed, and (with chunking on) chunks with headingPath, text, approxTokens, anchor and url. Code blocks keep their language, tables stay Markdown tables, and docs tabs (MkDocs, Docusaurus, Mintlify, sphinx-design) can be "selected only" or "all tabs".
What it costs
No subscription and no start fee. Apify's free plan includes $5 of usage a month, so about 5,000 pages a month cost you nothing.
Where it is not the right tool
- Sites behind a login or a hard bot wall: the API doesn't log in or solve CAPTCHAs.
- Web search (find pages for a query): it converts pages you name or crawl; pair it with a search API.
- Structured extraction with an LLM ("give me the price as JSON"): it gives you clean Markdown to feed your own model.
Comparing options? Read Firecrawl alternatives and Jina Reader alternatives.
Questions
How do I convert a whole website to Markdown?
Give the API the start URL with Crawl on, or the site's sitemap.xml. It follows links inside the scope you choose, converts each page's main content to Markdown and returns one row per page. Set maxPages to cap the run.
Does it work on JavaScript sites?
Yes. renderMode auto fetches plain HTML first and switches to a real browser only when a page needs JavaScript, so static pages stay fast and cheap and React or Vue pages still come out complete.
How big should RAG chunks be?
500 to 1,000 tokens with about 100 tokens of overlap is a good start for most embedding models. Chunks are cut at headings first, and each one carries its heading path so the model knows the context.
Can I keep my index in sync?
Yes. Schedule the run daily or weekly on Apify and compare each page's text or token count with what you stored. You pay $1 per 1,000 pages each time, failed pages free.
Is there a free option?
For a few pages, use our free HTML to Markdown converter in the browser. For bulk runs, Apify's free plan gives $5 of credit a month, about 5,000 pages.