# Ultra-Fast Sitemap, Sitemap-Index & robots.txt URL Extractor (`forgekit/sitemap-robots-extractor`) Actor

Zero-browser XML, .xml.gz, RSS, Atom, TXT sitemap & robots.txt extractor with Content-Signal/Agentmap parsing, lastmod filtering, deduplication, and Standby MCP.

- **URL**: https://apify.com/forgekit/sitemap-robots-extractor.md
- **Developed by:** [James Edmans](https://apify.com/forgekit) (community)
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.21 / 1,000 sitemap urls extracted

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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

## Ultra-Fast Sitemap, Sitemap-Index & `robots.txt` URL Extractor

> **Apify Store Actor:** `forgekit/sitemap-robots-extractor` | **Runtime:** Node.js 22 (`256–512 MB`, zero-browser) | **Billing:** Pay-Per-Event (PPE) + Standby MCP Server

### Overview

**Ultra-Fast Sitemap, Sitemap-Index & `robots.txt` URL Extractor** is an anti-fragile, zero-CAPTCHA technical SEO URL discovery engine engineered for SEO agencies, data engineers, RAG ingestion pipelines, and AI coding agents. Pass bare root domains (`https://apify.com`) or direct sitemap URLs (`.xml`, `.xml.gz`, `.txt`, RSS 2.0, Atom) to automatically discover sitemaps via `robots.txt` and common fallback cascades, recursively traverse nested `<sitemapindex>` trees with cycle protection, transparently gunzip `.xml.gz` files with a 50 MB zip-bomb cap, recover from malformed unescaped `&` entities, filter and deduplicate URLs **before billing**, and evaluate every extracted URL against RFC 9309 `robots.txt` rules plus 2026 `Content-Signal` and `Agentmap` directives.

Because extraction runs purely on lightweight HTTP + `fast-xml-parser` on `256–512 MB` RAM (no headless Chromium, no residential proxies, and fast default `checkHttpStatus: false`), it eliminates the high timeout/abort rates and 4 GB memory bloat common to legacy sitemap crawlers.

### Features vs Competitors

- **Zero-Config Discovery Cascade:** Reads `robots.txt` (`Sitemap:`, `User-agent`, `Allow`/`Disallow`, `Crawl-delay`, `Content-Signal`, `Agentmap`) and automatically falls back to `/sitemap_index.xml`, `/sitemap.xml`, `/wp-sitemap.xml`, `/sitemap.xml.gz`, and `/sitemap-index.xml`.
- **Multi-Format & `.xml.gz` Resilient Parser:** Auto-detects gzip magic bytes (`0x1f 0x8b`) with a 50 MB decompression guard, strips UTF-8 BOMs, sanitizes bare unescaped `&` query parameters, and parses `<sitemapindex>`, `<urlset>`, RSS 2.0, Atom, and plain-text sitemaps.
- **Full SEO XML Extension Extraction:** Captures `<lastmod>`, `<changefreq>`, `<priority>`, `xhtml:link` (`hreflangAlternates`), `<image:image>` counts & primary image URLs, and Google `<news:news>` titles.
- **Pre-Charge Filtering & Deduplication:** Applies `includePatterns`, `excludePatterns`, `modifiedAfter`, `modifiedBefore`, and canonical URL deduplication **before** pushing dataset rows or charging `url-extracted`.
- **Optional Live Liveness Verification (`HEAD` → `GET` Fallback):** When `checkHttpStatus: true`, probes kept URLs concurrently with automatic `GET` fallback on `405`/`403`/`501`/`400` responses.
- **Native Standby MCP Server:** Expose `discover_sitemaps` and `extract_sitemap_urls` directly to Claude Desktop, Cursor, and autonomous AI workflows.

| Capability | `apify/sitemap-extractor` (★3.24) | `boxbox10/sitemap-extractor` | **Ultra-Fast Sitemap & `robots.txt` Extractor** |
|---|:---:|:---:|:---:|
| Auto-discover sitemaps from `robots.txt` + common fallbacks | Partial | No | **Yes (Full Cascade)** |
| Recursive nested `<sitemapindex>` + `.xml.gz` gunzip + cycle guard | Flaky | No | **Yes (50 MB zip-bomb cap)** |
| Extracts `lastmod`, `priority`, `hreflang`, `image:image`, `news:news` | Partial | Minimal | **Yes (Full XML Extensions)** |
| Supports TXT, RSS 2.0 & Atom sitemaps | No | No | **Yes** |
| Pre-charge `lastmod` date range + regex filtering + deduplication | No | No | **Yes (Pay only for kept URLs)** |
| Full `robots.txt` parser (`Allow`/`Disallow`, `Content-Signal`, `Agentmap`) | No | No | **Yes (`ROBOTS_REPORT` KV artifact)** |
| Optional live HTTP status check (`HEAD` → `GET` fallback) | Slow default | No | **Yes (Fast opt-in)** |
| Memory footprint & pricing per 1,000 URLs | 4096 MB / `$0.50` | 4096 MB | **256–512 MB / `$0.30`** |
| Standby MCP Server | No | No | **Yes (`/mcp`)** |

### Input Configuration

| Field | Type | Required | Default | Description |
|---|---|---|---|---|
| `targets` | `string[]` | Yes | `["https://apify.com"]` | Root domains or direct sitemap URLs (`.xml`, `.xml.gz`, `.txt`, RSS, Atom; 1–100 items). |
| `maxUrlsPerTarget` | `integer` | No | `5000` | Hard cap on emitted URLs per input target (`1–200000`). |
| `maxIndexDepth` | `integer` | No | `4` | Max recursion depth for nested `<sitemapindex>` trees (`1–10`). |
| `includePatterns` | `string[]` | No | `[]` | Regex or substring patterns a URL must match to be kept (up to 50 patterns, max 200 chars each). |
| `excludePatterns` | `string[]` | No | `[]` | Regex or substring patterns used to exclude URLs before billing (up to 50 patterns). |
| `modifiedAfter` | `string` | No | `""` | ISO-8601 date (`YYYY-MM-DD` or timestamp); keep only URLs with `lastmod >= modifiedAfter`. |
| `modifiedBefore` | `string` | No | `""` | ISO-8601 date; keep only URLs with `lastmod <= modifiedBefore`. |
| `evaluateRobotsRules` | `boolean` | No | `true` | Parse host `robots.txt` and annotate each URL with `allowedForWildcard` and `allowedForGooglebot`. |
| `checkHttpStatus` | `boolean` | No | `false` | Optional live HTTP `HEAD` (with `GET` fallback) check per kept URL. |
| `deduplicateUrls` | `boolean` | No | `true` | Deduplicate identical URLs across overlapping child sitemaps before charging. |
| `maxConcurrency` | `integer` | No | `10` | Max concurrent child sitemap and status HTTP requests (`1–50`). |
| `timeoutSecs` | `integer` | No | `15` | Per-request HTTP timeout in seconds (`3–60`). |

### Output Example

Each extracted URL is stored in the default Apify Dataset with full SEO extension metadata and `robots.txt` evaluation. Below is an authentic output item captured from a real local execution of this Actor:

```json
{
  "target": "https://apify.com",
  "url": "https://apify.com/docs/actors",
  "sourceSitemap": "https://apify.com/sitemap.xml.gz",
  "sitemapFormat": "urlset",
  "lastmod": "2026-11-28",
  "changefreq": "weekly",
  "priority": 0.9,
  "hreflangAlternates": [
    {
      "lang": "en-US",
      "href": "https://apify.com/docs/actors"
    },
    {
      "lang": "de-DE",
      "href": "https://apify.com/de/docs/actors"
    }
  ],
  "imageCount": 1,
  "primaryImageUrl": "https://apify.com/img/actors.png",
  "newsTitle": null,
  "allowedForWildcard": true,
  "allowedForGooglebot": true,
  "httpStatus": null,
  "redirectUrl": null,
  "extractedAt": "2026-12-01T20:43:42.700Z"
}
```

Additional Key-Value Store artifacts saved per run:

- `ROBOTS_REPORT`: Parsed `robots.txt` objects per host (`sitemaps`, `agentGroups`, `contentSignals`, `agentmaps`, `crawlDelay`).
- `SUMMARY`: Run totals (`sitemapsDiscovered`, `sitemapsParsed`, `gzippedSitemaps`, `duplicatesSkipped`, `filteredOut`, per-target status).
- `PPE_LEDGER`: Exact local Pay-Per-Event billing ledger.

### Pay-Per-Event (PPE) Pricing

| Event Key | Event Title | Price (USD) | Billing Trigger |
|---|---|---:|---|
| `actor-start` | Actor Run Start | `$0.002` | Charged once per batch run start when billable URLs are produced (`$0.00` on empty/no-sitemap runs). |
| `url-extracted` | Sitemap URL Extracted | `$0.0003` | Charged per filtered, deduplicated URL pushed to the dataset (`$0.30` per 1,000 URLs). |
| `url-status-checked` | Optional HTTP Status Check | `$0.0003` | Additional charge per URL only when `checkHttpStatus: true`. |
| `mcp-tool-call` | Standby MCP Tool Call | `$0.002` | Charged per successful Standby MCP `tools/call` invocation. |

**Illustrative Cost Example:** Extracting `1,000` filtered, deduplicated URLs in fast default mode (`checkHttpStatus: false`) costs `$0.002 + (1,000 × $0.0003) = $0.302 USD` — 40% cheaper than `apify/sitemap-extractor` and 100× cheaper than `$0.03/URL` competitors.

### Standby MCP Server & AI Agent Integration

Run this Actor in Apify Standby Mode (`APIFY_META_ORIGIN=STANDBY`) to connect it directly to Claude Desktop, Cursor, or any MCP-compatible AI agent over Streamable HTTP / SSE:

- **Health endpoint:** `GET /health`
- **MCP JSON-RPC 2.0 endpoint:** `POST /mcp` and `GET /mcp`
- **Exposed MCP tools:**
  - `discover_sitemaps` — Parse `robots.txt` (`User-agent`, `Sitemap`, `Content-Signal`, `Agentmap`) and probe common sitemap endpoints.
  - `extract_sitemap_urls` — Extract up to `5,000` filtered, deduplicated URLs with full SEO metadata from a domain or sitemap URL.

```json
{
  "mcpServers": {
    "sitemap-robots-extractor": {
      "url": "https://forgekit--sitemap-robots-extractor.apify.actor/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

### Error Handling, Rate Limits & Limitations

- **Strict SSRF Protection:** Only `http:` and `https:` schemes are permitted. Initial URLs, redirect hops, nested child sitemaps, and `<loc>` entries resolving to loopback (`127.0.0.0/8`, `::1`, `localhost`), RFC 1918 private ranges, CGNAT, or cloud metadata (`169.254.169.254`) are strictly blocked.
- **Zero-Result Non-Billing:** If a domain has no discoverable sitemap (`status: "no_sitemap_found"`) or all URLs are filtered out before emission, `$0.00` is charged while `SUMMARY` and `ROBOTS_REPORT` are still written cleanly.
- **Polite Retries & Caps:** Respects `Retry-After` headers on `429`/`503` responses with exponential backoff, enforces a 50 MB gzip decompression limit, rejects invalid or ReDoS regex patterns at input validation, and respects `ACTOR_MAX_TOTAL_CHARGE_USD` budget limits.

### Quick Start & Example Input

#### 1. Run in Apify Console (No Code)

1. Open **[`forgekit/sitemap-robots-extractor`](https://apify.com/forgekit/sitemap-robots-extractor)** in Apify Console and click **Try for free**.
2. Paste or adjust the ready-to-run input JSON below (safe defaults are pre-filled).
3. Click **Start** and export results as **JSON, CSV, Excel, or NDJSON** from the **Output** tab.

```json
{
  "targets": [
    "https://apify.com"
  ]
}
```

#### 2. Run via API (`apify-client` — Node.js & Python)

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

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('forgekit/sitemap-robots-extractor').call({"targets":["https://apify.com"]});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

```python
from apify_client import ApifyClient
import os

client = ApifyClient(os.environ["APIFY_TOKEN"])
run = client.actor("forgekit/sitemap-robots-extractor").call(run_input={"targets":["https://apify.com"]})
items = list(client.dataset(run["defaultDatasetId"]).iterate_items())
print(items)
```

#### 3. Connect to n8n, Make, Zapier & Webhooks

- **n8n / Make / Zapier:** Add the official **Apify** module, choose **Run Actor**, select `forgekit/sitemap-robots-extractor`, and pass the JSON payload above.
- **Schedules & Webhooks:** Attach an Apify Schedule for recurring runs and trigger downstream webhooks automatically on `ACTOR.RUN.SUCCEEDED`.

### Use Cases — What Can You Do With This Data?

- **Technical SEO & Agency Site Audits:** Run fast, automated checks with **Ultra-Fast Sitemap, Sitemap-Index & robots.txt URL Extractor** across client domains to catch broken links, redirect chains, sitemap/canonical defects, and Core Web Vitals regressions.
- **AI-Search (GEO) & RAG Optimization:** Verify `llms.txt`, AI crawler policies (`GPTBot`, `ClaudeBot`, `PerplexityBot`), and clean Markdown readability so content ranks in both Google and AI answer engines.
- **EU Accessibility Act (EAA) & WCAG Compliance:** Audit public web pages systematically and generate structured compliance reports for engineering and legal sign-off.
- **CI/CD & Scheduled Monitoring:** Run weekly regression audits via Apify Schedules or GitHub Actions and export results straight into Looker Studio, BigQuery, Sheets, or Slack alerts.

### Frequently Asked Questions (FAQ)

#### How much does Ultra-Fast Sitemap, Sitemap-Index & robots.txt URL Extractor cost to run?

You only pay for actual output via transparent Pay-Per-Event billing (starting at `$0.0003` per `url-extracted` (Sitemap URL Extracted); see the PPE Pricing table above). Runs that produce zero billable results or fail upstream incur **`$0.00`** — including zero `actor-start` fee — and Apify's built-in **Max total charge** (`ACTOR_MAX_TOTAL_CHARGE_USD`) hard-caps spend automatically.

#### Does this Actor require proxies, logins, or CAPTCHA solving?

No. This Actor inspects publicly accessible web pages, sitemaps, `robots.txt`, and `llms.txt` using polite HTTP or real Chromium/CDP audits — strictly respecting SSRF boundaries and never bypassing authentication or anti-bot gates.

#### What export formats and integrations are supported?

Every run stores structured results in an Apify Dataset downloadable as **JSON, CSV, Excel (XLSX), NDJSON, XML, or HTML Table** via Console or REST API, plus native connectors for **n8n, Make, Zapier, Google Sheets, Airtable, Slack, and webhooks**.

#### Can AI agents (Claude Desktop, Cursor, ChatGPT, LangChain) call this Actor directly via MCP?

Yes! **Ultra-Fast Sitemap, Sitemap-Index & robots.txt URL Extractor** includes a built-in **Standby MCP Server** at `https://forgekit--sitemap-robots-extractor.apify.actor/mcp` supporting JSON-RPC 2.0 (`initialize`, `ping`, `tools/list`, `tools/call`) with Claude-compliant `^[a-zA-Z0-9_.-]{1,64}$` tool schemas.

#### How does it protect against runaway costs or bad inputs?

Every input is strictly validated upfront with Zod schemas before any work starts, user-supplied URLs pass SSRF protection blocking private/cloud-metadata IPs, and streaming `BudgetGuard` enforcement stops immediately once your result or USD budget cap is reached.

#### How fast and lightweight is it compared to browser scrapers?

It runs on lightweight **Node.js 22** (256–512 MB RAM, zero headless browser) so typical runs finish in seconds with high reliability and low platform compute cost.

### Related `forgekit` Actors

Explore companion Actors in **Technical SEO, AI-Search & Compliance** and core ETL utilities to chain end-to-end pipelines:

| Actor | Store Slug | Mode |
|---|---|---|
| [Bulk Broken Link (404/5xx) & Multi-Hop Redirect Chain Tracer](https://apify.com/forgekit/broken-link-redirect-tracer) | `forgekit/broken-link-redirect-tracer` | Batch REST API |
| [Fast Zero-Browser On-Page Technical SEO Auditor (0–100 Score + JSON-LD + Hreflang)](https://apify.com/forgekit/fast-technical-seo-auditor) | `forgekit/fast-technical-seo-auditor` | ✅ Standby MCP |
| [llms.txt & AI-Search (GEO) Readiness Auditor — AI Bot Access, Content-Signal & RAG Score](https://apify.com/forgekit/llms-txt-geo-auditor) | `forgekit/llms-txt-geo-auditor` | ✅ Standby MCP |
| [Bulk WCAG 2.2 & EU Accessibility Act (EAA) Compliance Auditor (axe-core + EN 301 549)](https://apify.com/forgekit/wcag-eaa-accessibility-auditor) | `forgekit/wcag-eaa-accessibility-auditor` | Batch REST API |
| [Bulk Core Web Vitals (LCP/INP/CLS) & Lighthouse Performance Auditor — Desktop & Mobile](https://apify.com/forgekit/core-web-vitals-lighthouse-auditor) | `forgekit/core-web-vitals-lighthouse-auditor` | Batch REST API |
| [Dataset Merge, Fuzzy Dedupe & Cross-Join Pro](https://apify.com/forgekit/dataset-merge-dedupe-pro) | `forgekit/dataset-merge-dedupe-pro` | ✅ Standby MCP |
| [Dataset Diff & Change Detector (Added / Removed / Modified)](https://apify.com/forgekit/dataset-diff-change-detector) | `forgekit/dataset-diff-change-detector` | ✅ Standby MCP |

# Actor input Schema

## `targets` (type: `array`):

Root domains (e.g. https://apify.com or apify.com) or direct sitemap URLs (.xml, .xml.gz, .txt, RSS, Atom).

## `maxUrlsPerTarget` (type: `integer`):

Hard cap on filtered, deduplicated URLs emitted per input target.

## `maxIndexDepth` (type: `integer`):

Maximum recursion depth when traversing nested <sitemapindex> trees.

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

Optional regex or substring patterns that a URL must match to be kept before billing.

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

Optional regex or substring patterns used to exclude matching URLs before billing.

## `modifiedAfter` (type: `string`):

Keep only URLs whose <lastmod> is on or after this ISO-8601 date (YYYY-MM-DD or timestamp).

## `modifiedBefore` (type: `string`):

Keep only URLs whose <lastmod> is on or before this ISO-8601 date (YYYY-MM-DD or timestamp).

## `evaluateRobotsRules` (type: `boolean`):

Parse host robots.txt (including Content-Signal and Agentmap) and annotate each URL with allowedForWildcard and allowedForGooglebot.

## `checkHttpStatus` (type: `boolean`):

Optional live HTTP HEAD (with GET fallback on 405/403/501) liveness verification per kept URL (adds $0.0003/url PPE).

## `deduplicateUrls` (type: `boolean`):

Deduplicate identical URLs across overlapping child sitemaps before emitting and billing.

## `maxConcurrency` (type: `integer`):

Maximum concurrent HTTP requests for child sitemaps and optional status probes.

## `timeoutSecs` (type: `integer`):

Per-request HTTP timeout in seconds.

## Actor input object example

```json
{
  "targets": [
    "https://apify.com"
  ],
  "maxUrlsPerTarget": 250,
  "maxIndexDepth": 4,
  "includePatterns": [],
  "excludePatterns": [],
  "modifiedAfter": "",
  "modifiedBefore": "",
  "evaluateRobotsRules": true,
  "checkHttpStatus": false,
  "deduplicateUrls": true,
  "maxConcurrency": 10,
  "timeoutSecs": 15
}
```

# Actor output Schema

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

No description

## `robotsReport` (type: `string`):

No description

## `summary` (type: `string`):

No description

## `runSummary` (type: `string`):

No description

## `ppeLedger` (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 = {
    "targets": [
        "https://apify.com"
    ],
    "maxUrlsPerTarget": 250
};

// Run the Actor and wait for it to finish
const run = await client.actor("forgekit/sitemap-robots-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 = {
    "targets": ["https://apify.com"],
    "maxUrlsPerTarget": 250,
}

# Run the Actor and wait for it to finish
run = client.actor("forgekit/sitemap-robots-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 '{
  "targets": [
    "https://apify.com"
  ],
  "maxUrlsPerTarget": 250
}' |
apify call forgekit/sitemap-robots-extractor --silent --output-dataset

```

## MCP server setup

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