# Sitemap Extractor & Change Monitor · New and Removed URLs (`thequietstack/sitemap-change-monitor`) Actor

Sitemap extractor and change monitor for any website: reads the XML sitemaps (robots.txt, /sitemap.xml, indexes, .xml.gz), lists the URLs on the first run if you want, then reports only new and removed pages. Competitor content and product launches, SEO change logs.

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

## Pricing

from $1.40 / 1,000 url changes

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 Extractor & Change Monitor: New and Removed URLs on Any Website

See what a website **published or removed since your last run**: competitor blog posts, new product pages, landing pages, deleted pages.
The Actor reads the site's own **XML sitemaps** (found via `robots.txt`, then `/sitemap.xml`; sitemap indexes and `.xml.gz` included) and compares them with the previous run.
You pay only for changes, not for the thousands of URLs that stayed the same.

**Typical uses:** competitor content and product-launch alerts · SEO change log for client sites · catching accidentally removed pages after a release · feeding new URLs into a CMS, Slack or a crawler.

### Output per change

`site` · `change` (`added` / `removed`, optional `updated`) · `url` · `section` (first path segment, e.g. `blog`, `products`) · `lastmod` · `previousLastmod` · `detectedAt` · `sitemap`

### Example (real run, 21.10.2026)

`blog.cloudflare.com` (10,170 URLs in 9 sitemaps) and `www.allbirds.com` (2,537 URLs): first run learns the URLs; with `firstRunMode: "deliver"` you get the newest 20 at once:

```json
{
 "site": "blog.cloudflare.com",
 "change": "added",
 "url": "https://blog.cloudflare.com/es-es/cloudflare-openai-discovery-agentic-web",
 "section": "es-es",
 "lastmod": "2026-10-21T08:40:42.709Z",
 "previousLastmod": null,
 "detectedAt": "2026-10-21T12:29:04.218Z"
}
```

### Input

```json
{ "sites": ["competitor.com", "https://shop.example.com/sitemap.xml"], "urlContains": ["/blog/", "/products/"], "maxRows": 200 }
```

- **First run:** by default only remembers all URLs (`firstRunMode: "baseline"`), so you are not charged for an existing catalogue. Schedule it daily or hourly afterwards.
- **No false "removed":** removals are reported only when this scan *and* the previous one read every sitemap completely. A timeout, a robots.txt block or a size limit suppresses removals for that run (`SUMMARY.sites[].removedSuppressed`).
- **`updated` is off by default:** many shops (measured on a Shopify store: 692 of 2,537 product URLs got a new `lastmod` within minutes) bump `lastmod` on every stock or price change.
  Turn on `reportUpdates` for content sites; `lastmod` going backwards (cache flapping) is ignored, and a site-wide re-stamp becomes one `massUpdate` note in SUMMARY instead of hundreds of rows.
- `maxRows` caps all sites together per run; changes above it are reported in the next run.

### Pricing

Pay per event: **$0.002 per reported change** on the free plan, −10/−20/−30 % on higher Apify plans. Unchanged URLs, baseline runs and filtered changes are never charged.

### Fair use and limits

- Only sitemaps the site publishes for machines are read; every sitemap URL is checked against `robots.txt` (`User-agent: *`) first. Honest user agent, one request at a time with a pause (`delayMs`).
- No page content is downloaded and no personal data is processed: URLs and dates only.
- Sites without a sitemap (measured: python.org) are reported with `sitemapsRead: 0`; nothing is guessed. Pages missing from a site's sitemap are invisible to this Actor.

# Actor input Schema

## `sites` (type: `array`):

Domains or homepage URLs (sitemaps are found via robots.txt, then /sitemap.xml) or a direct sitemap URL (…/sitemap.xml or .xml.gz).

## `firstRunMode` (type: `string`):

The first run of a watch only learns the current URLs by default, so you are not charged for thousands of existing pages.

## `reportUpdates` (type: `boolean`):

Also report URLs whose <lastmod> moved forward since the last run. Off by default: many shops (e.g. Shopify) bump lastmod on every stock or price change, which is noise if you only want new and removed pages.

## `urlContains` (type: `array`):

Optional. Keep only changes whose URL contains one of these strings, e.g. /blog/ or /products/.

## `urlExcludes` (type: `array`):

Optional. Drop changes whose URL contains one of these strings, e.g. /tag/ or ?page=.

## `maxRows` (type: `integer`):

Cost cap. Changes above it are not marked as seen and are reported in the next run.

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

Safety limit. When a site has more URLs, the scan counts as incomplete and removals are not reported (no false 'removed').

## `maxSitemapsPerSite` (type: `integer`):

Safety limit for very large sitemap indexes.

## `delayMs` (type: `integer`):

Politeness delay between sitemap downloads on the same run.

## `watchName` (type: `string`):

Optional. Separate 'only changes' memory for the same site (e.g. one watch per client).

## `stateStoreName` (type: `string`):

Named key-value store that keeps the last known URLs per site between runs.

## `massUpdateShare` (type: `number`):

If more than this share of a site's URLs get a new lastmod in one run (≥ 50 URLs), the sitemap was regenerated: you get one massUpdate note in SUMMARY instead of hundreds of 'updated' rows (not charged).

## `resetMemory` (type: `boolean`):

Treat this run as a first run: the previous URL list is ignored and overwritten. Useful for tests or after changing filters.

## Actor input object example

```json
{
  "sites": [
    "blog.cloudflare.com",
    "www.allbirds.com"
  ],
  "firstRunMode": "deliver",
  "reportUpdates": false,
  "maxRows": 20,
  "maxUrlsPerSite": 50000,
  "maxSitemapsPerSite": 300,
  "delayMs": 300,
  "stateStoreName": "thequietstack-sitemap-monitor-state",
  "massUpdateShare": 0.3,
  "resetMemory": false
}
```

# Actor output Schema

## `changes` (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 = {
    "sites": [
        "blog.cloudflare.com",
        "www.allbirds.com"
    ],
    "firstRunMode": "deliver",
    "maxRows": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("thequietstack/sitemap-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 = {
    "sites": [
        "blog.cloudflare.com",
        "www.allbirds.com",
    ],
    "firstRunMode": "deliver",
    "maxRows": 20,
}

# Run the Actor and wait for it to finish
run = client.actor("thequietstack/sitemap-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 '{
  "sites": [
    "blog.cloudflare.com",
    "www.allbirds.com"
  ],
  "firstRunMode": "deliver",
  "maxRows": 20
}' |
apify call thequietstack/sitemap-change-monitor --silent --output-dataset

```

## MCP server setup

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