# Sitemap URL Extractor & New Page Monitor (`pennapixel/sitemap-url-monitor`) Actor

Get every URL of a website from its sitemaps: auto-discovery via robots.txt, nested indexes, .gz, hreflang, images, news. Filter by pattern or lastmod. Monitor mode returns only new pages since the last run.

- **URL**: https://apify.com/pennapixel/sitemap-url-monitor.md
- **Developed by:** [Penna & Pixel](https://apify.com/pennapixel) (community)
- **Categories:** SEO tools, 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 $0.20 / 1,000 url returneds

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 URL Extractor & New Page Monitor

Get **every URL of a website from its XML sitemaps**, in seconds, without crawling a single page. Or schedule it and get **only the pages that are new since the last run**: new products, new articles, new job pages, new landing pages of a competitor.

### Features

- **Auto-discovery**: give `example.com` and the sitemaps are found from `robots.txt` (`Sitemap:` lines), then the usual locations (`/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml` …). Or give a sitemap URL directly.
- **Nested sitemap indexes** followed automatically, **.xml.gz** files decompressed, plain-text and RSS/Atom sitemaps supported
- Per URL: `lastmod`, `changefreq`, `priority`, **hreflang alternates**, **image sitemap** URLs, **Google News** title and publication date
- **Filters**: keep or drop URLs by regular expression, or keep only URLs modified after a date or in the last *N* days
- **Monitor mode** (`onlyNewUrls`): remembers what it has seen and returns only new URLs on the next run, flagged `isNew: true`
- Fast and light: no browser, no proxy, 256 MB of memory is enough for most sites

### Use cases

- SEO audits: list all indexable pages, find pages with old `lastmod`, check hreflang coverage
- **Competitor monitoring**: get an alert (with Apify integrations: e-mail, Slack, webhooks, Google Sheets) when a competitor publishes new products or pages
- Feed a crawler or an LLM pipeline with the exact list of pages to fetch
- Content inventories and migrations

### Input

```json
{
  "startUrls": ["apify.com", "https://blog.apify.com/sitemap.xml"],
  "excludeUrlPatterns": ["/tag/", "/author/"],
  "lastModifiedAfter": "30 days",
  "maxUrlsPerSite": 10000
}
```

For monitoring, add `"onlyNewUrls": true` and create a **schedule** (for example daily). On the first run you get all URLs (or none, if you turn off `firstRunOutputsAll`, which is cheapest); from the second run on, only new ones.

### Output

One row per URL (a real row from docs.python.org, hreflang list shortened):

```json
{
  "site": "https://docs.python.org/3/",
  "sitemapUrl": "https://docs.python.org/sitemap.xml",
  "url": "https://docs.python.org/3.12/",
  "lastmod": null,
  "changefreq": "yearly",
  "priority": null,
  "alternates": [
    { "hreflang": "de", "url": "https://docs.python.org/de/3.12/" },
    { "hreflang": "es", "url": "https://docs.python.org/es/3.12/" }
  ],
  "imageCount": 0,
  "images": [],
  "newsTitle": null,
  "newsPublishedAt": null
}
```

A `SUMMARY` record in the run's key-value store lists, for each site, the sitemaps found and read, how many URLs were found, matched and returned, how many were new, and any errors.

### Pricing

- **$0.20 per 1,000 URLs** returned ($0.0002 per URL)
- **$0.0005 per sitemap file** read (indexes included; a sitemap file holds up to 50,000 URLs)
- **$0.001 per run** start

URLs that are filtered out, already seen in monitor mode, or over your caps are not charged; sitemaps that fail are free. Set a maximum cost per run in the run options to stay in control.

Example: monitoring daily a 5,000-page shop with 5 sitemap files and about 20 new pages a day costs about **$0.0075 a day** after the first run. Extracting all 50,000 URLs of a site once costs about $10.

### Good to know

- The actor reads **only sitemaps**, never the pages themselves: pages missing from a site's sitemap are not found.
- It respects each site's **robots.txt** and waits between requests to the same site; sites that block automated access to their sitemaps are reported in the `SUMMARY`, not bypassed.
- The monitor memory is a key-value store named `sitemap-url-monitor-state` in your account (only short hashes of URLs, not the pages). Delete it to start fresh.
- Private and internal network addresses are refused.

### Support

A site whose sitemap comes out wrong? Open an issue with the URL: fixes are usually quick.

# Actor input Schema

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

A website (example.com or https://example.com) to find its sitemaps automatically, or the direct URL of a sitemap or sitemap index (.xml, .xml.gz, .txt).

## `onlyNewUrls` (type: `boolean`):

Return only the URLs that were not in the sitemaps on the previous run with the same website. The list of seen URLs is kept in a key-value store named 'sitemap-url-monitor-state' in your account. Schedule the run (daily, weekly) to get new pages as they appear.

## `firstRunOutputsAll` (type: `boolean`):

On the first monitor run of a website, return all its URLs (on) or only save them as the baseline and return nothing (off, cheapest).

## `includeUrlPatterns` (type: `array`):

Optional regular expressions. A URL is kept if it matches at least one. Example: /blog/ or /product/.

## `excludeUrlPatterns` (type: `array`):

Optional regular expressions. Example: /tag/ or ?page=

## `lastModifiedAfter` (type: `string`):

Optional. A date (2026-11-01) or a period ("7 days", "24 hours"). URLs without a lastmod date are dropped when this is set.

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

Cost cap: at most this many URL rows per website.

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

Safety cap on how many sitemap files (indexes included) are read for one website.

## Actor input object example

```json
{
  "startUrls": [
    "https://apify.com"
  ],
  "onlyNewUrls": false,
  "firstRunOutputsAll": true,
  "maxUrlsPerSite": 10000,
  "maxSitemapsPerSite": 500
}
```

# Actor output Schema

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

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

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

```

## MCP server setup

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