# Sitemap URL Extractor - All Pages of Any Website (`radarweb/sitemap-url-extractor`) Actor

Give a domain, get every URL in its sitemaps with last-modified date, priority, images and hreflang. Finds sitemaps via robots.txt and common paths, follows indexes, reads .gz, text and broken XML. Filter by pattern or date.

- **URL**: https://apify.com/radarweb/sitemap-url-extractor.md
- **Developed by:** [Riccardo Bonadio](https://apify.com/radarweb) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 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: list every page of any website, with lint and change tracking

Extracts all URLs from a website's sitemaps (lastmod, changefreq, priority, images, hreflang), checks the sitemaps for protocol errors and tracks new, modified and removed pages between runs; built for SEO specialists, agencies and AI/scraping pipelines; $0.0004 per URL ($0.40 per 1,000), duplicates and filtered URLs free.

### When to use it

- How do I get the full list of URLs of a website without crawling it?
- Which pages did my competitor publish this week?
- Is my sitemap valid (duplicates, wrong host, future dates, over 50,000 URLs)?
- Which pages have not been updated for years (`lastmod`)?
- How do I feed a page scraper or a RAG pipeline with all article URLs of a publication?

### Quick start

```json
{ "startUrls": ["example.com"], "maxUrlsPerSite": 1000 }
```

Add `"lintSitemap": true` for the quality checks, or `"trackChanges": true` and schedule it weekly to see only what changed.

### What it handles

- Finds sitemaps automatically: `robots.txt` `Sitemap:` lines first, then common locations (`/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`, `.xml.gz`, …), also for sites in a sub-folder (`example.com/news/`).
- Follows nested **sitemap indexes** (5 levels by default, up to 10 with `maxDepth`), **gzip** sitemaps, **text** sitemaps and RSS/Atom feeds. Broken XML is read with a tolerant fallback.
- Image, news and `hreflang` extensions.
- Filters: include/exclude by text, glob or regex; *modified after* a date; URL limit per website. The run stops downloading as soon as the limit is reached.

### Lint the sitemaps (`lintSitemap`)

Checks every sitemap against the sitemaps.org rules and lists the problems in the `SUMMARY` record under `lintIssues` (issue code, sitemap, count, up to 5 examples):
`too_many_urls` (over 50,000 in one file), `duplicate_url`, `url_other_host`, `url_not_absolute`, `lastmod_invalid`, `lastmod_in_future`, `priority_out_of_range`. It reads data already downloaded: no extra requests, no extra charge. It does not check that the URLs return HTTP 200. The lint covers only the entries actually read: if the run stops early (`maxUrlsPerSite` or the cost limit), the rest of the sitemap is not checked, so run without limits for a full lint.

### Track changes

Turn on `trackChanges` and schedule the run: each run lists only URLs that are **new**, **modified** (lastmod changed) or **removed** since the previous run. The first run is the baseline. Unchanged URLs are not charged.

### Output example

Illustrative output built from the test fixture (`examples/example-output.json`), not from a real website:

```json
{
  "url": "https://ex.com/a",
  "lastmod": "2025-03-01",
  "changefreq": null,
  "priority": 0.8,
  "domain": "ex.com",
  "sitemapUrl": "https://ex.com/sitemap.xml"
}
```

### Pricing with examples

$0.0004 per unique URL extracted (price in `.actor/pay_per_event.json`; check the Pricing tab for the live value).

- Small blog, 300 URLs: about $0.12.
- Online shop, 20,000 URLs: about $8.
- Weekly change tracking of a 20,000-URL competitor where 150 pages change: about $0.06 per run after the baseline.

### Use it from AI agents (MCP)

Every Actor on Apify can be called as a tool through the Apify MCP server (`mcp.apify.com`; address not verified from this environment, check Apify's docs before publishing). The descriptions of all input fields are written for agents. Example request: "List all URLs of example.com modified after 2026-10-01 and lint its sitemap."

### FAQ

- **Does it open the pages?** No, it only reads sitemap files.
- **What if the site has no sitemap?** The run says so in the log and in `SUMMARY.errors`.
- **Are duplicates charged?** No. Duplicates across sitemaps and URLs removed by filters are free.
- **Does `lintSitemap` cost extra?** No.
- **Can it read password-protected sitemaps?** No.
- **Does it respect robots.txt?** It reads robots.txt only to discover sitemap locations; sitemap files are public by design.
- **How do I detect removed pages?** Use `trackChanges` with the same `memoryName`, without limits or filters.
- **Can I use a proxy?** Yes, enable `proxyConfiguration` if a site blocks data-center IPs.

### Alternatives & comparison

Other sitemap extractors exist in the Apify Store (not compared feature by feature here; to be verified before publishing, including any Apify-owned `apify/sitemap-extractor`). Use this one when you need lint, `lastmod` filtering or change tracking. For a full crawl of rendered pages use a crawler instead.

### Limitations

- Only what the site publishes in sitemaps: pages missing from the sitemap are not found.
- `lastmod` is as accurate as the site makes it.
- No HTTP status check per URL.
- Change tracking is not updated when a run is limited by URL count, filters, date or budget.

### Changelog

- 2026-11-11: added `lintSitemap`; README restructured.

# Actor input Schema

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

A domain (example.com), a page (example.com/blog/) or a direct sitemap URL (example.com/post-sitemap.xml). One per line.

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

0 = no limit.

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

Keep URLs matching any of these. Plain text (/blog/), glob (*/products/*) or regex between slashes (//p/\d+$/).

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

Drop URLs matching any of these. Same syntax as above.

## `modifiedAfter` (type: `string`):

Only URLs whose lastmod is on or after this date. URLs without lastmod are skipped when this is set.

## `trackChanges` (type: `boolean`):

Remember each site's URLs between runs and mark every URL as new, modified (lastmod changed) or removed. Schedule it weekly to see what competitors publish.

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

When tracking, skip unchanged URLs (they are not charged). The first run is the baseline and lists all URLs as new.

## `lintSitemap` (type: `boolean`):

Check every sitemap against the sitemaps.org rules (over 50,000 URLs, duplicate URLs, URLs on another host, non-absolute URLs, invalid or future lastmod, priority outside 0-1). Issues are listed in the SUMMARY record under 'lintIssues'. Free: no extra requests and no extra charge.

## `memoryName` (type: `string`):

Use a different name per project. Stored in your key-value store 'sitemap-memory'.

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

Add the image:loc entries of each page.

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

Add the xhtml:link alternate language versions of each page.

## `maxDepth` (type: `integer`):

How many levels of nested sitemap indexes to follow.

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

Not needed for most sites. Enable only if a site refuses requests from data-center IPs.

## Actor input object example

```json
{
  "startUrls": [
    "apify.com"
  ],
  "maxUrlsPerSite": 1000,
  "includePatterns": [],
  "excludePatterns": [],
  "trackChanges": false,
  "onlyChanges": true,
  "lintSitemap": false,
  "memoryName": "default",
  "includeImages": false,
  "includeAlternates": false,
  "maxDepth": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

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

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

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

```

## MCP server setup

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