# Sitemap URL Extractor: Bulk, Lastmod Filter, New URL Alerts (`variegated_binturong/sitemap-url-extractor-changes`) Actor

Every URL from website sitemaps for many sites: robots.txt discovery, nested indexes, gzip, lastmod filter, only new URLs since last run.

- **URL**: https://apify.com/variegated_binturong/sitemap-url-extractor-changes.md
- **Developed by:** [Luigi Fiano](https://apify.com/variegated_binturong) (community)
- **Categories:** SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 url delivereds

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: Bulk, Lastmod Filter, New URL Alerts

Get **every URL a website publishes in its sitemap**, for one site or hundreds, in a single run. Then schedule it and get **only the URLs that are new since last time**: new products, new blog posts, new landing pages of your competitors.

### What you get per URL

- **URL**, site and top-level **section** (/blog, /products, ...)
- **lastmod**, changefreq and priority as declared by the site
- **isNew** flag when change detection is on
- Image URLs and hreflang language versions (optional)
- News sitemap titles when present
- The sitemap file the URL came from

### How it finds the sitemaps

1. Reads the `Sitemap:` lines in robots.txt
2. If none, tries /sitemap.xml, /sitemap_index.xml, /sitemap-index.xml, /wp-sitemap.xml and /sitemap.xml.gz
3. Follows nested sitemap indexes, gzip files and plain-text sitemaps

You can also paste a direct sitemap URL.

### Why people use it

- SEO audits: how many pages does a site really have, which sections are growing
- Competitor monitoring: schedule weekly and receive only the new URLs
- Content research: newest articles by lastmod date
- E-commerce: new product pages of a store
- Feeding crawlers, AI agents and RAG pipelines with a clean URL list

### Input example

```json
{
  "startUrls": ["apify.com", "https://www.example.com/sitemap_index.xml"],
  "includePattern": "/blog/",
  "lastmodAfter": "2026-01-01",
  "onlyNewSinceLastRun": true
}
```

### Output example

```json
{
  "url": "https://apify.com/store",
  "site": "https://apify.com",
  "section": "/store",
  "lastmod": "2026-10-01",
  "changefreq": "daily",
  "priority": 0.8,
  "isNew": null,
  "sitemapUrl": "https://apify.com/sitemap.xml"
}
```

The key-value store record `SUMMARY` holds, per site: sitemaps found, URLs found and delivered, newest and oldest lastmod, URL count per section.

### Change detection

With **Only URLs new since the last run** on, the Actor stores the URL list of every site in a named key-value store (default `sitemap-url-history`). The next run returns only URLs that were not there before. The first run returns everything and builds the baseline. Use a different store name per project.

### Pricing (pay per result)

You pay only for URLs delivered to the dataset. Filtered-out URLs and URLs that are not new are free.

| Event | Price |
|---|---|
| URL delivered | $0.0015 |

Example: a 2,000-page site costs about $3 the first time. A weekly change check that finds 40 new URLs costs about $0.06.

Use "Max cost per run" to cap spending.

### Limitations

- Only URLs the site lists in its sitemaps. Pages missing from the sitemap are not crawled.
- lastmod is what the site declares, and some sites set it to today for every URL.
- Sites that block automated requests to their sitemap may return nothing.

### Data and legality

Sitemaps are public files that websites publish precisely so that machines can read them. This Actor reads only those files and robots.txt, and collects no personal data.

### Support

Open an issue on the Actor page with the site and run link.

# Actor input Schema

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

Domains (example.com), homepages or direct sitemap URLs (.xml, .xml.gz, .txt). One per line.

## `discoverFromRobots` (type: `boolean`):

Reads the Sitemap: lines of robots.txt.

## `tryCommonLocations` (type: `boolean`):

If robots.txt lists nothing, tries /sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml and similar.

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

For example /blog/ or /products/. Case insensitive.

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

For example /tag/|/author/.

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

Date like 2026-01-31. URLs without lastmod are skipped when this is set.

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

Remembers the URLs of each site in a named key-value store and returns only the ones that were not there last time. Ideal with the Apify scheduler to watch competitors.

## `changeStoreName` (type: `string`):

Named key-value store used by change detection. Use a different name per project.

## `includeImages` (type: `boolean`):

Adds image:loc entries of each URL.

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

Adds the language versions listed in the sitemap.

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

Maximum URLs delivered per site, after filters. You pay only for URLs delivered.

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

Safety limit for very large sitemap indexes.

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

Retries with exponential backoff on 429 and 5xx.

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

Large sitemaps may need more time.

## Actor input object example

```json
{
  "startUrls": [
    "apify.com"
  ],
  "discoverFromRobots": true,
  "tryCommonLocations": true,
  "onlyNewSinceLastRun": false,
  "changeStoreName": "sitemap-url-history",
  "includeImages": false,
  "includeAlternates": false,
  "maxUrlsPerSite": 10000,
  "maxSitemapsPerSite": 200,
  "maxRetries": 3,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

## `overview` (type: `string`):

No description

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

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

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

```

## MCP server setup

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

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/6QagWTIBf0gd340VV/builds/FcP5JpMm6EILF4VMt/openapi.json
