# Sitemap Extractor + llms.txt & AI Crawler Checker (`panthalus/sitemap-robots-llms-txt`) Actor

Every URL in a site's sitemaps (with lastmod, priority, images), plus a site report: robots.txt rules, which AI crawlers (GPTBot, ClaudeBot, PerplexityBot...) are blocked, and the site's llms.txt parsed. Optional broken-link check.

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

## Pricing

from $0.30 / 1,000 urls

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/actors/running/actors-in-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

## Sitemap Extractor + llms.txt & AI Crawler Checker

![Sitemap and llms.txt Checker](https://api.apify.com/v2/key-value-stores/OUAKECfhX5Svhoo26/records/banner-sitemap-llms)

**Get every URL a website publishes, plus a one-row audit of how it treats crawlers and AI agents.** For each site the Actor:

- reads robots.txt;
- follows every sitemap (indexes, gzip, plain text) and returns the URLs with lastmod, changefreq, priority, image and hreflang counts;
- reports which AI crawlers (GPTBot, ClaudeBot, PerplexityBot, Google-Extended, CCBot and 13 more) are blocked;
- parses the site's `llms.txt` and checks for `llms-full.txt`.

### What people use it for

- **Seed lists for crawlers and RAG pipelines**: get the full URL list first, then crawl only what you need. Use `lastmodAfter` to fetch only pages changed since your last run.
- **Content and change monitoring**: schedule it to see new product pages, blog posts or docs a competitor published this week.
- **SEO audits**: sitemap coverage, stale lastmod dates, broken sitemap files, and broken or redirected URLs (`checkStatus`).
- **AI-readiness audits**: which sites publish `llms.txt`, and which block GPTBot or ClaudeBot. Run it over hundreds of domains with `summaryOnly` for a cheap one-row-per-site report.
- **Site migrations**: export the old site's full URL inventory for redirect mapping.

### Why this one

- **Reads only the files sites publish for machines** (robots.txt, sitemaps, llms.txt). It's fast, cheap and polite.
- **Status checks obey robots.txt.** It never fetches page content.
- **Handles real-world sitemaps:**
  - sitemap indexes with hundreds of children, `.xml.gz`, plain-text sitemaps and relative locations;
  - HTML error pages served as "sitemaps";
  - falls back to `/sitemap.xml`, `/sitemap_index.xml` and `/wp-sitemap.xml` when robots.txt declares none.
- **Safe parser.** XML entity bombs are rejected, and every file has a size cap.
- **Two row types, two views:** `site` reports and `url` rows.

### Input

| Field | What it does |
|---|---|
| `startUrls` | Domains or any URL on the site |
| `maxUrlsPerSite` | Default 50,000 |
| `summaryOnly` | Site report only, no URL rows |
| `urlIncludeRegex` / `urlExcludeRegex` | e.g. `/blog/` |
| `lastmodAfter` | YYYY-MM-DD: only new/changed URLs |
| `checkStatus`, `statusConcurrency` | HEAD-check each URL (robots-aware) |
| `checkLlmsTxt`, `includeLlmsLinks` | llms.txt parsing |

### Output

Site report:

```json
{ "type": "site", "site": "https://www.bbc.co.uk", "robotsTxtFound": true, "sitemapsDeclared": ["https://www.bbc.co.uk/sitemap.xml", "…"],
  "aiBotsBlocked": ["GPTBot", "ClaudeBot", "PerplexityBot", "CCBot", "…"], "allowsAllCrawlers": true,
  "llmsTxtFound": false, "llmsFullTxtFound": false, "sitemapFiles": 4, "urlCount": 3000, "urlsWithLastmod": 2950,
  "newestLastmod": "2026-11-06T09:12:00Z", "urlsReturned": 3000 }
```

URL row:

```json
{ "type": "url", "site": "https://www.gov.uk", "url": "https://www.gov.uk/…", "lastmod": "2026-11-05T10:00:00Z",
  "changefreq": null, "priority": null, "images": 0, "alternates": 0, "sitemap": "https://www.gov.uk/sitemaps/sitemap_1.xml", "status": 200 }
```

### Pricing

- **USD 0.30 per 1,000 URLs** and **USD 0.005 per site report**, plus USD 0.005 per run.
- Auditing 500 domains with `summaryOnly` costs about USD 2.50.
- A 50,000-URL site costs USD 15.

### Run it from code or an AI agent

Everything the Console does is one API call away. Get your token under **Settings > API & Integrations**.

**Python** (`pip install apify-client`)

```python
from apify_client import ApifyClient

client = ApifyClient("<APIFY_TOKEN>")
run = client.actor("panthalus/sitemap-robots-llms-txt").call(run_input={"startUrls": [{"url": "https://docs.stripe.com"}], "maxUrlsPerSite": 1000})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

**JavaScript** (`npm i apify-client`)

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

const client = new ApifyClient({ token: '<APIFY_TOKEN>' });
const run = await client.actor('panthalus/sitemap-robots-llms-txt').call({"startUrls": [{"url": "https://docs.stripe.com"}], "maxUrlsPerSite": 1000});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

**cURL** (runs the Actor and returns the results in one request)

```bash
curl -X POST "https://api.apify.com/v2/acts/panthalus~sitemap-robots-llms-txt/run-sync-get-dataset-items?token=<APIFY_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": [{"url": "https://docs.stripe.com"}], "maxUrlsPerSite": 1000}'
```

**AI agents (MCP).** Add this Actor as a tool in Claude, Cursor, VS Code or any MCP client:

```
https://mcp.apify.com?tools=panthalus/sitemap-robots-llms-txt
```

Then just ask, for example: *"Does nytimes.com block GPTBot or ClaudeBot, and does it publish an llms.txt?"* The Actor uses pay-per-event pricing with limited permissions, so it is eligible for Apify's agentic payments.

**Schedules and integrations.** Run it daily with an Apify Schedule, and send new rows to Google Sheets, Slack, Zapier, Make, n8n or a webhook from the **Integrations** tab.

### FAQ

**Will this get me blocked?** It requests a handful of small machine-readable files per site. Status checks are opt-in, rate-limited and skip anything robots.txt disallows.

**Use on any site?** The data comes from files that sites publish for crawlers. Some sites' terms restrict automated use of their content, so check the terms of sites you don't own before reusing the URLs or crawling the pages.

# Actor input Schema

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

Any URL on the site, starting with https://, e.g. https://stripe.com or https://docs.python.org/3/. One site report per domain.

## `maxUrlsPerSite` (type: `integer`):

Stop reading sitemaps after this many unique URLs per site. Empty = up to 50,000.

## `summaryOnly` (type: `boolean`):

Return one report per site (URL count, newest lastmod, llms.txt, AI-crawler rules) without the URL list. Cheapest way to audit many domains.

## `urlIncludeRegex` (type: `string`):

e.g. /blog/ or /products/. Applied to returned URL rows.

## `urlExcludeRegex` (type: `string`):

e.g. ?|/tag/|/page/\d+

## `lastmodAfter` (type: `string`):

Keep URLs whose sitemap lastmod is on or after this date: new and changed pages since your last run.

## `checkStatus` (type: `boolean`):

HEAD request per URL to find broken (4xx/5xx) and redirected sitemap entries. Slower.

## `statusConcurrency` (type: `integer`):

Parallel HEAD requests per site. Keep low to be polite.

## `checkLlmsTxt` (type: `boolean`):

Detects and parses /llms.txt (title, summary, sections, links) and checks /llms-full.txt.

## `includeLlmsLinks` (type: `boolean`):

Adds up to 500 links listed in llms.txt to the site report.

## `maxSitemapFiles` (type: `integer`):

Safety cap for huge sitemap indexes.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.stripe.com"
    },
    {
      "url": "https://docs.anthropic.com"
    }
  ],
  "maxUrlsPerSite": 100,
  "summaryOnly": false,
  "checkStatus": false,
  "statusConcurrency": 8,
  "checkLlmsTxt": true,
  "includeLlmsLinks": true,
  "maxSitemapFiles": 500
}
```

# Actor output Schema

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

Rows of type "site" (robots.txt, AI-crawler rules, llms.txt, sitemap summary) and type "url" (one sitemap URL with lastmod, priority, status).

# 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://docs.stripe.com"
        },
        {
            "url": "https://docs.anthropic.com"
        }
    ],
    "maxUrlsPerSite": 100
};

// Run the Actor and wait for it to finish
const run = await client.actor("panthalus/sitemap-robots-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 = {
    "startUrls": [
        { "url": "https://docs.stripe.com" },
        { "url": "https://docs.anthropic.com" },
    ],
    "maxUrlsPerSite": 100,
}

# Run the Actor and wait for it to finish
run = client.actor("panthalus/sitemap-robots-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 '{
  "startUrls": [
    {
      "url": "https://docs.stripe.com"
    },
    {
      "url": "https://docs.anthropic.com"
    }
  ],
  "maxUrlsPerSite": 100
}' |
apify call panthalus/sitemap-robots-llms-txt --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,panthalus/sitemap-robots-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/4etHC9zwgrdpQRUnA/builds/2LhuYGNwAyy8DUT4J/openapi.json
