# Sitemap URL Extractor - All Website URLs, New & Removed Pages (`bruco3/sitemap-url-extractor`) Actor

Get every URL of any website from its sitemap.xml: nested sitemap indexes, .xml.gz, text sitemaps, robots.txt discovery. Export to CSV, JSON or Excel. Track new and removed pages between runs. Optional 404 status check. Streams millions of URLs. Pay per URL, no proxy needed.

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

## Pricing

from $0.40 / 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

## Sitemap URL Extractor — get all URLs of any website, and see what changed

Paste a website or a sitemap URL and get a clean, deduplicated list of **every URL the site publishes in its sitemap.xml** — with `lastmod`, `changefreq`, `priority`, images, videos, news and hreflang alternates. Export it to **CSV, JSON or Excel** with one click. Nested sitemap indexes, gzipped `.xml.gz` files and plain-text sitemaps are handled automatically, and the sitemap is discovered for you through `robots.txt` when you only give a domain.

Typical questions it answers: *list all pages of a website*, *extract all URLs from a sitemap*, *which pages did a site add or remove this week*, *which sitemap URLs return 404*.

Two things set it apart from other sitemap tools on Apify Store:

- **It streams.** Sitemaps are parsed as they download, so memory stays flat whether a site has 500 URLs or 5 million. No timeouts on huge indexes, no out-of-memory crashes.
- **Delta mode.** Turn it on and each run reports which URLs were **added** or **removed** since your previous run of the same site. That turns a URL list into a content-change monitor for SEO, competitor tracking or crawl scheduling — without you storing anything.

It sends no requests to the pages themselves unless you ask for HTTP status checks, and it needs no proxy: sitemaps are public files written for crawlers.

### Output: one row per URL, exportable to CSV, JSON, Excel

One dataset row per URL (download the whole list from the **Export** button, or fetch it via API):

```json
{
  "url": "https://example.com/blog/streaming-xml",
  "lastmod": "2026-09-12T08:14:00+00:00",
  "changefreq": "weekly",
  "priority": 0.8,
  "sitemap": "https://example.com/sitemap-posts.xml",
  "site": "https://example.com",
  "depth": 1,
  "images": ["https://example.com/img/hero.png"],
  "videos": 0,
  "newsTitle": null,
  "alternates": [{ "hreflang": "de", "href": "https://example.com/de/blog/streaming-xml" }],
  "change": "added",
  "statusCode": 200,
  "finalUrl": null
}
```

| Field | Meaning |
|---|---|
| `url` | The page URL, exactly as listed in the sitemap. Deduplicated across all sitemap files of the site. |
| `lastmod`, `changefreq`, `priority` | Values declared in the sitemap, or `null` when absent. |
| `sitemap` | The sitemap file the URL came from. `null` for URLs that were removed since the last run. |
| `site` | Origin of the start URL. |
| `depth` | Nesting level of the sitemap file: `0` for the top-level sitemap, `1` inside a sitemap index, and so on. `-1` for removed URLs. |
| `images`, `videos`, `newsTitle`, `alternates` | Data from the image, video, news and xhtml (hreflang) sitemap extensions. Turn off **Include image, video, news and hreflang data** if you do not need them. |
| `change` | Only in delta mode: `added`, `removed` or `unchanged`. |
| `statusCode`, `finalUrl`, `statusError` | Only with **Check HTTP status**: the response code, the URL after redirects (when different) and the error if the request failed. |

A run summary — sitemaps fetched, URLs found, filtered and pushed, errors, delta counts and timing — is saved to the `SUMMARY` record of the run's key-value store.

### Input

