# Sitemap URL Extractor (`snappytools/sitemap-url-extractor`) Actor

Sitemap URL Extractor returns every page URL listed in a website's sitemaps, with the lastmod date for each one, for a site or sitemap link you give it. You type in a homepage like https://nodejs.org or a direct sitemap link like https://apify.com/sitemap.xml. You get one row per site you type in.

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

## Pricing

$1.00 / 1,000 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 – sitemap extractor and page URL list export

Sitemap URL Extractor returns every page URL listed in a website's sitemaps, with the `lastmod` date for each one, from a site or sitemap link you give it. You type in a homepage like `https://nodejs.org` or a direct sitemap link like `https://apify.com/sitemap.xml`.

You get one row per site you type in. Each row has the `urls` list (each item with `url` and `lastmod`), `urlCount`, `sitemapsFetched`, a `status`, and a plain `reason` when a limit or a problem stopped the read.

Schedule it to run daily or weekly and compare `lastmod` values between runs to spot new or changed pages.

### Why this one

- **Finds sitemaps for you.** Give it a homepage and it discovers the sitemaps from robots.txt.
- **Follows nested indexes.** Sitemap index files are opened and the child sitemaps are read, up to the limit you set.
- **One row per input.** Every site gets a record with a `status` of `ok`, `not_found`, `invalid` or `error`, so one bad link doesn't spoil the run.
- **Clear limits.** When a limit stops a site early, the row is marked `truncated` and the `reason` says so.
- **Fair price.** $1.00 per 1,000 results, and runs with no results cost nothing.

### Quick start

```json
{
  "sites": ["https://apify.com", "https://nodejs.org", "https://www.gov.uk"],
  "maxUrlsPerSite": 5,
  "maxSitemapsPerSite": 5
}
```

This returns one row per site, each holding up to 5 page URLs with their `lastmod` dates.

### What you can use it for

| Who | What for |
|---|---|
| SEO consultants | Pull a client's full URL list to check indexing and find stale pages by `lastmod` |
| Developers | Check a sitemap migration kept every URL after a site rebuild |
| Content teams | See which pages changed recently and plan updates |
| Market researchers | Count and group a competitor's product or blog pages |
| AI agent builders | Get a list of pages to crawl before fetching content |

### How to use it

1. Click **Try for free**.
2. In **Sites or sitemap URLs**, add one site per line, such as `https://nodejs.org` or `https://apify.com/sitemap.xml`. You can add up to 100.
3. Set **Max URLs per site**, for example `1000`.
4. Set **Max sitemap files per site**, for example `50`, to cap how many XML files are read on big sites.
5. Click **Start**.

Tip: add the run to **Schedules** and compare the `urls` list between runs to catch new pages.

### What data you get

Each row describes one input site and the URLs found in its sitemaps.

| Field | What it is | Example |
|---|---|---|
| `id` | The site's host name | `nodejs.org` |
| `input` | The value you passed, echoed back | `https://nodejs.org` |
| `status` | `ok`, `not_found`, `invalid` or `error` | `ok` |
| `reason` | Plain explanation of why the run stopped or failed | `Stopped at the configured limit` |
| `siteUrl` | The site's origin | `https://nodejs.org` |
| `sitemapsFound` | Sitemap links discovered | `["https://nodejs.org/sitemap.xml", "https://nodejs.org/learn/sitemap.xml"]` |
| `sitemapsFetched` | Number of sitemap files read | `1` |
| `urlCount` | Number of page URLs returned | `5` |
| `truncated` | True when a limit stopped the read early | `true` |
| `urls` | List of `{ url, lastmod }` items | `{ "url": "https://nodejs.org/en/blog", "lastmod": "2026-11-12T14:01:22.349Z" }` |
| `checkedAt` | When the site was checked, ISO 8601 | `2026-11-15T10:51:30.649Z` |
| `source` | Where the sitemaps were found, with a link | `{ "name": "robots.txt", "url": "https://nodejs.org/robots.txt" }` |

In a test run on 15 Nov 2026 with three sites and a limit of 5 URLs each, the run returned 3 rows.

### Pricing

| Event | Price |
|---|---|
| Result (one row per site) | $0.001 |

| Run | Cost |
|---|---|
| 100 results | $0.10 |
| 1,000 results | $1.00 |
| 10,000 results | $10.00 |

There is no start fee, and runs with no results cost nothing.

### Good to know

- **Limits:** up to 100 sites per run, up to 50,000 URLs and 500 sitemap files per site.
- **Where the data comes from:** the site's own public robots.txt and sitemap XML files.
- **What is not included:** pages not listed in a sitemap, and page content. `lastmod` is `null` when the site doesn't provide it, as with apify.com in the test run.
- **Freshness:** data is fetched live at run time, so it is only as current as each site's sitemap.
- **Not affiliated:** this tool isn't affiliated with or endorsed by the owners of any website whose sitemaps you read.

### FAQ

**Can I pass a sitemap link directly?**
Yes. Add a link like `https://apify.com/sitemap.xml` and it is read directly.

**What happens if a site has no sitemap?**
You get a row with `status` set to `not_found` and a `reason`, and the run carries on.

**How do I get more than 1,000 URLs per site?**
Raise **Max URLs per site**, up to 50,000. Raise **Max sitemap files per site** too if the site has many sitemap files.

**How do I export sitemap URLs to Excel or CSV?**
Run the tool, then download the results as Excel or CSV from the Output tab.

### Getting the data out

Download results as Excel, CSV or JSON from the Output tab. Send them to Google Sheets, Slack, Zapier, Make or webhooks from the **Integrations** tab. Every run is available through the Apify API, and you can run it on a timetable from **Schedules**.

### Questions or problems

Open an issue on the **Issues** tab and include the run link. I reply within one business day.

### Related tools

- [Bulk Email Syntax and MX Validator](https://apify.com/snappytools/email-syntax-mx-validator): check email addresses in bulk
- [TED Europa Tender Scraper](https://apify.com/snappytools/ted-europa-tender-scraper): export public tenders from TED Europa
- [Companies House Company Scraper](https://apify.com/snappytools/companies-house-uk-scraper): export UK company records

# Actor input Schema

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

List of public websites or sitemap URLs, one per line. Pass a homepage like https://nodejs.org to discover sitemaps from robots.txt, or a direct sitemap like https://apify.com/sitemap.xml. Up to 100 per run.

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

Most page URLs returned for each site, for example 1000. Extra URLs are skipped and the record is marked truncated.

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

Most sitemap XML files fetched per site, including nested sitemap indexes, for example 50.

## Actor input object example

```json
{
  "sites": [
    "https://apify.com",
    "https://nodejs.org",
    "https://www.gov.uk"
  ],
  "maxUrlsPerSite": 1000,
  "maxSitemapsPerSite": 50
}
```

# Actor output Schema

## `results` (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://apify.com",
        "https://nodejs.org",
        "https://www.gov.uk"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("snappytools/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://apify.com",
        "https://nodejs.org",
        "https://www.gov.uk",
    ] }

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

```

## MCP server setup

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