Website to Markdown for LLM & RAG + llms.txt Generator avatar

Website to Markdown for LLM & RAG + llms.txt Generator

Pricing

from $1.20 / 1,000 page converteds

Go to Apify Store
Website to Markdown for LLM & RAG + llms.txt Generator

Website to Markdown for LLM & RAG + llms.txt Generator

Turn websites into clean Markdown for LLMs, RAG and AI agents: main content only (no menus, footers, cookie banners), tables and links kept, optional RAG chunks, and a ready llms.txt + llms-full.txt per site. Respects robots.txt.

Pricing

from $1.20 / 1,000 page converteds

Rating

0.0

(0)

Developer

DocFlow Tools

DocFlow Tools

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

an hour ago

Last modified

Features

Limited permissions

Share

Turn websites into clean Markdown for LLMs, RAG pipelines and AI agents. The actor crawls the sites you give it (same domain only, robots.txt respected), keeps the main content of each page with its headings, tables and links, and drops menus, headers, footers, cookie banners and scripts. Optionally it splits each page into RAG chunks that are never longer than your limit. At the end it writes an llms.txt index and an llms-full.txt file per site, in the format proposed at llmstxt.org. It uses no search engines and works over plain HTTP (no browser). You pay only for pages converted.

What you get

  • One dataset row per page: URL, title, meta description, language, Markdown, word count, an estimated token count and, if you ask for them, chunks.
  • Main-content extraction with trafilatura (links and tables kept, images and comments left out). If it finds fewer than 20 words, the actor falls back to the page's <main>, <article> or <body> with navigation, header, footer, aside, forms and scripts removed, converted with markdownify.
  • A # heading at the top of the Markdown (the page's H1, or its title) when the page has a title and the extracted text does not already start with a heading.
  • RAG chunks (optional): split at headings and paragraphs, never longer than chunkSize, with overlap.
  • llms.txt and llms-full.txt per site in the key-value store.
  • Clean crawl: same domain only (www. and the bare domain count as one site), #fragments and tracking parameters (utm_*, gclid, fbclid, mc_cid, mc_eid, _hs*, ref) removed, file links (PDF, images, CSS, JS, ZIP, Office documents and others) skipped, and two URLs that redirect to the same page delivered once.

Use cases

  • Load a documentation site or knowledge base into a vector database for RAG.
  • Give an AI agent or chatbot the content of a website as Markdown.
  • Generate a first llms.txt and llms-full.txt for your own site, then review and publish them at your domain root.
  • Export a site's text for analysis, translation or migration.
  • Convert only one section of a site with includePatterns (for example /docs/).

How to use

  1. Open the Actor in Apify Console and click Try for free / Start.
  2. In Websites or pages, add one or more start URLs.
  3. Set Max pages to the most pages you want to convert and pay for.
  4. Optionally set Only output URLs matching, Skip URLs matching, RAG chunk size and Chunk overlap.
  5. Run it. Pages are in the Output tab. The llms-*.txt files and the SUMMARY record are in the run's key-value store.

Input example

{
"startUrls": ["https://docs.example.com/"],
"maxPages": 200,
"crawlLinks": true,
"includePatterns": ["/guides/", "/api/"],
"excludePatterns": ["/changelog/"],
"chunkSize": 2000,
"chunkOverlap": 200,
"generateLlmsTxt": true,
"respectRobotsTxt": true
}
FieldTypeDefaultMeaning
startUrlsarray of stringsrequiredStart pages. A URL without https:// gets it added.
maxPagesinteger (1-100,000)100Stop after this many converted pages in total.
crawlLinksbooleantrueFollow internal links. Off = convert only the listed URLs.
includePatternsarray of regexnoneOnly pages matching at least one pattern are output. Other pages are still crawled to find links, but not output or charged. Start URLs are always output.
excludePatternsarray of regexnoneLinks matching any pattern are not crawled.
chunkSizeinteger (0-100,000)00 = no chunks. Otherwise the maximum length of each chunk, in characters.
chunkOverlapinteger (0-5,000)200Characters from the end of one chunk repeated at the start of the next.
generateLlmsTxtbooleantrueWrite llms-<site>.txt and llms-full-<site>.txt to the key-value store.
respectRobotsTxtbooleantrueSkip pages that robots.txt disallows.

Output example

One item per converted page (long values shortened):

{
"url": "https://docs.example.com/guides/install",
"title": "Install | Example Docs",
"description": "How to install Example on Linux, macOS and Windows.",
"lang": "en",
"markdown": "# Install\n\nExample runs on Linux, macOS and Windows...\n\n## Requirements\n\n| OS | Version |\n|---|---|\n| Linux | ...",
"wordCount": 812,
"tokensEstimate": 1290,
"chunks": [
"# Install\n\nExample runs on Linux, macOS and Windows...",
"...last 200 characters of the previous chunk...\n\n## Requirements\n\n| OS | Version | ..."
]
}
  • description comes from the meta description, or og:description if there is none.
  • tokensEstimate is the Markdown length divided by 4, a rough estimate, not a tokenizer count.
  • chunks is present only when chunkSize is above 0.
  • url is the address the page ended on after redirects.

If no page is converted, the dataset gets one free item with "status": "no_pages" and the summary fields.