| Option | Default | What it does |
|---|---|---|
| **Websites or sitemap URLs** | — | One or more start URLs. A bare domain is resolved via `robots.txt` (`Sitemap:` lines) and then `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml` and other common locations. Anything that already looks like a sitemap (`.xml`, `.xml.gz`, `.txt`, a feed) is fetched directly. |
| **Maximum URLs** | `0` (no limit) | Hard cap across all sites. The cap is exact, even with parallel downloads. |
| **Include only URLs matching** / **Exclude URLs matching** | — | Case-insensitive regular expressions, e.g. include `/blog/`, exclude `\?page=`. |
| **Modified since** | — | Keep only URLs whose `lastmod` is on or after an ISO date (`2026-01-31`) or a relative window (`7d`, `48h`, `2w`). URLs without `lastmod` are dropped when this is set. |
| **Delta mode** | off | Compare with the previous run of the same site and flag every URL as `added`, `removed` or `unchanged`. See below. |
| **Delta output** | changes only | Return only added and removed URLs, or all URLs with their flag. |
| **Snapshot store name** | `sitemap-url-extractor-snapshots` | Named key-value store that keeps one snapshot per site between runs. |
| **Check HTTP status** | off | One HEAD request per URL (GET fallback for servers that refuse HEAD). Adds `statusCode` and `finalUrl`. Billed separately, see Pricing. |
| **Advanced** | | Status-check concurrency, sitemap download concurrency, index nesting depth, maximum sitemap files per site, custom `User-Agent`, optional proxy. |

### Sitemap change monitor: new and removed pages since the last run

Every site you extract in delta mode gets a snapshot — a compressed list of its URLs — in the named key-value store. On the next run the Actor compares the fresh list with the snapshot:

- URLs present now but not before → `added`
- URLs present before but not now → `removed` (they are still emitted, with `sitemap: null` and `depth: -1`)
- everything else → `unchanged` (emitted only when **Delta output** is *All URLs*)

The first run of a site returns everything as `added`. Schedule the Actor daily or weekly and the dataset of each run *is* the change log.

Two safeguards keep the delta honest:

- **A truncated walk never overwrites the snapshot.** If the run stops early because of **Maximum URLs** or because your maximum charge was reached, the snapshot is left untouched — otherwise the next run would report thousands of false `removed` URLs.
- **Filters are part of the snapshot.** If you change the include/exclude regex between runs, the difference shows up as added/removed URLs, which is what you would expect. Use different **Snapshot store name** values to track the same site under different filters.

Snapshots are stored as SHA-1 digests and gzipped shards of 200,000 URLs; a site with one million URLs uses roughly 100 MB of memory during the comparison.

### Pricing

Pay per event, no subscription:

- **one event per URL row** written to the dataset (added, removed and unchanged rows alike);
- **one event per URL checked** when **Check HTTP status** is on.

Set **Maximum URLs** or a maximum charge on the run to cap the cost of very large sites. When the maximum charge is reached the Actor stops cleanly, keeps everything it already extracted, and — in delta mode — does not touch the snapshot.

Why no charge for platform usage: parsing is streamed and the Actor does not visit the pages, so a million-URL site costs a few cents of compute. You pay for results.

### Use cases

- **SEO audits** — inventory every indexable URL, compare with your crawl or with Google Search Console, find orphaned or missing pages.
- **Content change monitoring** — schedule delta mode against your own site or a competitor's and get the new and removed URLs each morning.
- **Crawl scheduling** — feed the URL list (optionally filtered by `modifiedSince`) into a scraper so it only visits what changed.
- **Migrations** — export the full list before a redesign, run status checks after, and diff.
- **Data pipelines and AI agents** — deterministic JSON per URL, exact caps, no proxies, no login: a safe tool to call programmatically.

