# Sitemap URL Extractor: robots.txt, Index & Gzip Sitemaps (`blond_terrarium/sitemap-url-extractor-pro`) Actor

Get every URL from a website's sitemaps. Auto-discovers sitemaps via robots.txt and common paths, follows sitemap indexes, reads .xml, .xml.gz, .txt, RSS and Atom, and de-duplicates. Filter by pattern or lastmod. Pay only per unique URL delivered.

- **URL**: https://apify.com/blond_terrarium/sitemap-url-extractor-pro.md
- **Developed by:** [Mogul Tools](https://apify.com/blond_terrarium) (community)
- **Categories:** SEO tools, Developer tools, AI
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.10 / 1,000 url extracteds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 URL Extractor: Every URL from robots.txt, Sitemap Indexes & .xml.gz (Pay Only per Unique URL)

Give it a domain and get back **every URL the site publishes in its sitemaps**, de-duplicated, with `lastmod`, `changefreq` and `priority`. Sitemaps are found automatically through `robots.txt` and common locations, nested **sitemap indexes** are followed, and **gzip (.xml.gz)**, plain-text, RSS and Atom sitemaps all work. **You pay only for unique URLs delivered.** Duplicates, filtered URLs, failed sitemaps and errors cost $0.

Use it as a **sitemap scraper / sitemap.xml parser**, a **"list all pages of a website" tool**, a **URL finder for RAG and LLM ingestion**, or a **new-page monitor** for competitors. No browser, no crawling, so it's fast and cheap.

### Quick start (about 30 seconds)

1. Enter one or more domains in **Websites or sitemap URLs** (for example `nodejs.org`).
2. Optional: add an **Include URL pattern** like `/blog/` or a **Modified since** date.
3. Click **Start** and export the URL list as CSV, Excel or JSON, or pipe it into another Actor.

### What can it do?

- 🔎 **Auto-discovery**: reads `Sitemap:` lines in robots.txt, then tries `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`, `/sitemap.xml.gz` and `/sitemap.txt`
- 🗂️ **Sitemap indexes**: follows nested indexes (WordPress, Yoast, Shopify, Next.js and so on) up to a depth you choose
- 🗜️ **Gzip, text, RSS & Atom**: `.xml.gz` is detected by content, not just by file name
- ♻️ **De-duplication** across all sitemaps and inputs
- 🎯 **Filters**: include/exclude regex, same-domain only, and "modified since" by `lastmod`
- 🖼️ Optional **image sitemap entries** and **hreflang alternates**
- 🛡️ **Polite and safe**: per-host delay, honors robots.txt Crawl-delay and Retry-After, retries 429/5xx with backoff, and blocks private/internal addresses
- ⚡ **Fast and light**: pure HTTP with no browser. In our tests it pulled about 172,000 URLs from 108 sitemaps in 30 s, and over 1 million URLs in a single run

### Who uses it?

- **SEO**: audit indexable pages, find orphan pages, and compare sitemap URLs with crawled URLs
- **Content & competitor monitoring**: get new URLs since a date (`modifiedSince`) on a schedule
- **Scraping pipelines**: feed product or article URLs into any other Actor
- **AI/RAG**: build a URL list of docs sites for ingestion

### Popular recipes

| Goal | Input |
|---|---|
| All blog posts of a competitor | `"includeUrlPatterns": ["/blog/"]` |
| New pages published this month (schedule weekly) | `"modifiedSince": "2026-10-01"` |
| All product URLs of a Shopify store | `"includeUrlPatterns": ["/products/"]` |
| Docs URLs to feed a RAG / LLM pipeline | `"startUrls": ["docs.example.com"], "sameDomainOnly": true` |
| Every language version of a page | `"includeAlternates": true` |
| Quick sample of a huge site | `"maxUrls": 1000` |

### How much does it cost?

Pay per unique URL delivered: **$0.40 per 1,000** on Free, $0.30 on Starter, $0.20 on Scale, and $0.10 on Business. There are no platform-usage fees on top.

| URLs | Free-plan price |
|---|---|
| 1,000 | $0.40 |
| 10,000 | $4.00 |
| 100,000 | $40.00 |

Big sites can have millions of URLs, so set **Max URLs** or **Max total charge** on the run. The Actor stops cleanly at the cap.

### Input

```json
{
  "startUrls": ["https://www.djangoproject.com", "nodejs.org", "https://example.com/sitemap_index.xml"],
  "includeUrlPatterns": ["/blog/"],
  "modifiedSince": "2026-01-01",
  "maxUrls": 50000
}
```

Inputs can be domains, page URLs, robots.txt URLs, or direct sitemap/RSS URLs.

### Output

```json
{
  "url": "https://nodejs.org/en/blog",
  "lastmod": "2026-10-21T12:15:15.044Z",
  "changefreq": "always",
  "priority": null,
  "host": "nodejs.org",
  "sitemapUrl": "https://nodejs.org/sitemap.xml",
  "sitemapFormat": "xml",
  "input": "https://nodejs.org",
  "extractedAt": "2026-10-22T00:58:23.391Z"
}
```

A **SUMMARY** record in the key-value store lists, per input, where its sitemaps were found, which sitemaps failed and why, and the duplicate and filter counts. Export as JSON, CSV or Excel, or call it via API, MCP, Make, Zapier or n8n.

### Use it from code (API)

```bash
curl -X POST "https://api.apify.com/v2/acts/blond_terrarium~sitemap-url-extractor-pro/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls":["nodejs.org"],"maxUrls":1000}'
```

Python:

```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("blond_terrarium/sitemap-url-extractor-pro").call(run_input={"startUrls": ["nodejs.org"], "includeUrlPatterns": ["/blog/"]})
urls = [i["url"] for i in client.dataset(run["defaultDatasetId"]).iterate_items()]
```

### Use it from AI agents (MCP)

This Actor is available as a tool through the Apify MCP server (`https://mcp.apify.com`). In Claude, Cursor or ChatGPT, ask: *"List every URL in the sitemap of example.com that contains /docs/ using blond_terrarium/sitemap-url-extractor-pro."* It's a cheap first step before scraping or summarizing a site, so an agent doesn't have to crawl blindly.

### Chain it with other Actors

- **Sitemap → content for RAG**: pass the URLs to a website-content / markdown crawler.
- **Sitemap → screenshots**: send URLs to [Bulk Website Screenshot](https://apify.com/blond_terrarium/bulk-website-screenshot).
- **Sitemap → link audit**: run [Broken Link Checker](https://apify.com/blond_terrarium/broken-link-checker-pro) on the same site.
- Works with Zapier, Make, n8n, Google Sheets and webhooks.

### How it compares

| | This Actor | Crawling the site | Basic sitemap parsers |
|---|---|---|---|
| Finds sitemaps via robots.txt + common paths | ✅ | n/a | often only `/sitemap.xml` |
| Nested sitemap indexes + .xml.gz | ✅ | n/a | partial |
| De-duplicated, with lastmod/changefreq/priority | ✅ | no lastmod | varies |
| Speed on a 100k-URL site | seconds | hours | varies |
| Pay only for unique URLs delivered | ✅ | pay per page crawled | varies |

### FAQ

**A site returned no URLs. Why?** Some sites publish no sitemap at all (python.org, for example). The SUMMARY record shows "No sitemap found" for those, and you aren't charged.

**Does it crawl pages?** No. It only reads sitemaps, which keeps it fast and cheap. To crawl links, use a crawler or a broken-link checker.

**Can I pass a sitemap URL directly?** Yes, `https://example.com/sitemap_index.xml`, a robots.txt URL or an RSS feed URL all work.

**Can I monitor new pages?** Yes. Save a Task with `modifiedSince` and add a Schedule; or diff two runs.

**How do I cap spend on giant sites?** Set **Max URLs** or **Max total charge**. The Actor stops cleanly.

**Is it allowed?** Sitemaps are published so machines can read them. The Actor identifies itself honestly, respects robots.txt when probing, and is for public data only.

# Actor input Schema

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

Domains (example.com), any page URL, a robots.txt URL, or a direct sitemap/index/RSS URL (.xml, .xml.gz, .txt). Sitemaps are discovered automatically for domains.

## `discoverFromRobotsTxt` (type: `boolean`):

Read 'Sitemap:' lines from /robots.txt.

## `tryCommonPaths` (type: `boolean`):

If robots.txt lists none, try /sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml, /sitemap.xml.gz, /sitemap.txt.

## `respectRobotsTxt` (type: `boolean`):

Skip probing common paths that robots.txt disallows.

## `sameDomainOnly` (type: `boolean`):

Drop URLs whose host is not the input domain or its subdomain.

## `includeUrlPatterns` (type: `array`):

Keep only URLs matching at least one pattern, e.g. /blog/ or /products/. Filtered URLs are not charged.

## `excludeUrlPatterns` (type: `array`):

Drop URLs matching any pattern. Not charged.

## `modifiedSince` (type: `string`):

Keep only URLs whose lastmod date is on/after this date, e.g. 2026-01-01. URLs without lastmod are dropped when set.

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

Stop after this many unique URLs. Also set 'Max total charge' to cap spend.

## `includeImages` (type: `boolean`):

Add image entries from image sitemaps (image:image) to each row.

## `includeAlternates` (type: `boolean`):

Add hreflang alternate-language URLs (xhtml:link) to each row.

## `maxSitemaps` (type: `integer`):

Safety cap on sitemap files fetched per run.

## `maxDepth` (type: `integer`):

How deep to follow nested sitemap indexes.

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

Sitemaps fetched in parallel (requests to the same host are still spaced out).

## `requestDelayMs` (type: `integer`):

Politeness delay. A robots.txt Crawl-delay is honored if larger (max 10 s).

## `requestTimeoutSecs` (type: `integer`):

Per-sitemap download timeout.

## `maxRetries` (type: `integer`):

Retries for timeouts, 429 and 5xx (with backoff).

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

Optional. Only needed if a site blocks datacenter IPs. Proxy traffic is billed by Apify separately.

## Actor input object example

```json
{
  "startUrls": [
    "https://www.djangoproject.com",
    "https://nodejs.org"
  ],
  "discoverFromRobotsTxt": true,
  "tryCommonPaths": true,
  "respectRobotsTxt": true,
  "sameDomainOnly": false,
  "includeUrlPatterns": [],
  "excludeUrlPatterns": [],
  "maxUrls": 0,
  "includeImages": false,
  "includeAlternates": false,
  "maxSitemaps": 2000,
  "maxDepth": 6,
  "maxConcurrency": 5,
  "requestDelayMs": 250,
  "requestTimeoutSecs": 60,
  "maxRetries": 2,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One dataset row per URL found in the site's sitemaps.

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

SUMMARY record with run totals, stored in the default key-value store.

# 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": [
        "https://www.djangoproject.com",
        "https://nodejs.org"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("blond_terrarium/sitemap-url-extractor-pro").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": [
        "https://www.djangoproject.com",
        "https://nodejs.org",
    ],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("blond_terrarium/sitemap-url-extractor-pro").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": [
    "https://www.djangoproject.com",
    "https://nodejs.org"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call blond_terrarium/sitemap-url-extractor-pro --silent --output-dataset

```

## MCP server setup

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

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/LFJJFgmSsiRaRD93J/builds/BwMk3NeQa1dXuieNm/openapi.json
