I built the Apify actor in the examples below, so keep that in mind while you read.
I wanted to know when a couple of competitors shipped new landing pages or quietly killed old ones. Checking their sites by hand didn't last a week. Crawling them felt like overkill. Then I remembered that most sites already publish a list of every page they want Google to find. It's the sitemap.
What a sitemap gives you
A sitemap is an XML file, usually at /sitemap.xml or listed in robots.txt. Each entry has a URL and often a lastmod date, plus changefreq and priority. Big sites split it into a sitemap index that points at dozens of child sitemaps, some of them gzipped. News sites add Google News tags. WordPress, Shopify, Webflow and most Next.js setups make one for you.
So if you save the URL list today and compare it tomorrow, you get new pages, removed pages and pages whose lastmod moved. No crawling, no browser, one small file per site.
The annoying parts are the details. Finding the sitemap, walking nested indexes, handling .gz, not flagging 3,000 "removed" pages because one child sitemap timed out. That's what I wrapped into Sitemap Extractor & Change Monitor.
What it does
You give it a domain or page URL in startUrls. It reads the Sitemap: lines in robots.txt, then tries common paths like /sitemap.xml, /sitemap_index.xml and /wp-sitemap.xml. If there's no sitemap at all, it falls back to the site's RSS or Atom feed. If you already know the exact sitemap URL, put it in sitemapUrls and it skips discovery.
With trackChanges on, each row gets a changeType: added, removed, lastmodChanged or unchanged. With onlyChanges on, you only get the changes. The state lives in a named key-value store in your own Apify account, keyed by stateKey.
You can also list a few key pages in pageCheckUrls, like a pricing page. It hashes the main text of each one and tells you when it changed. Nav, footer, scripts and hidden elements are dropped first, so a new cookie banner doesn't count as a change.
A plain export first
You need an Apify account and an API token (Console, Settings, API and Integrations). Here's the smallest useful call. I capped it at 20 URLs so the output stays short.
curl -X POST "https://api.apify.com/v2/acts/datlab~sitemap-change-monitor/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["https://crawlee.dev"], "maxUrls": 20}'
That run took 3.1 seconds and returned 20 rows. Here's one of them:
{
"recordType": "url",
"url": "https://crawlee.dev/blog/archive",
"site": "crawlee.dev",
"lastmod": null,
"changefreq": "weekly",
"priority": 0.5,
"sourceType": "sitemap",
"sitemapUrl": "https://crawlee.dev/sitemap.xml",
"scrapedAt": "2026-11-26T08:22:10.596Z"
}
lastmod is null because crawlee.dev's sitemap doesn't include it. Plenty of sites skip it. You still get added and removed pages, you just won't see lastmodChanged rows for them.
The RUN_SUMMARY record in the run's key-value store tells you how it went. For this run it said "robots.txt lists 2 sitemap(s)", 2 sitemaps read, and "truncated": true because I hit the cap.
Turning it into a monitor
For competitor tracking you usually don't want every URL. You want the blog, the pricing page, maybe /customers/. Here's the input I'd use:
{
"startUrls": ["https://crawlee.dev"],
"includePatterns": ["/blog/"],
"onlyChanges": true,
"stateKey": "tutorial-demo"
}
The first run saves a baseline and outputs nothing. That's on purpose, and it's free. Every run after that outputs only what changed.
I didn't want to wait a week for crawlee.dev to publish something, so I cheated a little. I ran the baseline with maxUrls: 15, then ran it again with maxUrls: 20. The cap isn't part of the saved filters, so the second run saw 5 URLs it hadn't stored yet. It returned exactly those 5:
[
{
"recordType": "url",
"url": "https://crawlee.dev/blog/linkedin-job-scraper-python",
"site": "crawlee.dev",
"lastmod": null,
"changefreq": "weekly",
"priority": 0.5,
"sourceType": "sitemap",
"sitemapUrl": "https://crawlee.dev/sitemap.xml",
"scrapedAt": "2026-11-26T08:22:44.429Z",
"changeType": "added",
"previousLastmod": null
}
]
The other four were /blog/netflix-show-recommender, /blog/page/2, /blog/page/3 and /blog/playwright-stealth-vs-fingerprint-spoofing. The run summary had "added": 5, "unchanged": 15, "removed": 0.
Notice it didn't report anything as removed, even though both reads were capped. That's deliberate. A URL only counts as removed if this run and the previous one both read every sitemap completely, with no failed file, no maxUrls cap and no spending limit hit. Otherwise it merges what it saw and waits. A flaky child sitemap shouldn't look like 3,000 deleted pages.
Two more things to know. If you change includePatterns or excludePatterns, that site starts over with a fresh baseline. And some sites regenerate the sitemap on every request, so every lastmod is "now". The actor spots that (lastmodLooksDynamic in the summary) and ignores lastmod changes for that site from the next run on.
Calling it from Python and JS
Python with apify-client:
from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("datlab/sitemap-change-monitor").call(run_input={
"startUrls": ["https://competitor.com"],
"includePatterns": ["/blog/", "/pricing"],
"onlyChanges": True,
"stateKey": "competitor-daily",
})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
print(row["changeType"], row["url"])
JavaScript:
import { ApifyClient } from "apify-client";
const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor("datlab/sitemap-change-monitor").call({
startUrls: ["https://competitor.com"],
includePatterns: ["/blog/", "/pricing"],
onlyChanges: true,
stateKey: "competitor-daily",
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
for (const row of items) console.log(row.changeType, row.url);
Running it daily with a webhook
The easiest setup is in the Console. Save your input as a task, then add a schedule to it, something like 0 7 * * * for every morning. Use one stateKey per task so two monitors don't share state.
For alerts, add a webhook on the task for the "Run succeeded" event. Apify POSTs a JSON payload to your URL, and resource.defaultDatasetId in it is the dataset with the changes. Your handler fetches the items and posts them wherever you want. If you'd rather not write a handler, the built-in Slack, email and Google Sheets integrations do the same job.
Because onlyChanges is on, a quiet day gives you an empty dataset. Your handler can just skip it when there are zero items.
Pricing
It's pay per event:
- First 500 URL results and 10 page checks each month are free.
- After that, $0.0003 per URL result ($0.30 per 1,000) and $0.002 per page check.
- $0.00005 per run start.
- Platform usage is included.
In monitor mode you're only charged for change rows. The baseline is free and a run with no changes has no URL charges. Page checks on pages blocked by robots.txt or that fail to load aren't charged. A full one-off export of 10,000 URLs is $3.00. You can set a maximum cost per run in the run options and it'll stop cleanly.
Limits
- It needs a sitemap or an RSS/Atom feed. A site with neither gives you nothing. The feed fallback usually only lists the latest 10 to 50 items, which is fine for "new page" alerts but isn't a full URL list.
- It obeys robots.txt and
Crawl-delay(up to 30 seconds). Pages disallowed for crawlers show up asblockedByRobotsand aren't fetched. Sites with a long delay make discovery slow. - No JavaScript rendering. Page checks compare the HTML the server sends back.
-
maxUrlsis per site and defaults to 10,000. Set it to0for big full exports. - Some sites block datacenter IPs. You can pass
proxyConfigurationfor those.
If you use Claude, Cursor or another MCP client, add https://mcp.apify.com/?tools=datlab/sitemap-change-monitor as an MCP server and it shows up as a tool.
If a site's sitemap comes out wrong, leave a comment with the URL and I'll take a look.
I made this at DatLab: datlab/sitemap-change-monitor.
Top comments (0)