How chunks are built

  • If the whole page fits in chunkSize, it is one chunk.
  • Otherwise the Markdown is split before each heading and at blank lines. A block longer than chunkSize is cut at the last sentence end or line break that fits (if it is past half the limit), or else at exactly chunkSize.
  • Blocks are joined while they fit. Each new chunk starts with the last chunkOverlap characters of the previous one, but only if that still fits; otherwise the chunk starts without overlap.
  • No chunk is ever longer than chunkSize. The overlap is counted in characters, so it can start mid-word.

llms.txt and llms-full.txt

Converted pages are grouped by site (host without www.). For each site the key-value store gets two text files. The key replaces every character other than letters, digits and - with -; for docs.example.com they are llms-docs-example-com.txt and llms-full-docs-example-com.txt.

llms-<site>.txt follows the llmstxt.org structure: an H1 with the site name, a blockquote with the summary, and H2 sections with link lists. The name is the title of the site's home page (or of the first page converted, if the home page was not), cut at the first | or -. The summary is that page's meta description. Sections are the first folder of each URL path (Main for the root, listed first; the rest in alphabetical order). Each line is - [page title](url): description.

# Example Docs
> Guides and API reference for Example.
## Main
- [Example Docs | Example](https://docs.example.com/): Guides and API reference for Example.
## Api
- [Authentication - API | Example](https://docs.example.com/api/auth)
## Guides
- [Install | Example Docs](https://docs.example.com/guides/install): How to install Example on Linux, macOS and Windows.

llms-full-<site>.txt starts with the same H1 and then contains the Markdown of every page, each preceded by a <!-- source: url --> line and separated by ---.

The files list only the pages converted in that run, so set maxPages high enough to cover the site and review the result before publishing it.

Pricing

Prices by Apify discount tier: the prices below are for the Bronze tier. Free plan: 50 % off. Silver: 10 % off. Gold and higher: 20 % off. Apify applies the right price automatically.

Pay per event, in USD:

EventPriceWhen
Actor start$0.00005Charged by Apify when a run starts, per GB of run memory (default memory: 512 MB)
page-converted$0.0015For each page written to the dataset.

Not charged: pages that fail or return an HTTP error, pages blocked by robots.txt, non-HTML responses, a second URL that redirects to a page already converted, pages crawled only to find links because they do not match includePatterns, and the no_pages status item. The llms.txt files cost nothing extra.

Control spend with maxPages. The default is 100 pages; the maximum is 100,000. Only converted pages count toward it. The run also stops cleanly if it reaches the maximum cost per run you set in Apify.

Examples:

  • 100 pages: $0.00005 + 100 × $0.0015 = $0.15005
  • 1,000 pages: $0.00005 + 1,000 × $0.0015 = $1.50005
  • 300 pages crawled, 40 match includePatterns: $0.00005 + 40 × $0.0015 = $0.06005

Use it from code, AI agents and integrations

Apify API (one call, returns the dataset items):

curl -X POST "https://api.apify.com/v2/acts/docflow-tools~website-to-markdown-llms-txt/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["https://docs.example.com/"], "maxPages": 20, "chunkSize": 2000}'

Synchronous endpoints wait a limited time; for large crawls start the run asynchronously and read the results when it finishes.

Python (apify-client):

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("docflow-tools/website-to-markdown-llms-txt").call(
run_input={"startUrls": ["https://docs.example.com/"], "maxPages": 100, "chunkSize": 2000}
)
for page in client.dataset(run["defaultDatasetId"]).iterate_items():
for chunk in page.get("chunks", []):
... # embed and store the chunk with page["url"] as metadata
store = client.key_value_store(run["defaultKeyValueStoreId"])
llms_txt = store.get_record("llms-docs-example-com.txt")["value"]

AI agents: the Actor can be called by AI agents through the Apify MCP server at https://mcp.apify.com.

No-code: connect it to Make, Zapier, n8n and other tools through Apify integrations, or schedule it in Apify.

Limits and notes

  • No JavaScript rendering. Pages are fetched over HTTP. Content that only appears after JavaScript runs is not captured.
  • Same domain only: links to other hosts or subdomains are not followed.
  • robots.txt is respected by default (user agent token LLMReadyBot). If a site has no robots.txt, all pages are allowed.
  • Only http and https URLs are fetched; domains that resolve to private, loopback, link-local or other internal addresses are blocked.
  • excludePatterns apply to discovered links, not to the start URLs.
  • Up to 5 pages are fetched in parallel, with a 30-second timeout per request. Only the first 5 MB of each page's HTML is used.
  • Images are not included in the Markdown.
  • The SUMMARY record lists pages converted, the first 200 errors, pages skipped by robots.txt, whether maxPages was reached and how many queued pages were not visited.

FAQ

Can I convert only some pages of a big site? Yes. Use includePatterns to choose what is output (and charged) and excludePatterns to stop the crawl from entering sections you do not need. Or turn off crawlLinks and list the URLs.

Is the generated llms.txt ready to publish? It follows the llmstxt.org structure and lists the pages converted in the run. Review the name, summary and sections before you publish it at https://your-site/llms.txt.

How large should chunks be? It depends on your embedding model and retrieval setup. chunkSize is in characters; tokensEstimate (characters divided by 4) can help you pick a value.

Do I pay for pages that fail? No. Failed pages are listed in SUMMARY.errors and are not charged.

Does it use a search engine or visit other sites? No. It only visits the start URLs and links inside the same domain.