# Sitemap Extractor & Monitor: All URLs, New & Removed Pages (`kj_ais/sitemap-url-extractor-change-monitor`) Actor

Extract every URL from any website's XML sitemaps (indexes, .gz, RSS) and monitor new, updated and removed pages between runs. No false removals. Export CSV, JSON, Excel.

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

## Pricing

from $0.10 / 1,000 url saveds

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

### What does Sitemap Extractor & Change Monitor do?

**Sitemap Extractor & Change Monitor** pulls every URL from a website's XML sitemaps, with lastmod date, change frequency, priority, image count and hreflang alternates. Give it a website (it finds the sitemaps through robots.txt and the usual locations) or a direct sitemap link, and export the URLs to CSV, JSON, Excel or Google Sheets.

Turn on **monitor mode** and schedule it: each run then returns only pages that are **new, updated or removed** since the last run, so you see when a competitor publishes a new page, product or blog post.

**Why this one:**

- **No false "removed" alerts.** If one sitemap file fails, times out or is skipped this time, the pages it listed are kept, not reported as removed. Only pages from sitemap files that were read successfully can be marked removed.
- **You can see what was read.** Every run saves a per-file report (HTTP status, sitemap type, gzip, URL count, error) in the `OUTPUT` record, so a partial result is never silent.
- **Reads more formats:** sitemap indexes nested up to 10 levels, `.xml.gz` (detected by content, even when the server sends the wrong type), RSS and Atom feeds, and plain-text URL lists.
- **Fast and light:** plain HTTP requests, no browser. In our tests it saved 20,000 URLs in about 4 seconds of run time.
- **Low, simple price:** **$0.10 per 1,000 URLs**, plus $0.0005 per run, with platform usage included. Monitor runs only pay for pages that changed.

### Who is it for?

- **SEO specialists and agencies**: get a site's full URL inventory for audits, migrations and crawl planning.
- **Marketers and founders**: get told when competitors add new pages, products, landing pages or blog posts.
- **Developers and data teams**: seed a crawler or an AI/RAG pipeline with a clean, deduplicated URL list.
- **Content teams**: list everything modified after a date to review recent changes.

### What data do you get?

| Field | Example | Notes |
|---|---|---|
| `url` | https://docs.apify.com/api | Page URL from the sitemap, deduplicated per website |
| `lastmod` | 2026-11-20T20:24:38.000Z | Last modified date (ISO), if the sitemap gives one |
| `changefreq` | weekly | If the sitemap gives one |
| `priority` | 0.5 | If the sitemap gives one |
| `imageCount` | 2 | Images listed for the page (image sitemaps) |
| `newsTitle` | Headline text | News sitemaps and RSS/Atom feeds |
| `alternates` | \[{"hreflang":"de","url":"…/de/"}] | Only with "Include hreflang alternates" |
| `sitemapUrl` | https://docs.apify.com/sitemap_base.xml | The sitemap file that listed this URL |
| `website` | https://docs.apify.com | The site you entered |
| `changeType` | new / updated / removed / initial | Monitor mode only |
| `previousLastmod` | 2026-11-01T00:00:00.000Z | Monitor mode, for updated or removed pages |
| `scrapedAt` | 2026-11-23T05:52:11.843Z | When the run saved the row |

Fill rate of `lastmod`, `changefreq` and `priority` depends on the website: many sites leave them out of their sitemaps.

### How to use it

1. Click **Try for free**.
2. Paste one or more websites (`example.com`) or sitemap links into **Websites or sitemap URLs**.
3. Optional: add **Only URLs containing** (for example `/blog/*`) or a **Modified after** date.
4. Click **Start**, then download the results as CSV, Excel or JSON.

**To watch for new pages:** turn on **Only new, updated and removed pages since last run**, run it once (that run returns everything, marked `initial`), then add a daily schedule. Use a different **Monitor name** for each watch list.

**API:** call the Actor from any language with the Apify API or client libraries, then read the default dataset. The run's `OUTPUT` record holds the per-sitemap report.

### Input example

```json
{
  "startUrls": ["https://docs.apify.com"],
  "onlyChanges": true,
  "monitorName": "apify-docs"
}
```

### Output example

```json
{
  "url": "https://docs.apify.com/api",
  "lastmod": null,
  "changefreq": "weekly",
  "priority": 0.5,
  "imageCount": 0,
  "newsTitle": null,
  "sitemapUrl": "https://docs.apify.com/sitemap_base.xml",
  "website": "https://docs.apify.com",
  "changeType": "initial",
  "previousLastmod": null,
  "scrapedAt": "2026-11-23T05:52:11.843Z"
}
```

### How much does it cost to extract URLs from a sitemap?

You pay **$0.10 per 1,000 URLs** saved, plus **$0.0005 each time a run starts**. Apify's platform usage is included, so there are no other charges:

- A 4,000-page documentation site: about $0.40
- 20,000 URLs from a large site: about $2.00
- A daily monitor run where 5 pages changed: under one cent, because only changes are saved

