# Sitemap Diff Monitor — New & Removed URLs (`xtracto/sitemap-diff-monitor`) Actor

Watch a site's sitemaps and get the URLs that appeared, vanished or changed since the last run. New sitemap URLs are the earliest public signal of a launch, a pricing page or a job opening. HTTP-only, no browser.

- **URL**: https://apify.com/xtracto/sitemap-diff-monitor.md
- **Developed by:** [Farhan Febrian Nauval](https://apify.com/xtracto) (community)
- **Categories:** Developer tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.00 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Diff Monitor — New & Removed URLs

Watch any website's sitemaps and get the URLs that **appeared**, **vanished** or **changed** since the last run.

### Why use this actor

- **No account, no login, no API key.** Enter a domain and run.
- **The earliest public launch signal.** New product pages, pricing tiers, job openings and press releases usually appear in a sitemap before they are announced.
- **Three kinds of change**: added URLs, removed URLs (delistings, retired products), and updated URLs (a changed last-modified date, without downloading the page).
- **Finds sitemaps for you**, from robots.txt and the usual locations, including sitemap indexes and compressed files.
- **Safe on large sites.** When a crawl hits your limits, the row says so and removals are held back instead of reporting false deletions.
- **History survives runs**, rebuilds and schedules. Stable JSON output; export to JSON, CSV or Excel.

### How it works

1. You list the sites to watch: a bare domain, a URL, or a direct sitemap URL.
2. The actor finds the sitemaps (robots.txt first, then the usual locations), follows sitemap indexes, and collects every URL with its last-modified date.
3. It compares the result with the snapshot from the previous run of the same site.
4. You get one row per site with complete counts and lists of added, removed and updated URLs.

The first run stores a baseline; later runs report changes. No scrapers or browsers to manage.

### Input

```json
{
  "sites": ["crawlee.dev"],
  "maxUrlsPerSite": 20000,
  "maxSitemapFiles": 40,
  "maxListedUrls": 3,
  "onlyChanges": false,
  "proxyConfiguration": { "useApifyProxy": false }
}
```

| Field | Type | Description |
|---|---|---|
| `sites` | array of strings | Sites to monitor: `example.com`, a URL, or a sitemap URL. Required. |
| `maxUrlsPerSite` | integer | Stop collecting after this many URLs. Set it above the site's `totalUrls` for a complete diff. Default `5000`. |
| `maxSitemapFiles` | integer | Stop after reading this many sitemap files. Default `40`. |
| `maxListedUrls` | integer | How many URLs to list per change type. Counts are always complete. Default `200`. |
| `onlyChanges` | boolean | Only return sites with changes. Every site is still checked and remembered. Default `false`. |
| `proxyConfiguration` | object | Optional proxy, for hosts that rate-limit or block cloud addresses. Off by default. |

### Output

One row per site. Real output from a second run on `crawlee.dev` with the input above (the first run stored the baseline, nothing changed in between):

```json
{
  "_input": "crawlee.dev",
  "_source": "S1-sitemap-robots.txt",
  "_scrapedAt": "2026-11-11T13:16:20Z",
  "site": "https://crawlee.dev",
  "sitemapsFound": 2,
  "discoveredVia": "robots.txt",
  "totalUrls": 4844,
  "urlsCollected": 4856,
  "duplicateUrls": 12,
  "urlsWithLastmod": 0,
  "sitemapFilesRead": 2,
  "indexesFollowed": 0,
  "isFirstRun": false,
  "changeType": "unchanged",
  "scopeChanged": false,
  "scope": { "maxUrls": 20000, "maxFiles": 40 },
  "previousScope": { "maxUrls": 20000, "maxFiles": 40 },
  "addedCount": 0,
  "removedCount": 0,
  "updatedCount": 0,
  "addedUrls": [],
  "removedUrls": [],
  "updatedUrls": [],
  "listedCap": 3,
  "listsTruncated": false,
  "previousTotalUrls": 4844,
  "previousCheckedAt": "2026-11-11T13:16:02Z",
  "crawlCapped": false,
  "diffReliable": true,
  "diffNote": null,
  "needsAttention": false,
  "problems": []
}
```

A capped crawl looks like this (real first run on `apify.com` with `maxUrlsPerSite: 5000`, shortened):

```json
{
  "site": "https://apify.com",
  "totalUrls": 5000,
  "sitemapFilesRead": 3,
  "indexesFollowed": 1,
  "changeType": "baseline",
  "crawlCapped": true,
  "diffReliable": false,
  "diffNote": "the crawl stopped at maxUrlsPerSite or maxSitemapFiles, so the snapshot is the first N URLs in crawl order rather than the whole site. Every URL past the cap is missing from the snapshot while still live, which would read as a removal on every run — so removals are not reported. Raise the limits above totalUrls and sitemapFilesRead for a complete diff."
}
```

| Field | Type | Description |
|---|---|---|
| `site` | string | The site checked |
| `sitemapsFound`, `discoveredVia` | integer, string | How many sitemaps were found and how (`robots.txt` or the usual locations) |
| `totalUrls` | integer | Unique URLs in this run's snapshot |
| `urlsCollected`, `duplicateUrls` | integer | Entries read before removing duplicates, and how many were duplicates |
| `urlsWithLastmod` | integer | URLs that carry a last-modified date (needed for `updated` changes) |
| `sitemapFilesRead`, `indexesFollowed` | integer | Files read and sitemap indexes followed |
| `changeType` | string | `baseline` (first run), `changed`, `unchanged`, or `rebaselined` (limits changed) |
| `addedCount`, `removedCount`, `updatedCount` | integer | Complete counts of each change type |
| `addedUrls`, `removedUrls`, `updatedUrls` | array of strings | The changed URLs, up to `maxListedUrls` each |
| `listedCap`, `listsTruncated` | integer, boolean | The list limit, and whether any list was cut |
| `previousTotalUrls`, `previousCheckedAt` | integer, string | What the previous run saw, and when |
| `scope`, `previousScope`, `scopeChanged` | object, boolean | The limits used this run and last run |
| `crawlCapped` | boolean | `true` when the crawl stopped at a limit before finishing |
| `diffReliable`, `diffNote` | boolean, string | Whether removals can be trusted, and why not when they cannot |
| `needsAttention` | boolean | `true` when anything was added, removed or updated |
| `problems` | array | Sitemap files that could not be read, if any |
| `_input`, `_source`, `_scrapedAt` | string | The input line, data source and time of the check |

### Notes

- **Set the limits above the site's size.** When a crawl stops at a limit, the snapshot is only the first N URLs, and every URL past the cap would look "removed" on every run. The actor detects this, sets `diffReliable: false` and stops reporting removals. Additions stay meaningful.
- **Changing the limits starts a new baseline.** Two snapshots taken under different limits cover different parts of the site, so the run reports `rebaselined` and no diff; the next run reports real changes.
- **`updated` depends on the site.** The last-modified date is optional and many sites leave it out (crawlee.dev and apify.com carry none), in which case only added and removed URLs can be reported.
- **Some sites have no sitemap.** That is reported as a `no_urls` error row, not invented.
- **A failed or empty crawl never overwrites the stored snapshot**, so the next good run still compares against the last sitemap actually read.

# Actor input Schema

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

Sites to monitor, as a bare domain ('example.com'), a URL, or a direct sitemap URL. Sitemaps are found from robots.txt first and then the conventional paths, because robots.txt named no sitemap on 4 of 10 sites that serve one.

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

Read this if you watch a large site. When the crawl stops at this limit the snapshot is only the first N URLs, so every URL past the cap is missing while still live — which would read as a removal on every run. The actor detects that and stops reporting removals, marking the row diffReliable=false. Set this above the site's totalUrls for a complete diff; additions stay meaningful either way.

## `maxSitemapFiles` (type: `integer`):

A second ceiling, on files rather than URLs. Large sites split across a sitemap index with dozens of children; this bounds how many are read. Hitting it also marks the diff unreliable, for the same reason as the URL cap.

## `maxListedUrls` (type: `integer`):

How many URLs to list in addedUrls, removedUrls and updatedUrls. The counts are always complete and listsTruncated says whether a list was cut, so a relaunch that changes 40,000 URLs does not produce an unusable row.

## `onlyChanges` (type: `boolean`):

Return only sites with added, removed or updated URLs. Every site is still crawled and its snapshot still recorded, so nothing is missed while this is on.

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

Optional. Sitemaps are usually served to anything, but a proxy helps if a host rate-limits or blocks datacenter ranges.

## Actor input object example

```json
{
  "sites": [
    "apify.com"
  ],
  "maxUrlsPerSite": 5000,
  "maxSitemapFiles": 40,
  "maxListedUrls": 200,
  "onlyChanges": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per scraped record, stored in the run's default dataset.

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

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

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

```

## MCP server setup

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