# Sitemap Extractor, URL Status Checker & New Page Monitor (`mercury_ops/sitemap-url-monitor`) Actor

Extract every URL from any website's XML sitemaps (auto-discovered, indexes, gzip, text, RSS), optionally check each URL's status, redirects, noindex and canonical, or schedule it to report only new, updated and removed pages. No browser, no login.

- **URL**: https://apify.com/mercury_ops/sitemap-url-monitor.md
- **Developed by:** [Mercury](https://apify.com/mercury_ops) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

Pay per event

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

## Sitemap Extractor, URL Status Checker & New Page Monitor

**Get every URL from any website's sitemaps in seconds, check which ones are broken, redirected or noindexed, or schedule it to tell you only when pages are added, updated or removed.** No browser, no login, no API keys.

### Three jobs in one Actor

| You want to… | Settings | You pay for |
|---|---|---|
| **Export all URLs** from a site's sitemaps (lastmod, changefreq, priority, image/video counts, hreflang alternates) | Mode: *All URLs* | Each URL row |
| **Audit sitemap hygiene**: find 404s, 5xx, redirects, redirect chains, `noindex` and canonical-to-elsewhere URLs that shouldn't be in a sitemap | *All URLs* + **Check each URL** | Each URL row + each URL checked |
| **Monitor competitors' new pages** (blog posts, product pages, landing pages) | Mode: *Changes only*, run on a schedule | A tiny fee per URL compared + each new / updated / removed URL |

### Use cases

- **SEO audits and migrations:** list every URL a site declares, then flag the ones Google shouldn't see in a sitemap (non-200, redirected, noindex, canonicalised elsewhere).
- **Content and competitor monitoring:** a daily schedule in *Changes only* mode gives a feed of new pages a competitor publishes, often before they're promoted.
- **Crawl seeding:** feed the clean URL list into a crawler, RAG pipeline or AI agent instead of crawling blindly.
- **Uptime spot checks** of the pages that matter, straight from the sitemap.

Connect the dataset to Slack, email, Google Sheets, Make, n8n or Zapier with Apify integrations, or call it from an AI agent through the Apify MCP server.

### Input

```json
{
  "startUrls": [{ "url": "https://crawlee.dev" }, { "url": "https://www.example.co.uk/post-sitemap.xml" }],
  "mode": "all",
  "checkStatus": true,
  "maxUrlsPerSite": 5000,
  "includePattern": "/blog/",
  "excludePattern": "/tag/|/author/"
}
```

- **Homepage or sitemap URL.** For a homepage the Actor reads `Sitemap:` lines in robots.txt, then tries `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml` and `/sitemap.txt`. Sitemap indexes (up to 4 levels), `.xml.gz`, plain-text sitemaps and RSS/Atom feeds are all supported.
- **URLs are de-duplicated** across all of a site's sitemaps (trailing slash and host case ignored).
- **Filters** run before billing, so skipped URLs cost nothing.
- **Changes only:** the first run saves a baseline (no rows). Schedule the Actor with the same `monitorName` and every later run outputs only `new`, `updated` (lastmod changed) and `removed` URLs. With **Check each URL** on, only new and updated URLs are checked. Snapshots are kept in a key-value store called `sitemap-url-monitor-state` in your own account.

### Output (one row per URL)

```json
{
  "site": "https://www.gov.uk",
  "url": "https://www.gov.uk/employment-tribunal-decisions/…",
  "lastmod": "2026-10-20T09:12:44+01:00",
  "changefreq": null,
  "priority": null,
  "imageCount": 0,
  "videoCount": 0,
  "alternates": [],
  "sitemap": "https://www.gov.uk/sitemaps/sitemap_1.xml",
  "statusCode": 200,
  "finalUrl": "https://www.gov.uk/employment-tribunal-decisions/…",
  "redirectChain": [],
  "contentType": "text/html; charset=utf-8",
  "xRobotsTag": null,
  "metaRobots": "noindex, nofollow",
  "canonical": "https://www.gov.uk/employment-tribunal-decisions/…",
  "responseMs": 142,
  "issues": ["noindex"],
  "indexable": false,
  "checkedAt": "2026-10-26T18:24:02+00:00"
}
```

`issues` can contain `client-error`, `server-error`, `error` (timeout / connection), `redirect`, `redirect-chain`, `noindex`, `canonical-elsewhere` and `checker-blocked-by-robots`. In *Changes only* mode each row also has `changeType` (`new`, `updated`, `removed`) and, for updates, `previousLastmod`.

A per-site summary (sitemaps found and read, sitemap errors, URL count, issue counts, changes, whether the read was complete) is saved as `OUTPUT` in the run's key-value store.

### How it works and what it respects

- Reads only **public sitemaps** that sites publish for crawlers, and (if you ask) requests each URL once, reading at most the first 256 KB of HTML to find meta robots and canonical tags. No personal data is collected.
- **Obeys robots.txt** for every request it makes (sitemaps and URL checks) and identifies itself honestly in its user agent. Sitemaps or pages disallowed for it are reported, not fetched.
- Polite by default: sitemap files are fetched one at a time with a pause, URL checks use at most 4 parallel requests per site (configurable up to 10), with back-off on 429/5xx.

### Limits

- Sites with no sitemap at robots.txt or the usual locations are reported as "No sitemap found". Pass the sitemap URL directly if it lives somewhere unusual.
- "Updated" relies on the site's `lastmod`. Many sites don't set it (or set it to the build time), so treat updates as a hint; new and removed URLs are reliable.
- Removals are only reported when the full sitemap was read (not when a limit or error cut the run short).
- Status checks see what a polite bot sees. Sites behind aggressive bot protection may return 403 to it; enable a proxy if needed.
- Max 100 sites per run, 200,000 URLs per site, 1,000 sitemap files per site.

### Pricing (pay per event)

- **URL** (All URLs mode): $0.0002 per URL, i.e. **$0.20 per 1,000 URLs**.
- **URL status checked** (optional): $0.0008 per URL checked, so a full export + check is $1.00 per 1,000 URLs.
- **URL compared** (Changes only): $0.00002 per URL, i.e. $0.02 per 1,000.
- **URL change** (Changes only): $0.001 per new, updated or removed URL.

Example: monitoring 10 competitor sites with 2,000 URLs each, daily, with ~15 new pages a day costs about $0.42/day ($0.40 compared + $0.015 changes).

# Actor input Schema

## `startUrls` (type: `array`):

A homepage (sitemaps are found via robots.txt, then /sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml, /sitemap.txt) or a direct sitemap URL (.xml, .xml.gz, .txt, RSS/Atom). Sitemap indexes are followed automatically.

## `mode` (type: `string`):

'All URLs' lists every URL (one billable row per URL). 'Changes only' compares with the previous run of the same monitor and outputs only new, updated (lastmod changed) and removed URLs; the first run saves a baseline. Schedule it daily to watch competitors' new pages.

## `checkStatus` (type: `boolean`):

Requests each output URL once and reports HTTP status, redirect chain, X-Robots-Tag, meta robots, canonical, response time and an 'indexable' flag. Billed per URL checked. In 'Changes only' mode only new and updated URLs are checked.

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

Stop after this many unique URLs per site.

## `includePattern` (type: `string`):

Optional. Case-insensitive regular expression, e.g. /blog/ or /products/. Non-matching URLs are skipped and not billed.

## `excludePattern` (type: `string`):

Optional. Case-insensitive regular expression, e.g. /tag/|/author/.

## `monitorName` (type: `string`):

Changes only: snapshots are kept per monitor name and site in a key-value store named 'sitemap-url-monitor-state' in your account. Use different names for separate monitors on the same site.

## `maxConcurrency` (type: `integer`):

Parallel requests when checking URLs. Keep it low to be polite to the site.

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

Not needed for most sites. Enable it if a site rate-limits you.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "mode": "all",
  "checkStatus": false,
  "maxUrlsPerSite": 300,
  "monitorName": "default",
  "maxConcurrency": 4,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `urls` (type: `string`):

No description

## `status` (type: `string`):

No description

## `changes` (type: `string`):

No description

## `full` (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 = {
    "startUrls": [
        {
            "url": "https://crawlee.dev"
        }
    ],
    "maxUrlsPerSite": 300
};

// Run the Actor and wait for it to finish
const run = await client.actor("mercury_ops/sitemap-url-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 = {
    "startUrls": [{ "url": "https://crawlee.dev" }],
    "maxUrlsPerSite": 300,
}

# Run the Actor and wait for it to finish
run = client.actor("mercury_ops/sitemap-url-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 '{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "maxUrlsPerSite": 300
}' |
apify call mercury_ops/sitemap-url-monitor --silent --output-dataset

```

## MCP server setup

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