Website to Markdown for LLMs avatar

Website to Markdown for LLMs

Pricing

$0.30 / 1,000 page converteds

Go to Apify Store
Website to Markdown for LLMs

Website to Markdown for LLMs

Crawl a site and export clean Markdown with token counts and chunks, ready for RAG.

Pricing

$0.30 / 1,000 page converteds

Rating

0.0

(0)

Developer

Ken Agland

Ken Agland

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Share

Crawl a site and export clean Markdown with token counts and chunks, ready for RAG.

What it does

  • Crawls pages starting from your URLs, staying on the same domain by default.
  • Strips boilerplate (scripts, styles, nav, header, footer, sidebars) and keeps the main content.
  • Converts the main content to clean Markdown.
  • Estimates token count for each page.
  • Optionally splits each page into token-sized chunks for retrieval-augmented generation.

No API key needed.

Example input

{
"startUrls": [
"https://example.com"
],
"maxPages": 10,
"maxDepth": 2,
"sameDomainOnly": true,
"includeChunks": true,
"chunkSizeTokens": 800
}

Input

FieldTypeDefaultDescription
startUrlsarray of strings(required)URLs to start crawling from.
maxPagesinteger10Stop after this many pages in total.
maxDepthinteger2Link hops to follow from a start URL. Start URLs are depth 0.
sameDomainOnlybooleantrueOnly follow links on the same domain as their start URL.
includeChunksbooleanfalseInclude the chunk array in each item.
chunkSizeTokensinteger800Target chunk size in estimated tokens.

Output

Each dataset item is one page:

{
"url": "https://example.com/",
"title": "Example Domain",
"markdown": "# Example Domain\n\nThis domain is for use in illustrative examples...",
"charCount": 210,
"tokenEstimate": 53,
"chunkCount": 1,
"chunks": [
"# Example Domain\n\nThis domain is for use in illustrative examples..."
]
}

The chunks field is present only when includeChunks is true.

Run summary (OUTPUT)

The run's default key-value store record OUTPUT holds an aggregate:

{
"startUrls": [
"https://example.com/"
],
"pagesCrawled": 1,
"totalChars": 210,
"totalTokens": 53,
"totalChunks": 1,
"includeChunks": true,
"chunkSizeTokens": 800,
"maxPages": 10,
"maxDepth": 2,
"sameDomainOnly": true
}

How it works

The Actor fetches each page's HTML with plain fetch (retrying on 429 and 5xx with backoff, failing fast on other 4xx). It parses the HTML with cheerio, removes boilerplate, and picks the main content region. It converts that content to Markdown with turndown, falling back to a cheerio-based builder (headings, paragraphs, list items) if turndown cannot run. Tokens are estimated as characters divided by 4. Crawling uses an in-memory breadth-first queue with a small concurrency, staying on the same domain and honoring maxPages and maxDepth.

MIT licensed.