# llms.txt Generator — Make Any Website AI-Readable (`darknezz/llms-txt-generator`) Actor

Crawl any website and generate llms.txt and llms-full.txt files following the llms.txt standard. BFS crawler with URL filtering and markdown/plaintext output. For AI readiness, SEO for AI, documentation portals, and archiving.

- **URL**: https://apify.com/darknezz/llms-txt-generator.md
- **Developed by:** [Oaida Adrian](https://apify.com/darknezz) (community)
- **Categories:** AI, SEO tools
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $10.00 / 1,000 processing data

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## llms.txt Generator — Make Any Website AI-Readable

Crawl any website and generate standards-compliant **`llms.txt`** and **`llms-full.txt`** files following the [llms.txt specification](https://llmstxt.org). Point it at a domain and get back AI-ready files plus a structured per-page dataset — no setup, no code.

### What is llms.txt?

`llms.txt` is the emerging standard (proposed by Jeremy Howard, adopted by Anthropic, Mintlify, Zapier and hundreds of doc sites) for telling AI models what your website contains. Like `robots.txt` for crawlers or `sitemap.xml` for search engines, `llms.txt` gives LLMs a curated, token-efficient map of your content:

- **`llms.txt`** — a concise index: site title, summary, and a linked list of your pages with one-line descriptions.
- **`llms-full.txt`** — the full extracted content of every page in one clean file, ready to drop into a context window or a RAG pipeline.

If you want ChatGPT, Claude, or Perplexity to represent your product accurately, this is the file they're looking for.

### What it does

1. Crawls your site breadth-first from the start URL(s), respecting your page limit and URL include/exclude patterns.
2. Extracts the **main content** of each page with [trafilatura](https://github.com/adbar/trafilatura) — navigation, cookie banners, and boilerplate are stripped.
3. Writes **`llms.txt`** and **`llms-full.txt`** to the run's key-value store (direct download URLs).
4. Pushes a per-page dataset with URL, title, description, extracted content, and word count.

### Input

```json
{
  "startUrls": [{ "url": "https://docs.yourproduct.com" }],
  "maxPages": 50,
  "globs": ["/docs/**", "/guides/**"],
  "excludes": ["/blog/**", "/changelog/**"],
  "outputFormat": "markdown"
}
```

| Parameter | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array | *required* | Where to start crawling |
| `maxPages` | integer | 10 | Maximum pages to crawl |
| `globs` | array | `[]` (all) | Only crawl URLs matching these glob patterns |
| `excludes` | array | `[]` | Skip URLs matching these patterns |
| `outputFormat` | string | `markdown` | `markdown` or `plaintext` content extraction |
| `proxyConfiguration` | object | Apify proxy | Proxy settings |

### Output

**Key-value store** (downloadable files):

```
## Your Product Docs

> Documentation for Your Product — deployment, API reference, and guides.

- [Quickstart](https://docs.yourproduct.com/quickstart): Install and run in 5 minutes
- [API Reference](https://docs.yourproduct.com/api): REST endpoints and auth
- …
```

**Dataset** — one record per crawled page:

```json
{
  "url": "https://docs.yourproduct.com/quickstart",
  "title": "Quickstart",
  "description": "Install and run in 5 minutes",
  "content": "## Quickstart\n\nInstall the CLI…",
  "wordCount": 742
}
```

### Use cases

- **AI SEO / GEO (generative engine optimisation)** — make sure AI assistants describe your product from your own content, not third-party guesses.
- **Documentation portals** — publish `llms.txt` alongside your docs so AI coding assistants answer from the current version.
- **RAG ingestion** — `llms-full.txt` is a clean, deduplicated corpus of a whole site in one file; skip the scraping-and-cleaning step entirely.
- **Content audits** — the per-page dataset (titles, descriptions, word counts) doubles as a crawl report.
- **Agency deliverable** — generate llms.txt files for client sites as a productised service.

### Run it via API

```bash
curl "https://api.apify.com/v2/acts/darknezz~llms-txt-generator/run-sync?token=YOUR_TOKEN" \
  -X POST -H 'Content-Type: application/json' \
  -d '{"startUrls": [{"url": "https://example.com"}], "maxPages": 50}'
```

Then download `llms.txt` / `llms-full.txt` from the run's key-value store.

### Pricing

Pay-per-event: **$0.01 per page crawled and processed**. A 50-page documentation site costs about $0.50 per full regeneration. Re-run on a schedule to keep the files current.

### FAQ

**Where do I put the generated file?**
Upload `llms.txt` to your site root (`https://yoursite.com/llms.txt`), exactly like `robots.txt`. Serve `llms-full.txt` next to it if you want to expose full content.

**Does it work on JavaScript-heavy sites?**
It fetches server-rendered HTML. Sites that render all content client-side may yield thin extractions — most marketing sites and doc platforms work well.

**How is this different from a generic website scraper?**
Output is formatted to the llms.txt spec out of the box — index file plus full-content file — not raw HTML or generic JSON you still have to assemble.

**Can I limit it to one section of the site?**
Yes — use `globs` (e.g. `/docs/**`) and `excludes` to fence the crawl precisely.

**How often should I regenerate?**
Whenever content changes; most users schedule weekly. With per-page pricing, regeneration stays cheap.

# Actor input Schema

## `startUrls` (type: `array`):

URLs to start crawling from.

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

Maximum number of pages to crawl.

## `globs` (type: `array`):

Glob patterns for URLs to include (e.g. /docs/\*\*).

## `excludes` (type: `array`):

Glob patterns for URLs to exclude (e.g. /blog/\*\*).

## `outputFormat` (type: `string`):

Format for content extraction.

## `proxyConfiguration` (type: `object`):

Proxy settings for crawling.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "maxPages": 10,
  "globs": [],
  "excludes": [],
  "outputFormat": "markdown",
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `url` (type: `string`):

No description

## `title` (type: `string`):

No description

## `description` (type: `string`):

No description

## `content` (type: `string`):

No description

## `wordCount` (type: `string`):

No description

# 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 = {
    "startUrls": [
        {
            "url": "https://apify.com"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("darknezz/llms-txt-generator").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 = {
    "startUrls": [{ "url": "https://apify.com" }],
    "proxyConfiguration": { "useApifyProxy": True },
}

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

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

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

```

## CLI example

```bash
echo '{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call darknezz/llms-txt-generator --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=darknezz/llms-txt-generator",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/mHYRx3S1xnsBbbl5E/builds/HDhdn9mvapnmsegwY/openapi.json
