# Sitemap & llms.txt URL Extractor (`noclat/sitemap-llms-txt-extractor`) Actor

Get every URL a website publishes. Reads robots.txt, follows all sitemaps including sitemap indexes and gzipped files, probes the usual sitemap paths when robots.txt names none, and reads llms.txt and llms-full.txt. Filter by pattern or last-modified date.

- **URL**: https://apify.com/noclat/sitemap-llms-txt-extractor.md
- **Developed by:** [Martin CONTAL](https://apify.com/noclat) (community)
- **Stats:** 2 total users, 1 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 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 & llms.txt URL Extractor

Get **every URL a website publishes**, as clean structured data. Give it a domain; it reads `robots.txt`, follows every sitemap it names, walks sitemap indexes to the end, unpacks gzipped sitemaps, probes the usual sitemap paths when `robots.txt` declares none, and reads `llms.txt` and `llms-full.txt`. No browser, no crawling, no login.

Typical uses: SEO audits and content inventories, site migrations and redirect maps, change monitoring with the `lastmod` date, feeding a URL list to a scraper or a crawler, and AI agents building a corpus of a site's pages.

### Why this one

Sitemaps are a small format with a lot of edge cases, and most extractors fall over on them. This Actor handles the ones that actually break in production:

- **Sitemap indexes**, followed recursively, not just the first file.
- **Gzipped sitemaps** (`.xml.gz`), including servers that send them as `application/octet-stream` with no transparent decoding.
- **Plain-text sitemaps**, one URL per line, which the specification allows and parsers forget.
- **Servers that answer 200 with an HTML error page** where a sitemap should be. A missing `llms.txt` on a large site often returns a 60 KB HTML page with a success status; this Actor detects that and reports "not found" rather than returning nonsense.
- **Several `Sitemap:` directives** in one `robots.txt`, and relative paths in them.
- **Duplicate URLs** across sitemaps, removed per site.

### What you get for every URL

| Field | Example |
| --- | --- |
| `url` | `https://stripe.com/payments` |
| `site` | `https://stripe.com` |
| `lastmod` | `2026-09-18T09:11:59.922Z` (when the sitemap publishes it) |
| `changefreq`, `priority` | `weekly`, `0.8` |
| `source` | `robots`, `probe`, `sitemap-index`, `llms.txt` or `llms-full.txt` |
| `foundIn` | the exact sitemap or text file the URL came from |
| `title` | the link label, for `llms.txt` entries |
| `scrapedAt` | ISO date |

The run's key-value store also gets a `SUMMARY` record with, per website: the sitemaps found in `robots.txt`, the paths that were probed, how many sitemap files were read, any sitemap that failed and why, whether `llms.txt` exists, and how many URLs were found and returned.

### Input

```json
{
    "websites": ["stripe.com", "https://vercel.com"],
    "includeLlmsTxt": true,
    "excludePatterns": ["/tag/", "\\?"],
    "lastmodSince": "2026-01-01",
    "maxUrlsPerSite": 5000
}
```

- **websites**: domains or URLs. Anything you pass is reduced to its origin, so a deep link works.
- **includeLlmsTxt**: also read `/llms.txt` and `/llms-full.txt` and return the links they list, with their labels. On by default.
- **probeCommonPaths**: when `robots.txt` names no sitemap, try `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml` and a few more. On by default.
- **includePatterns** / **excludePatterns**: regular expressions applied to the URL. Filtered-out URLs are never charged.
- **lastmodSince**: keep only URLs changed on or after this date.
- **maxUrlsPerSite**, **maxUrls**, **maxSitemapsPerSite**: caps.

### Output example

```json
{
    "site": "https://stripe.com",
    "url": "https://stripe.com/payments",
    "lastmod": null,
    "changefreq": null,
    "priority": null,
    "source": "llms.txt",
    "foundIn": "https://stripe.com/llms.txt",
    "title": "Stripe Payments",
    "scrapedAt": "2026-09-21T20:05:00.000Z"
}
```

### What is llms.txt

`llms.txt` is a Markdown file at the root of a site that lists the pages worth reading, written for AI agents rather than search engines. Stripe publishes 307 links in theirs, Apify 72. It is the fastest way to get a site's own view of what matters, and almost no extractor reads it. This one does, and it tells you in `SUMMARY` whether the file exists at all.

### Pricing

Pay per event: **$1.01 per 1,000 URLs returned**, and platform usage is on us. Filters run before charging, so an exclude pattern or a `lastmodSince` only bills the URLs you keep. Use `maxUrls` or the run's maximum total charge to cap spend.

### Using it from an AI agent or via API

Input is a short JSON and output is a uniform list of URLs, which makes this a natural first step for an agent that has to work through a site: get the URL list here, then fetch the pages it actually needs. Call it through the [Apify API](https://docs.apify.com/api/v2), the [Apify MCP server](https://mcp.apify.com) or any Apify client, and read the default dataset.

### Legal and data policy

This Actor reads only files a site publishes for machines to read: `robots.txt`, its declared sitemaps, and `llms.txt`. It sends one plain HTTP request per file, follows redirects, and never renders or crawls pages. It collects no personal data.

### More tools

Same approach, same output discipline:

- **[ATS Jobs Scraper](https://apify.com/noclat/ats-jobs-scraper)** — every open role from any company’s Greenhouse, Lever or Ashby job board.
- **[Website Screenshot & PDF API](https://apify.com/noclat/website-screenshot-pdf)** — any public page rendered into an image or an A4 PDF.

### FAQ

**A website returns no URLs.** Check `SUMMARY`: it names the sitemaps found in `robots.txt`, the paths probed, and the reason each sitemap failed. Some sites publish no sitemap at all; this Actor will not crawl to invent one.

**Can it handle sites with hundreds of thousands of URLs?** Yes. Raise `maxSitemapsPerSite` and set `maxUrls` to the number you actually want, so you stay in control of the bill.

**How do I track changes over time?** Schedule the Actor and use `lastmodSince` with the date of your last run to get only what changed, which costs a fraction of a full pass.

**Which ATS, shop or CMS does it support?** All of them. It reads the standard files, so a WordPress, Shopify, Webflow, Next.js or hand-written site is the same to it.

# Actor input Schema

## `websites` (type: `array`):

Domains or URLs to read, for example "stripe.com" or "https://vercel.com". Anything you pass is reduced to its origin, so a deep link works too.

## `includeLlmsTxt` (type: `boolean`):

Also read /llms.txt and /llms-full.txt, the Markdown files sites publish to tell AI agents which pages matter, and return the links they list.

## `probeCommonPaths` (type: `boolean`):

When robots.txt names no sitemap, try /sitemap.xml, /sitemap\_index.xml, /wp-sitemap.xml and a few others.

## `includePatterns` (type: `array`):

Regular expressions. A URL is kept when it matches at least one of them. Leave empty to keep everything.

## `excludePatterns` (type: `array`):

Regular expressions. A URL matching any of them is dropped, and is never charged.

## `lastmodSince` (type: `string`):

Only keep URLs whose sitemap lastmod is on or after this date, for example 2026-01-01. URLs with no date are dropped.

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

Cap the number of URLs returned per website. Leave empty for no cap.

## `maxUrls` (type: `integer`):

Stop after this many URLs in total. Leave empty for no cap.

## `maxSitemapsPerSite` (type: `integer`):

Safety limit for very large sitemap indexes.

## Actor input object example

```json
{
  "websites": [
    "stripe.com",
    "vercel.com"
  ],
  "includeLlmsTxt": true,
  "probeCommonPaths": true,
  "maxSitemapsPerSite": 200
}
```

# Actor output Schema

## `results` (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 = {
    "websites": [
        "stripe.com",
        "vercel.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("noclat/sitemap-llms-txt-extractor").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 = { "websites": [
        "stripe.com",
        "vercel.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("noclat/sitemap-llms-txt-extractor").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 '{
  "websites": [
    "stripe.com",
    "vercel.com"
  ]
}' |
apify call noclat/sitemap-llms-txt-extractor --silent --output-dataset

```

## MCP server setup

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

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/nbF42Fkcc0BglHfRK/builds/rQXaekDvgo9MJdWSE/openapi.json