### Run it from code

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("bruco3/sitemap-url-extractor").call(run_input={
    "startUrls": [{"url": "https://example.com"}],
    "deltaMode": True,
    "includeRegex": r"/blog/",
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item["change"], item["url"])
```

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

Works with the Apify API, scheduler, webhooks and integrations (Make, Zapier, n8n, Google Sheets).

### FAQ

**Do I need a proxy?** No. Sitemaps are public files intended for search-engine crawlers. A proxy option exists for the rare site that blocks datacenter IPs.

**Does it visit the pages?** Not unless you enable **Check HTTP status**. Extraction reads only the sitemap files.

**What about huge sites?** The parser is incremental: a 300 MB sitemap index is processed in a streaming fashion with constant memory. Millions of URLs are fine; use **Maximum URLs** if you only want a sample.

**Gzipped sitemaps?** Detected by content, not by file extension — `.xml.gz` files and gzip served without the extension both work.

**Plain-text sitemaps and RSS/Atom feeds?** Supported, as allowed by the sitemaps.org protocol. Feed items yield `url` and `lastmod`.

**The site has no sitemap.** The run reports it in the summary and fails only if no site produced any URL. There is deliberately no HTML crawling fallback: that is a different tool with different costs.

**Is it legal?** Sitemaps are published by site owners specifically for automated consumption. The Actor identifies itself with a clear `User-Agent`, downloads only sitemap files by default, and stores no personal data.

### Limitations

- URLs are taken as listed; the Actor does not normalise or canonicalise them beyond deduplication.
- `removed` detection requires a complete walk of the site; runs cut short by a cap or budget skip it and preserve the snapshot.
- Sitemaps behind authentication or bot walls are out of scope by design.

### Related

- **[Broken Link Checker](https://apify.com/bruco3/broken-link-checker)** — checks every URL of these sitemaps for 404s, redirect chains, SSL errors and slow pages, with new / persisting / fixed between runs.

### Feedback

Found a sitemap this Actor cannot read, or missing a field you need? Open an issue on the **Issues** tab — sitemap edge cases get fixed quickly, and each one makes the tool better for everyone. If it saved you time, a review helps other people find it.

### Changelog

- **0.1** — initial release: streaming parser, nested indexes, gzip, text and feed sitemaps, robots.txt discovery, regex and `lastmod` filters, delta mode, optional status checks, exact caps, pay-per-event.

# Actor input Schema

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

Paste a website (<code>https://example.com</code>) and the sitemap is found for you via <code>robots.txt</code> and common locations. Or paste a sitemap, sitemap index, <code>.xml.gz</code> or plain-text sitemap URL directly.

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

Stop after this many URLs across all sites. <code>0</code> means no limit. Use it to cap cost on very large sites.

## `includeRegex` (type: `string`):

Case-insensitive regular expression. Only URLs that match are returned, e.g. <code>/blog/</code> or <code>.pdf$</code>.

## `excludeRegex` (type: `string`):

Case-insensitive regular expression applied after the include filter, e.g. <code>?page=|/tag/</code>.

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

Keep only URLs whose <code>\<lastmod></code> is on or after this date. Accepts an ISO date (<code>2026-01-31</code>) or a relative window like <code>7d</code>, <code>48h</code>, <code>2w</code>. URLs without <code>lastmod</code> are dropped when this is set.

## `deltaMode` (type: `boolean`):

Remembers the URLs of each site in a named key-value store and marks every URL as <code>added</code>, <code>removed</code> or <code>unchanged</code> compared with the previous run. The first run for a site returns everything as <code>added</code>.

## `deltaOutput` (type: `string`):

In delta mode, return only the changes (added and removed URLs) or every URL with its change flag.

## `deltaStoreName` (type: `string`):

Name of the key-value store that keeps per-site snapshots between runs. Use different names to track the same site under different filters.

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

Sends a lightweight HEAD request to each URL and adds <code>statusCode</code> and <code>finalUrl</code>. Slower and billed per checked URL — leave off if you only need the list.

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

Parallel HEAD requests when status checking is on. Lower it for fragile servers.

## `includeExtensions` (type: `boolean`):

Adds <code>images</code>, <code>videos</code>, <code>newsTitle</code> and <code>alternates</code> from sitemap extensions to each record.

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

Safeguard against runaway sitemap indexes.

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

How many levels of nested sitemap indexes to follow.

## `sitemapConcurrency` (type: `integer`):

How many sitemap files to download at once per site.

## `userAgent` (type: `string`):

Sent with every request. Change it only if a site requires a specific value.

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

Not needed for normal use — sitemaps are public files meant for crawlers. Enable only if a site blocks datacenter traffic.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com"
    }
  ],
  "maxUrls": 0,
  "deltaMode": false,
  "deltaOutput": "changes-only",
  "deltaStoreName": "sitemap-url-extractor-snapshots",
  "checkStatus": false,
  "statusConcurrency": 20,
  "includeExtensions": true,
  "maxSitemaps": 2000,
  "maxDepth": 5,
  "sitemapConcurrency": 6,
  "userAgent": "SitemapURLExtractor/1.0 (+https://apify.com/bruco3/sitemap-url-extractor)",
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "startUrls": [
        {
            "url": "https://docs.apify.com"
        }
    ]
};

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

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

```

## MCP server setup

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