# Sitemap URL Extractor – All URLs, Changes & Redirects (`mikumans/sitemap-extractor-pro`) Actor

Get every URL from any website's sitemaps: robots.txt discovery, sitemap indexes, .gz, image/video/news, hreflang, lastmod filters, new/removed URL monitoring and status, redirect and canonical checks.

- **URL**: https://apify.com/mikumans/sitemap-extractor-pro.md
- **Developed by:** [Michiel Kustermans](https://apify.com/mikumans) (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

$2.00 / 1,000 url results

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 URLs, Changes & Redirects

Enter a domain and get **every URL from its sitemaps** as a clean table: lastmod, images, videos, news, hreflang, plus **what's new or removed since your last run**. Optionally check each URL's **status code, redirects and canonical**.

### What can you use it for?

- **SEO audits:** find 404s, redirects and canonical mismatches listed in a sitemap.
- **Competitor monitoring:** schedule daily and get only the **new pages** (products, blog posts, landing pages).
- **Crawler/RAG input:** feed a clean URL list into other scrapers, AI pipelines or the PageSpeed Checker.
- **Site migrations:** compare URL inventories before and after.
- **News & media tracking:** read Google News sitemaps with titles, publication dates and keywords.

### Features

| Feature | This Actor | Typical sitemap Actors |
|---|---|---|
| Domain-only input: robots.txt + common-path discovery | ✅ | Sometimes |
| Sitemap index recursion, **.xml.gz** | ✅ | ✅ / sometimes |
| **Image, video and news** extensions | ✅ | ❌ |
| **hreflang** alternates | ✅ | ❌ |
| lastmod date filter, include/exclude regex | ✅ | Rarely |
| **New / removed URL diff** between runs | ✅ | ❌ |
| Status checks with **GET fallback**, redirect chain, canonical, meta robots | ✅ | HEAD only |
| Proxy support for sites that block cloud IPs | ✅ | Varies |
| **Failures are free** | ✅ | ❌ |

### How to use

1. Enter one or more domains (e.g. `apify.com`) or sitemap URLs.
2. Optionally set a lastmod range, URL patterns, or enable status checks.
3. Click **Start**. Schedule it and enable *Output only new URLs* for monitoring.

#### Example input

```json
{ "startUrls": [{ "url": "https://apify.com" }], "maxUrls": 1000, "lastmodFrom": "2026-01-01", "checkStatus": true }
```

#### Example output (real run)

```json
{ "url": "https://www.theguardian.com/world/live/2026/oct/13/...", "lastmod": "2026-10-13T08:50:00Z", "types": ["page", "image", "news"],
  "news": { "title": "Two ships hit by drones of unknown origin off Bulgarian coast – Europe live", "publicationName": "The Guardian", "language": "en" },
  "diffStatus": "new", "discoveredVia": "input" }
```

```json
{ "url": "https://apify.com/about", "status": 200, "redirected": false, "finalUrl": "https://apify.com/about",
  "canonical": "https://apify.com/about", "canonicalMatches": true, "responseTimeMs": 182 }
```

The **SUMMARY** record gives per-site totals, how sitemaps were found, and counts and samples of new and removed URLs.

### Pricing

Pay per URL returned, with no platform usage fees on top. See the **Pricing** tab for the current price.

- 1,000 URLs ≈ $2 · 10,000 URLs ≈ $20 · 100,000 URLs ≈ $200
- With *Output only new URLs*, daily monitoring costs only for new pages.
- **Unreadable sitemaps and sites without a sitemap are free.** They're listed in `FAILED`.

### Integrations

- **API:** run via the [Apify API](https://docs.apify.com/api/v2) or the JavaScript/Python clients, and get results as JSON, CSV, Excel or XML.
- **No-code:** native Apify integrations for **Make**, **Zapier** and **n8n**, plus Google Sheets, Slack, webhooks and **schedules**.
- **AI agents:** available through the Apify MCP server, so Claude, ChatGPT and other agents can call it as a tool.

### FAQ

**The site has no sitemap in robots.txt.** The Actor also tries common paths (`/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`, …). You can also pass the sitemap URL directly.
**I get HTTP 403.** Some publishers block cloud IPs. Enable the Proxy option.
**How does the diff work?** The URL list is saved per site + filter set in a named store. The next run marks URLs as new or existing. Removed URLs are reported only when the run wasn't capped by *Max URLs*, so the comparison is complete.
**Does it crawl pages?** No, it reads sitemaps only (fast and cheap). Status checks are optional.

### Related Actors from the same developer

- 📸 **[Website Screenshot API](https://apify.com/mikumans/website-screenshot)**: full-page, mobile and PDF screenshots of any URL.
- ⚡ **[Bulk PageSpeed & Lighthouse Checker](https://apify.com/mikumans/bulk-pagespeed-auditor)**: Core Web Vitals and Lighthouse scores for many URLs.

**Workflow tip:** extract URLs with the Sitemap Extractor → audit them with the PageSpeed Checker → screenshot the flagged pages.

**Keywords:** sitemap extractor, sitemap.xml parser, sitemap URL list, sitemap to CSV, website URL list, new pages monitor, broken links in sitemap, redirect checker, canonical checker, hreflang.

# Actor input Schema

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

Domains/website URLs (sitemaps found via robots.txt and common paths) or direct sitemap URLs (.xml, .xml.gz, sitemap indexes).

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

Stop after this many page URLs per start URL.

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

Safety cap on sitemap files processed.

## `lastmodFrom` (type: `string`):

Only URLs with lastmod on/after this date (YYYY-MM-DD). URLs without lastmod are excluded when a date filter is set.

## `lastmodTo` (type: `string`):

Only URLs with lastmod on/before this date (YYYY-MM-DD).

## `includeUrlPattern` (type: `string`):

Only keep URLs matching this regular expression.

## `excludeUrlPattern` (type: `string`):

Drop URLs matching this regular expression.

## `includeMedia` (type: `boolean`):

Extract image:, video: and news: sitemap extensions.

## `includeHreflang` (type: `boolean`):

Extract xhtml:link hreflang alternates.

## `diffWithPreviousRun` (type: `boolean`):

Mark URLs as new/existing and list removed URLs compared with the last run for the same site (state kept in the named store 'sitemap-extractor-state').

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

With diff enabled, output only URLs not seen in the previous run (great for monitoring).

## `stateKey` (type: `string`):

Custom key for diff state. By default the state is tied to the start URL plus filters, so different filter sets are tracked separately. Removed URLs are only reported when the run was not cut off by Max URLs.

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

Request each URL: HTTP status, redirects (with chain), final URL, response time.

## `detectCanonical` (type: `boolean`):

With status checks, read rel=canonical (HTML or Link header) and meta robots.

## `statusConcurrency` (type: `integer`):

Parallel page requests.

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

Timeout per request.

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

Optional proxy for sites that block datacenter IPs (e.g. some news publishers).

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://docs.apify.com"
    }
  ],
  "maxUrls": 200,
  "maxSitemaps": 500,
  "includeMedia": true,
  "includeHreflang": true,
  "diffWithPreviousRun": true,
  "onlyNewUrls": false,
  "checkStatus": false,
  "detectCanonical": true,
  "statusConcurrency": 10,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

One row per page URL

## `summary` (type: `string`):

Per-site counts, new and removed URLs

## `failed` (type: `string`):

Sitemaps or sites that could not be read

# 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://docs.apify.com"
        }
    ],
    "maxUrls": 200,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("mikumans/sitemap-extractor-pro").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://docs.apify.com" }],
    "maxUrls": 200,
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("mikumans/sitemap-extractor-pro").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://docs.apify.com"
    }
  ],
  "maxUrls": 200,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call mikumans/sitemap-extractor-pro --silent --output-dataset

```

## MCP server setup

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

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/51CJzthrRQ40rh8mQ/builds/HPVK4m1rPaoA4M97i/openapi.json
