# XML Sitemap Scraper & URL Change Monitor (`felixgoldwin/sitemap-url-change-monitor`) Actor

Export sitemap URLs and lastmod dates to CSV or JSON. Compare snapshots for changes. Reads only authorized public HTTPS sitemap files, never your pages.

- **URL**: https://apify.com/felixgoldwin/sitemap-url-change-monitor.md
- **Developed by:** [Felix GoldWin](https://apify.com/felixgoldwin) (community)
- **Categories:** Developer tools, SEO tools
- **Features:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 1,000 sitemap url records

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

## XML Sitemap Scraper & URL Change Monitor

Export URLs, sitemap `lastmod` dates, and optional crawl hints from the XML sitemaps you manage. Compare two sitemap snapshots to find new URLs, changed sitemap metadata, and URLs no longer listed, without requesting any of the pages themselves.

Useful for SEO audits, sitemap migration checks, content inventories, and spotting when a CMS stops listing an important set of pages. The Actor uses the public sitemap XML you supply, not a search engine, website crawl, or browser.

### Quick start

1. Use one or more known, direct, public HTTPS sitemap URLs from sites you own or have permission to check.
2. Confirm authorization. Start with a small cap, then run and inspect **Coverage summary**.
3. Export results as CSV, JSON, JSONL, or Excel through Apify's Dataset export controls. Save the `SNAPSHOT` record if you want to compare later.
4. Run again with the same seed URLs and paste the previous `SNAPSHOT` object unchanged into **Previous SNAPSHOT JSON**. Optionally hide unchanged results.

Replace the illustrative hostname below with your authorized one:

```json
{
  "sitemapUrls": ["https://www.my-site.com/sitemap.xml"],
  "confirmAuthorized": true,
  "maxSitemaps": 10,
  "maxUrls": 3000,
  "maxDepth": 3
}
```

### Input

| Field | Meaning |
| --- | --- |
| `sitemapUrls` | One to five exact sitemap or sitemap-index URLs. HTTPS only; no IP literals, credentials, fragments, redirects, or non-default ports. |
| `confirmAuthorized` | Required confirmation that you own or have permission to read all supplied sources. |
| `maxSitemaps` | Max sitemap documents attempted, including indexes and failures (1–50, default 10). |
| `maxUrls` | Max distinct current page URLs to retain (1–10,000, default 3,000). Comparison can also emit prior observations no longer listed. |
| `maxDepth` | How far to follow sitemap indexes (1–5, default 3; seeds are depth 0). Only links on each seed's exact hostname are eligible. |
| `previousSnapshot` | Optional unchanged JSON object from the last run for the same seed URLs. It is not a URL or storage ID. |
| `changesOnly` | Require a prior snapshot and suppress `unchanged` dataset rows; the new snapshot still contains all observed URLs. |

### Output

| Field | Meaning |
| --- | --- |
| `url` | Normalized URL as listed in the sitemap. The Actor does not visit it. |
| `lastmod` | Valid date or timezone-qualified timestamp declared in the sitemap, or `null`. Not an HTTP response, revision history, or proof of a recent edit. |
| `changefreq`, `priority` | Optional validated sitemap hints, otherwise `null`. |
| `sitemapUrl` | Source sitemap; `null` on historical absent rows. First discovered row wins for duplicates. |
| `changeType` | `observed`, `new`, `newly_observed`, `updated`, `unchanged`, or `absent_from_sitemap`. |

- **Observed:** no previous snapshot. **New:** not in a prior complete snapshot. **Newly observed:** not in a prior partial snapshot.
- **Updated:** the tuple of sitemap `lastmod`, `priority`, and `changefreq` differs. This does not detect page-content changes.
- **Absent from sitemap:** reserved for matching, complete snapshots only. This is not a 404, removal from Google, or proof that a page stopped existing.
- **SUMMARY** reports completeness, attempted/parsed sitemap counts, retention limits and failures. **SNAPSHOT** contains the current URL/metadata set for your next run. There is no automatic shared baseline, alert service, or cross-run storage lookup.

Example row (illustrative):

```json
{
  "url": "https://www.my-site.com/guides/installation",
  "lastmod": "2026-11-20",
  "changefreq": null,
  "priority": null,
  "sitemapUrl": "https://www.my-site.com/sitemap.xml",
  "changeType": "observed"
}
```

### Limits and source handling

- Supports UTF-8 XML sitemap indexes and URL sets, optionally gzip-compressed. No robots.txt discovery, HTML parsing, page requests, authentication, proxy, redirect, or browser.
- The Actor only follows sitemap-index entries on the exact same hostname (not alternate `www` or CDN hostnames). Add another authorized seed explicitly if needed; a skipped off-host location makes that run partial.
- All DNS answers must be public, and the TLS connection is pinned to one vetted IP. TLS still verifies the original hostname. Non-public addresses, credential-like query parameters, XML DOCTYPE/entity declarations, and over-limit responses are rejected.
- Each request is bounded to 2 MiB transferred, 8 MiB decompressed, and a 12-second transfer. DNS has a separate 4-second deadline. Per-file rows and stored snapshots are also bounded. A cap, rejected source or skipped location can make a run partial; absent comparison is then disabled.
- Sitemaps can omit content and contain stale dates. Treat output as the publisher's current sitemap declarations, not an indexing audit. Do not supply private or token-bearing sitemaps.
- The Actor is independent and not affiliated with a search engine or CMS. See the [Sitemaps protocol](https://www.sitemaps.org/protocol.html) for field definitions.

### Local development

Use a supported Node.js release and the Apify CLI:

```sh
npm ci
npm test
apify validate-schema
apify run --user-agent apify-codex-plugin/apify-actor-development --input-file ./my-input.json
```

Fixture tests do not contact external sites. Local CLI runs use local storage and do not publish or deploy the Actor. Support: provide the run ID, coverage summary and a public reproduction if you can; do not send credentials or private source content.

# Actor input Schema

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

One to five exact public HTTPS sitemap URLs, no redirects or sign-in.

## `confirmAuthorized` (type: `boolean`):

Confirm ownership or permission. Only public, direct HTTPS XML sources are supported.

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

Caps all index and sitemap requests, including source errors.

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

Limits URLs included in the new snapshot. A comparison can also include absent URLs from the previous snapshot.

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

Depth of recursively followed sitemap index entries. Seed sitemaps are depth zero.

## `previousSnapshot` (type: `object`):

Optional exact SNAPSHOT record from an earlier run with the same seed URLs. Do not provide a URL.

## `changesOnly` (type: `boolean`):

Requires a previousSnapshot. The new SNAPSHOT still retains all observed URLs.

## Actor input object example

```json
{
  "confirmAuthorized": false,
  "maxSitemaps": 10,
  "maxUrls": 3000,
  "maxDepth": 3,
  "changesOnly": false
}
```

# Actor output Schema

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

No description

## `snapshot` (type: `string`):

No description

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

// Run the Actor and wait for it to finish
const run = await client.actor("felixgoldwin/sitemap-url-change-monitor").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("felixgoldwin/sitemap-url-change-monitor").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 felixgoldwin/sitemap-url-change-monitor --silent --output-dataset

```

## MCP server setup

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

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/CBXGO4lqKVjgZ98DZ/builds/fTN7Be5w0vg2PWqG7/openapi.json
