# Sitemap URL Extractor: every page of a website (`opstoolkit/sitemap-url-extractor`) Actor

Give it a domain, get every page URL in its sitemaps, one row per URL with lastmod, priority, images and hreflang. Finds sitemaps via robots.txt, follows indexes and .gz files, filters by regex or date. $0.15 per 1,000 URLs, sites with no sitemap free.

- **URL**: https://apify.com/opstoolkit/sitemap-url-extractor.md
- **Developed by:** [Elio Saliba](https://apify.com/opstoolkit) (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.15 / 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: every page of a website

Give it a domain and get every page URL the site lists in its sitemaps, one row per URL, with last modified date, change frequency and priority. It finds the sitemaps through robots.txt, follows sitemap indexes and `.xml.gz` files, and stops at the limit you set.

Built for SEO people, developers and researchers who need a clean URL list: to audit a site, seed a crawler, find what changed since last month, or compare a competitor's content with their own.

**$0.15 per 1,000 URLs.** Websites with no sitemap, unreachable sites and blocked sites are free. Apify's free monthly credit covers a first test run at no cost.

### What you get

One row per URL.

| Column | Example | Notes |
|---|---|---|
| `url` | `https://blog.cloudflare.com/rejected-cloudflare-logos` | Trimmed, de-duplicated |
| `lastmod` | `2026-07-15T12:25:32.957Z` | As the site writes it. `null` when the sitemap has none |
| `changefreq` | `weekly` | `null` when missing |
| `priority` | `0.5` | 0.0 to 1.0, `null` when missing or out of range |
| `sitemapUrl` | `https://blog.cloudflare.com/sitemap-posts.xml` | The file the URL came from |
| `site` | `blog.cloudflare.com` | Useful when you list several websites |
| `images` | `["https://.../logo.png"]` | Only with **Include image URLs** |
| `alternates` | `[{"hreflang": "fr", "href": "https://.../fr/"}]` | Only with **Include hreflang alternates** |

A `SUMMARY` record in the key-value store lists each website you gave: which sitemap files were read, how many URLs were found, skipped or returned, and what went wrong if nothing came back.

Export as JSON, CSV, Excel or HTML.

### How to use

1. **Paste websites**, one per line. A domain (`example.com`) works. So does a direct sitemap link such as `https://example.com/sitemap_index.xml`.
2. **Set Max URLs in total.** You pay per URL returned, so start with 1,000 to see the output.
3. **Press Start** and open the dataset. Add filters later if you only want part of the site.

### Use it from an AI agent

In Claude, ChatGPT or Cursor, add the Apify MCP server (https://mcp.apify.com) and let the agent call this Actor (`opstoolkit/sitemap-url-extractor`). It needs only `sites`. Tell the agent a URL limit, because you pay per URL returned.

Example prompt: "List up to 500 URLs from the sitemap of crawlee.dev that contain /docs/ and were modified after 2026-10-01."

### Input example

```json
{
  "sites": ["https://crawlee.dev", "https://blog.cloudflare.com"],
  "maxUrls": 5000,
  "maxUrlsPerSite": 3000,
  "includePattern": "/blog/",
  "modifiedAfter": "2026-07-01",
  "includeImages": false,
  "includeAlternates": false
}
```

- **Only URLs matching** and **Skip URLs matching** take regular expressions, for example `/blog/` or `/tag/|/page/\d+`.
- **Only URLs modified after** needs a `lastmod` date. URLs with no `lastmod` are dropped when it is set.
- **Max URLs per website** keeps one huge site from using the whole budget.
- **Only URLs on the same website** is on by default. Subdomains of the site are kept, other domains are dropped.

### Output example

From a real run on a public site with `modifiedAfter` set (shortened):

```json
{
  "url": "https://blog.cloudflare.com/enabling-google-analytics-on-wordpress-blog",
  "lastmod": "2026-07-15T12:25:22.052Z",
  "changefreq": null,
  "priority": null,
  "sitemapUrl": "https://blog.cloudflare.com/sitemap-posts.xml",
  "site": "blog.cloudflare.com"
}
```

And one `SUMMARY` entry:

```json
{
  "input": "https://crawlee.dev",
  "site": "crawlee.dev",
  "status": "ok",
  "sitemapsRead": ["https://crawlee.dev/sitemap.xml"],
  "urlsFound": 301,
  "urlsReturned": 300,
  "problems": []
}
```

Sites that returned nothing have a `status` of `no_sitemap`, `blocked_by_robots_txt`, `unreachable` or `invalid_input`, with a plain sentence in `problems`, and the same sentence is written to the run log. If no site in the run has a readable sitemap, the run ends as failed with that reason, so a scheduled run or webhook can tell it apart from a run that found URLs.

### What it reads

| Format | Notes |
|---|---|
| XML sitemap (`urlset`) | With `lastmod`, `changefreq`, `priority`, image and hreflang entries |
| Sitemap index | Child sitemaps are followed, up to your **Max sitemap files** setting |
| `.xml.gz` | Unzipped with a 60 MB safety limit |
| Text sitemap | One URL per line |
| RSS and Atom feeds | The sitemap standard allows them, so a feed link works as a sitemap |

Where it looks when you give a domain: the `Sitemap:` lines in robots.txt first, then `/sitemap.xml`, `/sitemap_index.xml`, `/sitemap-index.xml`, `/sitemap.xml.gz`, `/wp-sitemap.xml` and two common sub-folders.

### Real runs

| Website | URLs returned | Sitemap files read | Complete? |
|---|---|---|---|
| crawlee.dev | 4,844 | 2 | Yes |
| bbc.co.uk | 22,932 | 4 | Stopped at the max URLs cap |
| apify.com | 47,000 | 3 | Stopped at the max URLs cap |

One run on a laptop with three websites. It returned 74,776 URLs in about 6 minutes. A small site takes seconds.

### Use cases

- **SEO audits**: get the list of pages Google is told about, then compare it with what you can crawl or what ranks.
- **Crawler seeds**: feed the URLs to a scraper or to the Website SEO and Broken Link Audit Actor.
- **Change monitoring**: run it weekly with **Only URLs modified after** set to last week to see new and updated pages.
- **Competitor research**: filter by `/blog/` or `/products/` to see how much a competitor publishes.
- **Migrations**: export old URLs for a redirect map.

### Pricing

Pay per event: **$0.15 per 1,000 URLs** ($0.00015 per URL). Apify adds a small fee for each run start.

| Site size | Cost |
|---|---|
| 1,000 URLs | $0.15 |
| 10,000 URLs | $1.50 |
| 50,000 URLs | $7.50 |

URLs you filter out are not charged. Duplicates are removed before charging. Set **Max URLs in total** to cap what a run can cost.

**Compared with other options.** Sitemap Actors on the Apify Store charge about $0.30 to $0.50 per 1,000 URLs on a paid plan, and more on the free plan. This one is half of that, returns the same fields, and reads text sitemaps and feeds as well.

### How it treats other people's servers

- It follows robots.txt. Sitemaps listed in robots.txt are read. Guessed addresses and child sitemaps are read only if robots.txt allows them.
- At most 4 files are downloaded at the same time from one website, and 3 websites at once.
- It sends a plain User-Agent that names the tool.
- It does not open the pages themselves, only the sitemap files.
- Addresses that are not on the public internet (localhost, private networks) are refused.

### Limits

- It reads what the site publishes. Pages that are not in a sitemap are not found. Use a crawler for those.
- Sitemaps can be out of date. A URL in a sitemap may return 404.
- Some sites hide the sitemap behind a login or a bot check. Those return `unreachable` or `no_sitemap`, free of charge.
- Up to 5,000,000 URLs per run and 5,000 sitemap files per website.

### Works well with

- **[Website SEO and Broken Link Audit](https://apify.com/opstoolkit/site-seo-link-audit)**: this Actor lists the pages a site publishes and their lastmod dates. The audit checks status, title, canonical and broken links on each page.
- **[Structured Data Checker](https://apify.com/opstoolkit/structured-data-checker)**: filter a product or blog section here, then check its JSON-LD and Schema.org markup.
- **[Core Web Vitals Checker](https://apify.com/opstoolkit/core-web-vitals-checker)**: pick the page types you care about here, then test their LCP, INP and CLS.
- **[Website Screenshot and PDF](https://apify.com/opstoolkit/website-screenshot-pdf)**: turn the URL list into a set of dated screenshots.

### Integrations

Everything Apify supports works here: weekly schedules, webhooks, the REST API, and the official integrations with Zapier, Make, n8n and Google Sheets. The **API** tab on this page has ready code for JavaScript, Python and cURL.

### FAQ

**Why did I get 0 URLs for a website with many pages?**
The site has no sitemap, or hides it. Check the `SUMMARY` record: `problems` says what was tried. If you know the sitemap address, paste it instead of the domain.

**Can it find pages that are not in the sitemap?**
No. It reads sitemaps only. That is what keeps it cheap and polite.

**Does `lastmod` mean the page really changed?**
It means the site says so. Some sites set it to today on every page. Treat it as a hint.

**Something broke.**
Open an issue on the Issues tab with the run link. I reply within a day.

# Changelog

This Actor's version history is a separate document: https://apify.com/opstoolkit/sitemap-url-extractor/changelog.md

# Actor input Schema

## `sites` (type: `array`):

Websites to read, one per line. A domain (example.com), a full address (https://example.com) or a direct sitemap link such as https://example.com/sitemap.xml. For a domain, the Actor finds the sitemaps through robots.txt and the usual addresses. A subdomain such as blog.example.com counts as its own website.

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

Most URLs to return across all websites, 1 to 5,000,000, default 1000. You pay per URL returned, so this caps the cost of a run. Start low, for example 1000, to see the output.

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

Optional. Stops reading a website after this many URLs, 1 to 5,000,000, so one huge site does not use the whole budget. Example: 3000. Leave empty for no per-site limit (the total above still applies).

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

Optional regular expression. Keeps only URLs that contain a match anywhere in the address. Examples: /blog/ or .html$. Up to 500 characters. Leave empty to keep every URL.

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

Optional regular expression. Drops URLs that contain a match anywhere in the address. Example: /tag/|/page/\d+. Up to 500 characters. Leave empty to drop nothing.

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

Optional date, for example 2026-01-31. Keeps URLs whose sitemap lastmod is on or after that date. URLs with no lastmod are dropped when this is set. Leave empty to keep all dates.

## `onlySameSite` (type: `boolean`):

true (default) drops URLs on other domains and child sitemaps hosted on other domains. Subdomains of the same site are kept. false keeps everything the sitemaps list.

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

true adds an images list (image URLs) to each row when the sitemap has image entries. Default false.

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

true adds an alternates list to each row with the language and region versions of the page (hreflang and href), when the sitemap lists them. Default false.

## `maxSitemapFiles` (type: `integer`):

Most sitemap files to read per website, 1 to 5000, default 200. Large sites split their sitemap into hundreds of files. This is a safety stop.

## `maxConcurrency` (type: `integer`):

How many sitemap files to download at the same time from one website, 1 to 10, default 4. 4 is gentle on the site.

## Actor input object example

```json
{
  "sites": [
    "https://crawlee.dev"
  ],
  "maxUrls": 1000,
  "onlySameSite": true,
  "includeImages": false,
  "includeAlternates": false,
  "maxSitemapFiles": 200,
  "maxConcurrency": 4
}
```

# Actor output Schema

## `urls` (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 = {
    "sites": [
        "https://crawlee.dev"
    ]
};

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

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

```

## MCP server setup

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