# Website to llms.txt Generator (`br_data_hub/website-to-llms-txt`) Actor

Crawl one website (robots.txt and sitemap aware), generate spec-compliant llms.txt and llms-full.txt files, audit the existing llms.txt and return clean Markdown for every page.

- **URL**: https://apify.com/br_data_hub/website-to-llms-txt.md
- **Developed by:** [br_data_hub](https://apify.com/br_data_hub) (community)
- **Categories:** AI, Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.40 / 1,000 pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Website to llms.txt Generator

Give the address of a website and get back an **`llms.txt`** and an **`llms-full.txt`** that follow the [llmstxt.org](https://llmstxt.org/) specification, ready for the site owner to publish at the root of the site (`https://your-site.com/llms.txt`). Every page is also returned as clean **Markdown** in the dataset, for RAG or for feeding an LLM directly.

What the Actor does:

- Crawls **only the domain you give** (and by default only the folder of the start URL, so `https://example.com/docs/` stays inside `/docs/`).
- **Respects `robots.txt`** (Disallow rules, `Crawl-delay`, and `noindex`/`nofollow` meta tags). This cannot be turned off.
- Uses **`sitemap.xml`** when it exists (sitemaps listed in robots.txt, sitemap indexes and `.xml.gz` included), then follows links up to the page and depth limits.
- Extracts the **main content** of each page with [trafilatura](https://github.com/adbar/trafilatura). Menus, sidebars, headers, footers and cookie banners are left out; headings, lists, code blocks and tables are kept.
- Builds `llms.txt` with an H1 title, a blockquote summary, and **H2 sections grouped by the site's URL structure** (`/advanced/...` becomes "Advanced"). Each link has a short description. **Secondary pages** (changelog, blog, legal, contributing, community and very thin pages) go to the **"Optional"** section, which the spec reserves for links an agent can skip.
- **Audits the llms.txt the site already has**, if any: spec problems, and which crawled pages it does not list.
- Checks the generated file against the spec before saving it. The test suite also parses it with `llms_txt`, the reference parser published by the authors of the spec.

### Input

| Field | Description |
|---|---|
| `startUrl` | Home page of the site or of a section. Required. Default: `https://www.python-httpx.org/` (a small documentation site, about 25 pages). |
| `maxPages` | Maximum pages converted and listed, 1 to 1,000 (default 50). |
| `maxDepth` | Clicks away from the start page (default 3). Pages found in the sitemap count as depth 1. |
| `useSitemap` | Read sitemap.xml to find pages and order them (default `true`). |
| `stayWithinPath` | Stay inside the start URL's folder (default `true`). Turn off to crawl the whole domain. |
| `siteTitle` / `siteSummary` | Optional overrides for the H1 and the blockquote. By default they come from the home page (`og:site_name`, `<title>`, meta description). |
| `details` | Optional notes for agents (Markdown, no headings), placed under the summary. |
| `optionalPatterns` | Path parts that send a page to the "Optional" section. Leave empty for the built-in list (changelog, blog, news, legal, privacy, terms, license, contributing, community and similar). |
| `generateFullText` | Also produce `llms-full.txt` (default `true`). |
| `maskPersonalData` | Replace e-mail addresses and Brazilian CPF numbers with a placeholder (default `true`). |

```json
{"startUrl": "https://docs.example.com/", "maxPages": 200, "maxDepth": 4}
```

### Output

**Key-value store** of the run:

- `llms.txt`: the index file, `text/plain; charset=utf-8`.
- `llms-full.txt`: the full Markdown of every listed page in one file. Each page is under its own H2 with a `Source:` line.
- `OUTPUT`: run summary (site title, summary, page count per section, public links to both files, pages fetched, skipped and failed, time) and `existingLlmsTxt`: when the site already publishes an llms.txt at the crawled path, its spec problems, number of links, and the crawled pages it is missing (up to 100). `null` when the site has none.

Example `llms.txt` (from the test run on a copy of the HTTPX docs, shortened):

```markdown
## HTTPX

> A next-generation HTTP client for Python.

The full text of every page listed below is in [llms-full.txt](https://www.python-httpx.org/llms-full.txt).

### Pages

- [HTTPX](https://www.python-httpx.org/): A next-generation HTTP client for Python.
- [QuickStart](https://www.python-httpx.org/quickstart/): First, start by importing HTTPX: Now, let’s try to get a webpage.
- [Async Support](https://www.python-httpx.org/async/): HTTPX offers a standard synchronous API by default, but also gives you the option of an async client if you need it.

### Advanced

- [Clients](https://www.python-httpx.org/advanced/clients/): If you are coming from Requests, httpx.Client() is what you can use instead of requests.Session().
- [Timeouts](https://www.python-httpx.org/advanced/timeouts/): HTTPX is careful to enforce timeouts everywhere by default. The default behavior is to raise a TimeoutException after 5 seconds of network inactivity.

### Optional

- [Third Party Packages](https://www.python-httpx.org/third_party_packages/): As HTTPX usage grows, there is an expanding community of developers building tools and libraries that integrate with HTTPX, or depend on HTTPX.
- [Contributing](https://www.python-httpx.org/contributing/): Thank you for being interested in contributing to HTTPX.
```

**Dataset**, one item per converted page:

```json
{
  "url": "https://www.python-httpx.org/advanced/clients/",
  "depth": 1,
  "title": "Clients",
  "description": "",
  "language": "en",
  "markdown": "Hint\n\nIf you are coming from Requests, ...",
  "markdownChars": 10692
}
```

Pages that fail to download, are not HTML, are blocked by robots.txt, are marked `noindex`, are duplicates (same canonical URL) or have no readable text are not listed in the dataset and are **not charged**.

To publish: download `llms.txt` (and `llms-full.txt`) from the run's storage and upload them to the root of your site, or to the folder the files describe (for example `/docs/llms.txt`), as the spec allows.

### How much does it cost?

Pay per event:

| Event | When | Suggested price |
|---|---|---|
| `page` | Each page converted to Markdown and listed | **US$ 0.002** (US$ 2 per 1,000 pages) |
| `llms-txt` | Each file generated (`llms.txt`, and `llms-full.txt` if enabled) | **US$ 0.01** per file |
| `apify-actor-start` | Charged by Apify when the run starts (synthetic event, no code) | **US$ 0.00005** |

The default run (about 25 pages and both files) costs about **US$ 0.07**. A 100-page site costs US$ 0.22, and 1,000 pages cost US$ 2.02.

How the price was set:

- Apify compute costs US$ 0.20 per compute unit (1 CU = 1 GB of memory for 1 hour), and Apify keeps 20% of the price.
- Measured locally: 23 pages in 3.0 s using 3.5 CPU-seconds, and 207 pages in 19.6 s using 24.9 CPU-seconds, with peak memory of 95 MB and 109 MB. That is about 0.12 CPU-seconds per page.
- The Actor runs with 256 MB, which gives 1/16 of a vCPU on Apify. A page then takes about 2 s, which is 0.25 GB × 2 s = 0.00014 CU, or **US$ 0.00003 per page**. Each run also pays for start-up and robots.txt and sitemap reads, about 15 s, or US$ 0.0002.
- After the 20% commission, US$ 0.002 leaves US$ 0.0016 per page. That covers the compute plus dataset and key-value store writes many times over, and leaves room for slow sites, retries and heavy pages.
- The `llms-txt` event pays for the result itself. On a small site the files are the product, and a per-page price alone would make a 20-page run cost only a few cents. On large sites the per-page price stays low.

Competitors in the Apify Store (listing prices found on 30/10/2026): US$ 0.0005 per page (lathesmith, plus a start fee), US$ 0.001 (thriving_adder), US$ 0.005 (dltik, f0rty7even, nacred_corner) and US$ 0.01 (darknezz). For a 100-page site: US$ 0.22 here versus US$ 0.50 to US$ 1.00 for most of them.

**$0.002 per page** (`page` event, pay per event). Charged once per page converted and listed. Errors, blocked, noindex, duplicate and empty pages are free.

- `llms-txt`: $0.01 (Charged once per llms.txt or llms-full.txt file generated.)
- `apify-actor-start`: $0.00005 (Charged once when a run starts (Apify synthetic event).)

| You get | Free tier | Bronze tier (10% off) | Gold tier (30% off) |
|---|---|---|---|
| 100 pages | $0.20 | $0.18 | $0.14 |
| 1,000 pages | $2.00 | $1.80 | $1.40 |
| 10,000 pages | $20.00 | $18.00 | $14.00 |

Discounts follow your Apify subscription tier: Bronze 10%, Silver 20%, Gold and above 30%. No subscription to this Actor and no charge for platform usage: you pay only for results.
The Apify Free plan includes $5 of monthly credit, enough for about **2,500 pages** at the list price.
You can cap the cost of any run with **Maximum cost per run**; the Actor stops when it is reached.

### Data source

The website you choose. Pages are fetched like a search engine would: same domain only, robots.txt rules and `Crawl-delay` are followed, and the crawler identifies itself as `website-to-llms-txt` in the User-Agent, so site owners can allow or block it by name. Use the Actor on your own sites, or on sites whose terms allow automated access and reuse of their content. The generated files are meant to be published by the owner of the site.

The default input uses the [HTTPX documentation](https://www.python-httpx.org/), whose source is BSD-3-Clause licensed. The output format follows the [llms.txt proposal](https://llmstxt.org/) (Apache-2.0, AnswerDotAI). Content extraction uses trafilatura (Apache-2.0). This Actor is an independent tool. It is not affiliated with or endorsed by llmstxt.org, AnswerDotAI, the HTTPX project or trafilatura.

Some sites, or the firewall/CDN in front of them, block requests from cloud servers. The run then stops with a clear message naming the HTTP status (403, 429 or 503), and nothing is charged.

Limits: the Actor reads server-rendered HTML and does not run JavaScript, so single-page apps that render content only in the browser come back nearly empty. Up to 1,000 pages per run and 5 MB per page. For runs over a few hundred pages, give the run 1 GB of memory: it runs about 4 times faster for roughly the same cost.

### More questions

#### How does it handle robots.txt?

robots.txt is always read and cannot be switched off. Disallow rules are checked for the user agent `website-to-llms-txt` (or `*`), `Crawl-delay` is honoured (capped at 10 s, and pages are then fetched one at a time), and pages with a `noindex` meta tag are left out, while `nofollow` stops link following. If robots.txt answers 401 or 403, the site is treated as fully disallowed. If the start URL itself is disallowed, the run stops before fetching any page. Site owners can block the crawler by name.

#### What is the difference between llms.txt and llms-full.txt?

`llms.txt` is the short index the spec describes: H1, summary and H2 sections with one link and a short description per page. `llms-full.txt` puts the full Markdown of every listed page in one file, each page under its own H2 with a `Source:` line, so an agent or a RAG loader can read the whole site in one request. Turn off `generateFullText` if you only want the index (one file event less).

#### Can I use the dataset directly for RAG?

Yes. Each dataset item is one page with `url`, `title`, `description`, `language`, `markdown` and `markdownChars`. The Markdown is the main content only (menus, sidebars, footers and cookie banners removed; headings, lists, code blocks and tables kept). The Actor does not split pages into chunks, so cut `markdown` at its headings with your own splitter, and keep `url` as the source metadata.

#### Does it work on JavaScript sites?

No. It reads the HTML the server sends and does not run JavaScript, so single-page apps that render everything in the browser come back nearly empty. Documentation built with static generators (MkDocs, Docusaurus, Sphinx, Hugo, GitBook exports and similar) works well.

#### Which pages are crawled?

Only the host of the start URL (`www.` and the bare domain count as the same site), and by default only the start URL's folder: `https://example.com/docs/` stays inside `/docs/`. Pages come from the sitemap (when `useSitemap` is on) and from links up to `maxDepth` clicks away. Canonical URLs are followed to avoid duplicates, links to files such as PDFs and images are skipped, and the crawl stops at `maxPages` (up to 1,000) pages, with up to 5 pages fetched in parallel.

#### How fresh is the result, and should I re-run it?

Every run fetches the live site, so the files reflect the site at run time; nothing is cached between runs. To keep a published llms.txt current, schedule the Actor weekly or after each docs release and replace the file on your site.

#### My site already has an llms.txt. What does the audit tell me?

When an llms.txt exists at the crawled path, `OUTPUT.existingLlmsTxt` lists its problems against the spec, how many links it has, and which crawled pages it does not list (up to 100). It is `null` when the site has none.

#### Is personal data copied into the files?

By default (`maskPersonalData: true`) e-mail addresses and Brazilian CPF numbers found in page text and descriptions are replaced with a placeholder before anything is saved. You are responsible for the terms of the sites you crawl; the generated files are meant to be published by the site owner.

### Use it via API

Run it from any language and get the results as JSON. Replace `<YOUR_API_TOKEN>` with your [Apify API token](https://console.apify.com/settings/integrations).

```bash
curl -X POST "https://api.apify.com/v2/acts/br_data_hub~website-to-llms-txt/run-sync-get-dataset-items?token=<YOUR_API_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrl": "https://www.python-httpx.org/"}'
```

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_API_TOKEN>")
run = client.actor("br_data_hub/website-to-llms-txt").call(run_input={'startUrl': 'https://www.python-httpx.org/'})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

You can also schedule runs, send results to webhooks, or connect the Actor to Make, Zapier, n8n, Google Sheets and other [integrations](https://docs.apify.com/platform/integrations).

### Use it with AI agents (MCP)

This Actor is ready for AI agents: typed input and output schemas, pay-per-event pricing, limited permissions and short runs.

- **Apify MCP server:** add `https://mcp.apify.com/?tools=br_data_hub/website-to-llms-txt` to Claude, ChatGPT, Cursor, VS Code or any MCP client, and the agent can call this Actor as a tool.
- **Agent frameworks:** call it from LangChain, LlamaIndex, CrewAI or the OpenAI Agents SDK through the Apify integrations, or with the API call above.
- Results come as structured JSON with stable field names, documented in the **Output** tab.

### FAQ

#### Where does the data come from?

The website you choose. Pages are fetched like a search engine would: same domain only, robots.txt rules and `Crawl-delay` are followed, and the crawler identifies itself as `website-to-llms-txt` in the User-Agent, so site owners can allow or block it by name. Use the Actor on your own sites, or on sites whose terms allow automated access and reuse of their content. The generated files are meant to be published by the owner of the site.

#### How much does it cost?

$0.002 per page. Discounts follow your Apify subscription tier: Bronze 10%, Silver 20%, Gold and above 30%. See **How much does it cost?** above for examples.

#### Do I pay for errors or empty results?

No. Charged once per page converted and listed. Errors, blocked, noindex, duplicate and empty pages are free.

#### Can I run it on a schedule or connect it to other tools?

Yes. Use Apify schedules to run it daily or weekly, webhooks to get notified, and integrations such as Make, Zapier, n8n and Google Sheets. Everything also works through the API.

#### Can AI agents use it?

Yes. It works as a tool in the Apify MCP server and in agent frameworks, and AI agents can pay per event. See **Use it with AI agents (MCP)**.

#### Is it legal to use this data?

The Actor reads only public sources. You are responsible for how you use the data and for complying with the source's terms and with privacy laws such as GDPR.

#### I found a bug or need a feature. What should I do?

Open an issue in the **Issues** tab. We answer within 14 days, usually much sooner.

### More Actors from BR Data Hub

| Actor | What it does |
|---|---|
| [Documents to Markdown for RAG (Docling)](https://apify.com/br_data_hub/docs-to-markdown) | Convert PDF and DOCX files to clean Markdown with Docling: page count, detected tables, metadata and optional  |
| [RSS & Atom Feed Reader with Full Text](https://apify.com/br_data_hub/rss-full-text-feed) | Read RSS, Atom and JSON Feed (or find the feed of any website) and get clean items with ISO dates, full articl |
| [Research Papers Search for RAG, from OpenAlex data](https://apify.com/br_data_hub/openalex-research-search) | Search 250M+ scholarly papers from OpenAlex data, or look up DOIs: authors with institutions, venue, citations |
| [Brazil CNPJ Lookup API (Consulta CNPJ)](https://apify.com/br_data_hub/br-cnpj-lookup) | Look up Brazilian companies by CNPJ: registration status, partners (masked CPF), activities, tax regime and sc |

See all our Actors at [apify.com/br_data_hub](https://apify.com/br_data_hub).

### Usar em português

Informe o endereço de um site e receba o `llms.txt` e o `llms-full.txt` no formato de llmstxt.org, prontos para publicar na raiz do site, além do conteúdo de cada página em Markdown limpo (sem menu nem rodapé) no dataset. O Actor varre só o domínio informado, respeita o robots.txt, usa o sitemap.xml quando existe e agrupa as seções pela estrutura de URLs. Páginas secundárias (changelog, blog, termos, contribuição) vão para a seção "Optional". E-mails e CPFs encontrados no texto são mascarados. Se o site já tiver um llms.txt, o Actor aponta os problemas dele e as páginas que faltam. A cobrança é por página convertida (`page`) e por arquivo gerado (`llms-txt`), mais o início de execução da Apify (`apify-actor-start`); páginas com erro ou bloqueadas não são cobradas.

**Quanto custa:** $0.002 por resultado (`page`); 1.000 resultados saem por $2.00. Desconto pelo nível da assinatura Apify: Bronze 10%, Silver 20%, Gold ou acima 30%. Erros e consultas sem resultado não são cobrados. Use também pela API ou por agentes de IA no servidor MCP da Apify (`https://mcp.apify.com/?tools=br_data_hub/website-to-llms-txt`).

# Actor input Schema

## `startUrl` (type: `string`):

Type the home page of the site or of a section, e.g. https://example.com/docs/. Only this domain is crawled and, by default, only pages under this path.

## `maxPages` (type: `integer`):

Set the maximum number of pages converted and listed (1 to 1,000), e.g. 50. Each converted page is one charged event.

## `maxDepth` (type: `integer`):

Set how many clicks away from the start page links are followed, e.g. 3. Use 0 to read only the start page (plus sitemap pages, which count as depth 1).

## `useSitemap` (type: `boolean`):

Keep on to read the sitemaps declared in robots.txt (or /sitemap.xml) and find pages not linked from the menu. Sitemap order is also used to order the links.

## `stayWithinPath` (type: `boolean`):

Keep on to crawl only pages under the start URL's folder (for https://example.com/docs/ that is /docs/). Turn off to crawl the whole domain.

## `siteTitle` (type: `string`):

Type the name used as the H1 of llms.txt. Leave empty to take it from the home page (og:site_name or title).

## `siteSummary` (type: `string`):

Write the one-sentence summary shown as the blockquote under the H1. Leave empty to use the home page meta description or its first sentences.

## `details` (type: `string`):

Write Markdown text (no headings) to place between the summary and the sections, e.g. how to read the docs or which version they cover. Optional.

## `optionalPatterns` (type: `array`):

Enter URL path parts that mark a page as secondary, listed under the 'Optional' section, one per line, e.g. changelog, blog or legal. Leave empty to use the built-in list.

## `generateFullText` (type: `boolean`):

Keep on to also save llms-full.txt, with the full Markdown of every page in one file. Each generated file is one charged llms-txt event.

## `maskPersonalData` (type: `boolean`):

Keep on to replace e-mail addresses and Brazilian CPF numbers in page text with a placeholder, so no personal data is copied into the files.

## Actor input object example

```json
{
  "startUrl": "https://www.python-httpx.org/",
  "maxPages": 50,
  "maxDepth": 3,
  "useSitemap": true,
  "stayWithinPath": true,
  "generateFullText": true,
  "maskPersonalData": true
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset with all results

## `files` (type: `string`):

Key-value store with the files and the OUTPUT summary of the run

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "startUrl": "https://www.python-httpx.org/"
};

// Run the Actor and wait for it to finish
const run = await client.actor("br_data_hub/website-to-llms-txt").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "startUrl": "https://www.python-httpx.org/" }

# Run the Actor and wait for it to finish
run = client.actor("br_data_hub/website-to-llms-txt").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "startUrl": "https://www.python-httpx.org/"
}' |
apify call br_data_hub/website-to-llms-txt --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,br_data_hub/website-to-llms-txt"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/9Bis7yMYsq9Ajyntc/builds/3JCZHMDb4GFk3t3zF/openapi.json
