# Sitemap URL Extractor: All Pages, lastmod & New-URL Monitor (`apizap.com/sitemap-url-extractor`) Actor

Every URL from a site's XML sitemaps with lastmod, priority and image count. Auto-discovers via robots.txt, follows nested indexes and .gz, filters by regex or date, and can return only URLs new since the last run. For RAG, SEO and monitoring. By Apizap.

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

## Pricing

from $0.25 / 1,000 url extracteds

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: All Pages, lastmod & New-URL Monitor

**Get every page URL of a website in seconds, straight from its XML sitemaps.** Enter a domain or a sitemap URL; the Actor discovers sitemaps via `robots.txt` and common paths, follows **nested sitemap indexes** and **.xml.gz** files, and returns each URL with `lastmod`, `changefreq`, `priority` and image count. Filter by regex or date, or switch on **monitor mode** to output only URLs that are new since your last run.

### Use cases

- **RAG / AI ingestion**: get the exact list of docs pages to feed into a crawler or vector DB.
- **Content & competitor monitoring**: schedule daily and get only newly published pages (blogs, products, docs, changelogs).
- **SEO**: audit sitemap coverage, find stale pages by `lastmod`, count URLs per section.
- **Agents via MCP**: "list all pages under /docs on example.com updated this week".

### Input

```json
{
  "startUrls": ["https://developer.mozilla.org", "https://blog.cloudflare.com/sitemap.xml"],
  "includePatterns": ["/docs/"], "excludePatterns": ["/tag/"],
  "lastmodAfter": "7 days", "onlyNewSinceLastRun": false,
  "maxUrlsPerSite": 0, "maxItems": 10000
}
```

### Output (one item per URL)

```json
{ "url": "https://blog.cloudflare.com/…", "lastmod": "2026-11-12T14:00:00.000Z", "changefreq": null, "priority": null,
  "imageCount": 1, "site": "blog.cloudflare.com", "sitemap": "https://blog.cloudflare.com/sitemap-posts.xml",
  "isNew": null, "extractedAt": "2026-11-14T07:21:55.404Z" }
```

A run summary (sitemap files read, URLs read/output per site) is saved as `SUMMARY`.

### Pricing (pay per result)

Suggested: **$0.25 per 1,000 URLs** (event `url`, $0.00025) + $0.005 per run start. Monitor runs that find nothing new cost almost nothing.

### FAQ

**No sitemap found?** Some sites don't publish one; try their sitemap URL directly if you know it.
**Does it crawl pages?** No – it only reads sitemap files, so it's fast, cheap and light on the target site.

***

**Made by [Apizap](https://tools.apizap.com)** – small, reliable, pay-per-result data tools for developers and AI agents. See all our tools at [tools.apizap.com](https://tools.apizap.com) or email support@apizap.com for custom data feeds.

# Actor input Schema

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

A domain (example.com), a homepage URL, or a direct sitemap URL (…/sitemap.xml, …/sitemap.xml.gz). Domains are auto-discovered via robots.txt and common sitemap paths.

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

Keep only URLs matching at least one regex, e.g. `/blog/` or `/products/.+`.

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

Drop URLs matching any of these regexes.

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

Keep only URLs with lastmod on/after this date (YYYY-MM-DD) or relative (e.g. `7 days`). URLs without lastmod are dropped when set.

## `onlyNewSinceLastRun` (type: `boolean`):

Remember seen URLs in a named key-value store and output only new ones on later runs (great for scheduled monitoring).

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

0 = unlimited.

## `maxItems` (type: `integer`):

Hard cap on results (and on your cost). 0 = unlimited.

## Actor input object example

```json
{
  "startUrls": [
    "https://apify.com",
    "https://www.python.org/sitemap.xml"
  ],
  "includePatterns": [],
  "excludePatterns": [],
  "onlyNewSinceLastRun": false,
  "maxUrlsPerSite": 0,
  "maxItems": 10000
}
```

# Actor output Schema

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

Sitemap URLs with lastmod, changefreq, priority and source sitemap.

# 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",
        "https://www.python.org/sitemap.xml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("apizap.com/sitemap-url-extractor").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",
        "https://www.python.org/sitemap.xml",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("apizap.com/sitemap-url-extractor").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",
    "https://www.python.org/sitemap.xml"
  ]
}' |
apify call apizap.com/sitemap-url-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,apizap.com/sitemap-url-extractor"
        }
    }
}
```

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/1Ffee9Tn3Gd2rrAWO/builds/nLWIE6oBHeEGKCnm0/openapi.json