You can set a maximum cost per run in the run options.

### Limits and what it does not do

- It reads **sitemaps and feeds only**. It does not crawl links on pages, so pages missing from a site's sitemap won't appear.
- It respects **robots.txt**: sitemap files that robots.txt disallows are skipped and listed in the report.
- Some sites refuse automated requests (for example with HTTP 403). Those files show the error in the report. You can turn on a proxy, but sites that block bots on purpose may still refuse.
- **Monitor mode** keeps one memory per website and monitor name. Very large sites (several hundred thousand URLs) should be split with **Only URLs containing** into separate monitor names.
- "Updated" relies on the site's `lastmod` values. If a site doesn't publish lastmod, only new and removed pages are detected.

### FAQ

**How do I extract all URLs from a website's sitemap without coding?**
Paste the website address into the input, click Start, and download the URL list as CSV or Excel when the run finishes.

**How do I find a website's sitemap?**
You don't have to. The Actor reads the site's robots.txt for `Sitemap:` lines and also checks common locations such as /sitemap.xml, /sitemap_index.xml and /wp-sitemap.xml.

**How can I get alerts when a competitor adds a new page?**
Turn on monitor mode, run it once, then schedule it daily. Each run returns only new, updated or removed pages, and you can connect the run to email, Slack or a webhook with Apify integrations.

**Does it handle sitemap index files and .gz sitemaps?**
Yes. It follows nested sitemap indexes up to 10 levels deep, skips loops and duplicates, and unzips `.xml.gz` files automatically.

**Will a temporary error make pages look removed?**
No. A page is only reported as removed when the sitemap file that listed it was read successfully and no longer contains it.

**Can I export sitemap URLs to Google Sheets?**
Yes. Download the dataset as CSV or Excel, or use Apify's Google Sheets integration to send results straight to a sheet.

**Is it legal to scrape sitemaps?**
Sitemaps are files that websites publish so automated tools can find their pages, and this Actor follows robots.txt. You are responsible for how you use the data, so check the site's terms for your use case.

**How much does it cost to get 1,000 URLs?**
$0.10 per 1,000 URLs, plus $0.0005 per run. Apify's platform usage is included. In monitor mode you only pay for new, updated or removed pages.

### Disclosure

This Actor was built and is maintained with help from AI coding tools, and it was tested with real runs before release. Found a problem? Open an issue and we'll fix it.

# Actor input Schema

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

Websites (example.com) or direct sitemap links (https://example.com/sitemap.xml, .xml.gz, RSS/Atom feeds or plain-text URL lists). For a website, sitemaps are found through robots.txt and common locations.

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

Remembers each website's URLs between runs. The first run returns all URLs (changeType 'initial'); later runs return only pages that are new, have a newer lastmod, or were removed. Schedule it to watch competitors' new pages.

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

Separate memory for separate watch lists. Letters, numbers and dashes.

## `includeRemoved` (type: `boolean`):

Adds rows with changeType 'removed' for URLs that disappeared. Removed pages are only reported when every sitemap of the site was read successfully and no filter is set, so a temporary error never creates false 'removed' rows.

## `includePatterns` (type: `array`):

Keep only URLs that match one of these texts. Use \* as a wildcard, for example /blog/\* or */product/*.

## `excludePatterns` (type: `array`):

Drop URLs that match any of these texts (wildcard \*).

## `lastmodAfter` (type: `string`):

Keep only URLs whose sitemap lastmod is on or after this date, e.g. 2026-11-01. URLs without lastmod are skipped when this is set.

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

Stop after saving this many URLs in total.

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

Safety limit on sitemap files read per run (across all websites).

## `includeAlternates` (type: `boolean`):

Adds the alternate language URLs (xhtml:link hreflang) listed for each page.

## `requestTimeoutSecs` (type: `integer`):

How long to wait for one sitemap file before retrying.

## `maxRetries` (type: `integer`):

Retries on network errors, HTTP 429 and 5xx, with backoff.

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

Not needed for most sites. Turn on if a site refuses Apify's servers.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com"
  ],
  "onlyChanges": false,
  "monitorName": "default",
  "includeRemoved": true,
  "maxUrls": 0,
  "maxSitemaps": 1000,
  "includeAlternates": false,
  "requestTimeoutSecs": 30,
  "maxRetries": 3,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Extracted sitemap URLs, or changes in monitor mode (dataset items).

## `report` (type: `string`):

Per-sitemap-file report: HTTP status, type, URL count, errors.

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

// Run the Actor and wait for it to finish
const run = await client.actor("kj_ais/sitemap-url-extractor-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 = { "startUrls": ["https://docs.apify.com"] }

# Run the Actor and wait for it to finish
run = client.actor("kj_ais/sitemap-url-extractor-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 '{
  "startUrls": [
    "https://docs.apify.com"
  ]
}' |
apify call kj_ais/sitemap-url-extractor-change-monitor --silent --output-dataset

```

## MCP server setup

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