# XML Sitemap URL Extractor & Snapshot Diff (`testedtemplates/sitemap-url-extractor-snapshot-diff`) Actor

Export XML sitemap URLs to JSON, CSV or Excel for SEO inventories. Compare with your saved URL list to find added and removed URLs. Incomplete scans suppress removals. $0.50 per 1,000 delivered rows plus platform usage; no page crawling or automatic history.

- **URL**: https://apify.com/testedtemplates/sitemap-url-extractor-snapshot-diff.md
- **Developed by:** [Christopher Kujawa](https://apify.com/testedtemplates) (community)
- **Categories:** SEO tools, Automation, Developer tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 url rows

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

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

## XML Sitemap URL Extractor & Snapshot Diff

Export page URLs from public XML sitemaps to JSON, CSV or Excel. Compare them with a saved URL list to find additions and removals from the sitemap. Use it to prepare an SEO URL inventory, compare a sitemap before and after a site migration, or supply URLs to a separate crawler.

**Price: $0.50 per 1,000 delivered URL rows, plus Apify platform usage.** The Actor reads sitemaps and same-origin sitemap indexes. It does not visit the listed pages, check HTTP status codes or detect changes to page content.

### Quick start

1. Click **Try for free** or **Try it** and paste a public XML sitemap URL into **Sitemap URLs**.
2. Choose **Maximum current URLs** and set a maximum result charge in the run settings.
3. Run the Actor. Open **Extracted results** to export JSON, CSV or Excel. Check **Run summary and completeness** before treating the export as a full inventory.

Example extraction input:

```json
{
  "sitemapUrls": ["https://testedtemplates.com/sitemap.xml"],
  "maxUrls": 1000
}
```

For a comparison, supply your saved list as `previousUrls`:

```json
{
  "sitemapUrls": ["https://testedtemplates.com/sitemap.xml"],
  "maxUrls": 1000,
  "previousUrls": ["https://testedtemplates.com/"],
  "includeUnchanged": true
}
```

That deliberately small example baseline marks other current URLs as added. **Added means absent from your baseline, not newly published. Removed means absent from the scanned sitemaps, not necessarily deleted from the website.**

### Example output

Illustrative comparison rows:

```json
[
  {"url":"https://example.com/new-page","lastmod":"2026-10-24","changefreq":"weekly","priority":"0.8","status":"added"},
  {"url":"https://example.com/retired-page","lastmod":null,"changefreq":null,"priority":null,"status":"removed"}
]
```

Without a baseline, rows have `status: "current"`. With a baseline, statuses are `added`, `removed`, and optionally `unchanged`. Metadata comes from the sitemap; missing values are `null`. Duplicate URLs are collapsed.

### Input options

| Field | Use |
| --- | --- |
| `sitemapUrls` | Required: 1–10 public XML sitemap URLs. |
| `maxUrls` | Unique current URL limit, 1–10,000; default 1,000. |
| `previousUrls` | Optional baseline of up to 10,000 URLs, supplied each run. |
| `includeUnchanged` | Include unchanged URLs in comparisons; default false. |

### Keep a usable baseline

The Actor keeps no automatic snapshot history. For the first snapshot, run without `previousUrls` and save the exported `url` values. On later runs, supply that list and set `includeUnchanged` to `true`. Save the **added and unchanged** URLs as the next baseline only when traversal and output delivery are complete.

Inspect the `OUTPUT` key-value record: `ok`, `errors`, `truncated`, `comparisonIncomplete`, `billingTruncated` and `outputDeliveryIncomplete`. A first extraction has no comparison, so `comparisonIncomplete` alone is not a completeness check.

If scanning is incomplete, removal rows are suppressed. If output delivery stops at a charge limit or write failure, previously delivered rows remain, and the export is partial. Do not replace a full baseline with either kind of incomplete export.

### Scope and pricing

Traversal is limited to 20 XML documents and sitemap-index depth 2. Cross-origin child sitemaps are skipped. Invalid entries, failed fetches, parse errors and traversal limits are reported. Only public HTTP(S) on standard ports is fetched, subject to robots rules, DNS checks, bounded redirects and a 5 MiB response limit.

All delivered statuses have the same price. For example, 200 added plus 100 removed rows cost $0.15 in result charges, plus platform usage. `maxUrls` limits current URLs, not total comparison rows; removed rows can increase the output count. Use the run's maximum result charge to cap delivery. The Store pricing panel is authoritative. No proxy or paid external API is needed.

For feed entries instead of sitemap URLs, see our [RSS & Atom Feed Extractor](https://apify.com/testedtemplates/rss-feed-extractor). For a problem, open the Actor's **Issues** tab with the run ID and expected behavior; omit credentials and private data.

# Actor input Schema

## `sitemapUrls` (type: `array`):

One to ten public HTTP or HTTPS sitemap URLs. Sitemap indexes are followed only to same-origin child sitemaps.

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

Stop after this many unique sitemap URLs. If more are found, the comparison is marked incomplete and removed rows are omitted.

## `previousUrls` (type: `array`):

Optional baseline URL list (up to 10,000). Provide it on each comparison run; this Actor does not keep a hidden snapshot.

## `includeUnchanged` (type: `boolean`):

When a previous snapshot is supplied, include matching URLs with status unchanged. Defaults to false.

## Actor input object example

```json
{
  "maxUrls": 1000,
  "includeUnchanged": false
}
```

# Actor output Schema

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

Delivered dataset rows; export as JSON or CSV.

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

Counts, errors and delivery limits. Check this before using the results as a complete snapshot.

# 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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("testedtemplates/sitemap-url-extractor-snapshot-diff").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 = {}

# Run the Actor and wait for it to finish
run = client.actor("testedtemplates/sitemap-url-extractor-snapshot-diff").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 '{}' |
apify call testedtemplates/sitemap-url-extractor-snapshot-diff --silent --output-dataset

```

## MCP server setup

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

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/VvDMdIxEOdoaCuE5t/builds/ZufgLwpumKKe0QzO0/openapi.json
