# llms.txt Generator - Make Your Site AI-Discoverable (`dltik/llms-txt-generator`) Actor

Generate a standards-compliant llms.txt file for any website. Crawls your sitemap, extracts page titles & descriptions, groups them into sections, and outputs a clean llms.txt that helps ChatGPT, Claude, Gemini & Perplexity understand your site. Optional AI enrichment.

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

## Pricing

from $0.00005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Your Site AI-Discoverable

> ⭐ **Bookmark this actor** so you can re-generate your `llms.txt` every time your site changes — it takes one click and keeps your AI discoverability fresh.

Generate a standards-compliant **`llms.txt`** file for any website in seconds. This actor crawls your sitemap (or homepage), extracts every page's title and description, groups pages into clean sections, and outputs a ready-to-host `llms.txt` that helps **ChatGPT, Claude, Gemini, Perplexity** and other AI assistants understand and cite your site.

`llms.txt` is the emerging standard ([llmstxt.org](https://llmstxt.org)) for telling Large Language Models what your site is about and which pages matter — the AI-era equivalent of `robots.txt` + `sitemap.xml`.

### Why you need an llms.txt

AI assistants increasingly answer questions by reading the web. A clean `llms.txt` at `https://yoursite.com/llms.txt`:

- Tells LLMs what your site/company does in one sentence
- Points them to your most important pages with human-readable descriptions
- Improves how accurately AI tools summarize and **cite** you
- Is fast becoming a baseline GEO (Generative Engine Optimization) signal

### What this actor does

1. **Discovers your URLs** — reads `robots.txt` + `sitemap.xml` (and sitemap indexes). No sitemap? It falls back to crawling links from your homepage.
2. **Extracts metadata** — page title (`og:title` / `<title>`), meta description, `<h1>`, and `og:site_name`.
3. **Sections your site** — groups pages by path (`/blog`, `/docs`, `/pricing`, …) into a tidy table of contents.
4. **Optional AI enrichment** — a single LLM pass rewrites the site summary, regroups pages into logical sections, and adds concise descriptions where they're missing.
5. **Outputs `llms.txt`** — the full file is returned in the `llms_txt` field, ready to copy to your site root.

### Input

| Field | Type | Description |
|---|---|---|
| `url` | string (required) | Website to process, e.g. `https://stripe.com` |
| `maxPages` | integer | Max pages to include (1–300, default 100) |
| `includeSitemap` | boolean | Discover URLs from robots.txt + sitemap.xml (default true) |
| `crawlIfNoSitemap` | boolean | Crawl homepage links when no sitemap is found (default true) |
| `aiEnrich` | boolean | Run AI enrichment for summary + smart sections (default false) |
| `aiModel` | string | OpenRouter model for enrichment (default `google/gemini-2.0-flash-001`) |
| `siteName` | string | Optional override for the llms.txt title |
| `siteSummary` | string | Optional override for the one-line summary |

#### Example input

```json
{
  "url": "https://stripe.com",
  "maxPages": 100,
  "aiEnrich": true
}
````

### Output

One record per run:

```json
{
  "site_name": "Stripe",
  "host": "stripe.com",
  "page_count": 87,
  "section_count": 6,
  "ai_enriched": true,
  "llms_txt": "## Stripe\n\n> Financial infrastructure for the internet.\n\n### Main\n- [Pricing](https://stripe.com/pricing): Simple, transparent pricing...\n..."
}
```

Copy the `llms_txt` value into a file named `llms.txt` and host it at the root of your domain (`https://yoursite.com/llms.txt`).

### Pricing

Pay-per-event, no subscription:

- **Actor start** — $0.00005 per run
- **Page processed** — $0.005 per page included in the llms.txt
- **AI enrichment** — $0.05 per run (only when `aiEnrich` is enabled)

A typical 100-page site costs about **$0.50** structurally, or **$0.55** with AI enrichment.

### Use cases

- **SEO / GEO teams** — ship `llms.txt` across a portfolio of client sites in bulk.
- **Agencies** — add AI discoverability as a productized deliverable.
- **Founders / indie hackers** — make your docs and product pages legible to AI assistants.
- **Content sites** — surface your best articles to LLM crawlers.

### Next step: measure your AI visibility

Generating `llms.txt` is step one. To see how often AI assistants actually **mention and cite** your brand, run **[GEO Visibility Score](https://apify.com/dltik/geo-visibility-score)** — it computes a 0–100 GEO Score, mention rate, citation rate, and Share of Voice vs competitors across ChatGPT, Claude, Gemini and Perplexity.

***

Built by [dltik](https://apify.com/dltik). Pure HTTP — no browser, fast and cheap.

# Actor input Schema

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

The website to generate an llms.txt for (e.g. https://stripe.com). Use the root domain for full-site coverage.

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

Maximum number of pages to include in the llms.txt (1-300). Each processed page is billed.

## `includeSitemap` (type: `boolean`):

Discover URLs from robots.txt and sitemap.xml (recommended). Disable to force homepage crawling only.

## `crawlIfNoSitemap` (type: `boolean`):

Fall back to crawling links from the homepage when no sitemap is found.

## `aiEnrich` (type: `boolean`):

Use a single AI pass to write a site summary, group pages into logical sections, and add concise descriptions. Adds one ai-enrichment charge.

## `aiModel` (type: `string`):

OpenRouter model ID used for enrichment (only when AI enrichment is enabled).

## `siteName` (type: `string`):

Force a specific site name for the llms.txt H1. Leave empty to auto-detect from the homepage.

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

Force a specific one-line summary (the blockquote). Leave empty to auto-detect from the homepage meta description.

## Actor input object example

```json
{
  "url": "https://stripe.com",
  "maxPages": 100,
  "includeSitemap": true,
  "crawlIfNoSitemap": true,
  "aiEnrich": false,
  "aiModel": "google/gemini-2.0-flash-001"
}
```

# Actor output Schema

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

One record per run containing the generated llms.txt and metadata.

# 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 = {
    "url": "https://stripe.com"
};

// Run the Actor and wait for it to finish
const run = await client.actor("dltik/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 = { "url": "https://stripe.com" }

# Run the Actor and wait for it to finish
run = client.actor("dltik/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 '{
  "url": "https://stripe.com"
}' |
apify call dltik/llms-txt-generator --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "llms.txt Generator - Make Your Site AI-Discoverable",
        "description": "Generate a standards-compliant llms.txt file for any website. Crawls your sitemap, extracts page titles & descriptions, groups them into sections, and outputs a clean llms.txt that helps ChatGPT, Claude, Gemini & Perplexity understand your site. Optional AI enrichment.",
        "version": "1.0",
        "x-build-id": "TQHc1H8cWrTqnY7I2"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/dltik~llms-txt-generator/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-dltik-llms-txt-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/dltik~llms-txt-generator/runs": {
            "post": {
                "operationId": "runs-sync-dltik-llms-txt-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/dltik~llms-txt-generator/run-sync": {
            "post": {
                "operationId": "run-sync-dltik-llms-txt-generator",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "url"
                ],
                "properties": {
                    "url": {
                        "title": "Website URL",
                        "type": "string",
                        "description": "The website to generate an llms.txt for (e.g. https://stripe.com). Use the root domain for full-site coverage."
                    },
                    "maxPages": {
                        "title": "Max pages",
                        "minimum": 1,
                        "maximum": 300,
                        "type": "integer",
                        "description": "Maximum number of pages to include in the llms.txt (1-300). Each processed page is billed.",
                        "default": 100
                    },
                    "includeSitemap": {
                        "title": "Use sitemap",
                        "type": "boolean",
                        "description": "Discover URLs from robots.txt and sitemap.xml (recommended). Disable to force homepage crawling only.",
                        "default": true
                    },
                    "crawlIfNoSitemap": {
                        "title": "Crawl if no sitemap",
                        "type": "boolean",
                        "description": "Fall back to crawling links from the homepage when no sitemap is found.",
                        "default": true
                    },
                    "aiEnrich": {
                        "title": "AI enrichment",
                        "type": "boolean",
                        "description": "Use a single AI pass to write a site summary, group pages into logical sections, and add concise descriptions. Adds one ai-enrichment charge.",
                        "default": false
                    },
                    "aiModel": {
                        "title": "AI model",
                        "type": "string",
                        "description": "OpenRouter model ID used for enrichment (only when AI enrichment is enabled).",
                        "default": "google/gemini-2.0-flash-001"
                    },
                    "siteName": {
                        "title": "Site name override (optional)",
                        "type": "string",
                        "description": "Force a specific site name for the llms.txt H1. Leave empty to auto-detect from the homepage."
                    },
                    "siteSummary": {
                        "title": "Site summary override (optional)",
                        "type": "string",
                        "description": "Force a specific one-line summary (the blockquote). Leave empty to auto-detect from the homepage meta description."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
