# Sitemap URL Extractor – All URLs, Auto-Discovery, $0.30/1K (`thecreat0r/sitemap-extractor`) Actor

Extract all URLs from any website's XML sitemaps. Auto-discovers sitemaps via robots.txt, follows sitemap indexes, supports .gz/.txt, regex filters and a modified-since filter for monitoring new pages. $0.30 per 1,000 URLs.

- **URL**: https://apify.com/thecreat0r/sitemap-extractor.md
- **Developed by:** [Bob Stevens](https://apify.com/thecreat0r) (community)
- **Categories:** SEO tools, Developer tools
- **Security:** 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 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.

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

### What does Sitemap URL Extractor do?

**Sitemap URL Extractor** finds and extracts **every URL listed in a website's XML sitemaps** – fast, cheap and reliable. Just enter a domain like `example.com`: the Actor auto-discovers sitemaps from `robots.txt` and common locations (`/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`, `.xml.gz`, `.txt`), follows **nested sitemap indexes** of any depth, and returns a clean list of URLs with `lastmod`, `changefreq` and `priority`.

No browser, no crawling – it reads sitemaps directly, so a typical run with tens of thousands of URLs finishes in seconds.

### Why use it?

- 🔎 **SEO audits** – get the full list of indexable pages of your site or a competitor's.
- 🆕 **Monitor new content** – schedule it daily with *Only URLs modified since* to get just the new/updated pages (new products, articles, job posts).
- 🕷️ **Feed other scrapers & RAG pipelines** – use the URL list as start URLs for crawlers or LLM ingestion.
- 🛒 **E-commerce intelligence** – list all product URLs of a Shopify/WooCommerce/Magento store.
- 🔁 **Migrations & redirects** – export every URL before a site migration.

### Features

- Auto-discovery via `robots.txt` + common sitemap paths
- Sitemap indexes, gzip (`.xml.gz`), plain-text sitemaps, news/image/video sitemaps
- Include / exclude regex filters
- **Modified-since filter** (skips whole child sitemaps that are older – very efficient)
- Optional image URLs from image sitemaps
- Automatic retry through Apify Proxy if a site blocks direct requests
- De-duplicated output, per-site limit
- A `SUMMARY` record in the key-value store with URL and sitemap counts per site

### Input

| Field | Description |
|---|---|
| `startUrls` | Domains (`https://example.com`, `example.com`) or direct sitemap URLs |
| `maxUrlsPerSite` | Stop after N URLs per site (0 = unlimited) |
| `includePattern` / `excludePattern` | Regex filters on the URL |
| `modifiedSince` | ISO date – return only URLs with `lastmod` on/after it |
| `includeImages` | Add image URLs from image sitemaps |
| `proxyConfiguration` | Optional proxy |

Example:

```json
{
  "startUrls": ["https://www.allbirds.com", "https://www.bbc.com/sitemaps/https-index-com-news.xml"],
  "includePattern": "/products/",
  "modifiedSince": "2026-01-01"
}
```

### Output

```json
{
  "url": "https://www.allbirds.com/products/mens-tree-runners",
  "lastmod": "2026-10-05T08:12:44-04:00",
  "changefreq": "daily",
  "priority": 0.8,
  "sitemap": "https://www.allbirds.com/sitemap_products_1.xml?from=1&to=9999",
  "domain": "www.allbirds.com"
}
```

Download as JSON, CSV, Excel, XML or HTML, or get it via the Apify API, webhooks, Make, Zapier or n8n.

### How much does it cost?

Pay only for results: **$0.30 per 1,000 URLs** plus a tiny start fee per run. Extracting a 10,000-page site costs about **$3**; a daily "new pages only" monitor typically costs cents per day.

### FAQ

**The Actor found no sitemap.** Some sites don't publish one or block bots. Try entering the sitemap URL directly or enable Apify Proxy (residential) in the input.

**Is it legal?** Sitemaps are public files that websites publish specifically so that machines can read them.

**Need a feature?** Open an issue on the Issues tab – I usually respond within 24 hours.

# Actor input Schema

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

Enter domains (e.g. https://example.com) or direct sitemap URLs (sitemap.xml, sitemap_index.xml, .xml.gz, .txt). For domains, sitemaps are auto-discovered from robots.txt and common locations.

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

Stop after this many URLs per website. 0 = unlimited.

## `includePattern` (type: `string`):

Optional regular expression. Only matching URLs are returned, e.g. /blog/ or /products/.

## `excludePattern` (type: `string`):

Optional regular expression. Matching URLs are skipped.

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

Optional. ISO date like 2026-01-01. Only URLs whose <lastmod> is on/after this date are returned (URLs without lastmod are skipped when set). Great for monitoring new content.

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

Add image URLs listed in image sitemaps (<image:loc>) to each result.

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

Optional. Use Apify Proxy if a site blocks direct requests.

## Actor input object example

```json
{
  "startUrls": [
    "https://apify.com"
  ],
  "maxUrlsPerSite": 0,
  "includeImages": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

All extracted records (dataset).

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

Counts per input and any inputs without results.

# 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://apify.com"
    ]
};

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

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

```

## MCP server setup

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