# Sitemap URL Extractor: All Page URLs, Lastmod & New Pages (`data_factory_nerd/sitemap-url-extractor`) Actor

Get every page URL from any website's XML sitemaps. Finds sitemaps automatically (robots.txt, sitemap index, .gz, WordPress, Shopify), returns lastmod, changefreq, priority, hreflang, images and news data. Filter by pattern or date, or monitor only new pages. $0.50 per 1,000 URLs.

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

## Pricing

from $0.45 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### What is Sitemap URL Extractor?

**Sitemap URL Extractor** gets **every page URL a website publishes in its XML sitemaps**, in one clean row per URL with **lastmod, changefreq, priority, hreflang alternates, image URLs and Google News / video data**.

Give it a domain and it **finds the sitemaps for you**: it reads `robots.txt`, then tries the usual locations (`/sitemap.xml`, `/sitemap_index.xml`, WordPress `/wp-sitemap.xml`, `/sitemap.txt`). It follows **sitemap indexes** of any depth and reads **gzipped (.xml.gz)** and **plain-text** sitemaps. It works with WordPress, Shopify, Yoast, Rank Math, Next.js, Webflow and custom sitemaps. **No browser, no proxies, no API key**, so runs are fast and cheap.

Turn on **monitor mode** and schedule it: each run returns **only pages that are new since the last run**. That gives you a simple **new-page alert for any competitor, blog or store**.

### What data can you get?

| Field | Example |
|---|---|
| `url` | https://www.shopify.com/blog/email-marketing |
| `lastmod` | 2026-11-13T00:00:00+00:00 |
| `changefreq` / `priority` | weekly / 0.8 |
| `alternates` | `[{"hreflang": "es-US", "url": "https://stripe.com/es-us/legal"}, …]` |
| `imageCount` / `images` | 1 / `["https://static01.nyt.com/…jpg"]` |
| `newsTitle` / `newsPublishedAt` | NWSL semifinals guide… / 2026-11-14T06:00:00-05:00 |
| `videoTitle` | (video sitemaps) |
| `domain` / `path` | www.shopify.com / /blog/email-marketing |
| `sitemapUrl` / `sitemapType` | https://www.shopify.com/sitemap.xml / xml, xml-gz or txt |

A `SUMMARY` record in the key-value store lists, per website, how the sitemap was found, how many sitemap files were read, URLs found vs returned and any errors (for example "no sitemap found").

### Use cases

- 🔎 **SEO audits**: get the full list of indexable URLs, find stale pages via `lastmod`, check hreflang coverage
- 🕵️ **Competitor content monitoring**: schedule monitor mode and get every new blog post, product or landing page a competitor publishes
- 🛒 **E-commerce catalogs**: list every product URL of a Shopify or WooCommerce store (`/products/` filter), then feed them to a product scraper
- 🧭 **Crawl seeding**: give your crawler or RAG / LLM pipeline the exact URL list instead of crawling links blindly
- 📰 **News tracking**: read Google News sitemaps (`news.xml`) for fresh headlines with publication dates
- 🔁 **Site migrations**: export old and new URL lists to build redirect maps

### How to extract all URLs from a sitemap

1. Paste websites (`stripe.com`) or direct sitemap URLs (`https://example.com/sitemap.xml`) into **Websites or sitemap URLs**.
2. Optional: keep only some URLs with **Only URLs containing** (`/blog/`, `/products/`, or `re:` for a regex), or only recently changed pages with **Modified on or after** (`2026-11-01` or `7 days`).
3. Optional: switch on **Only new URLs since last run** and add a schedule for alerts.
4. Click **Start** and download the URLs as JSON, CSV or Excel from the **Output** tab.

#### Input example

```json
{
  "startUrls": ["shopify.com", "https://www.nytimes.com/sitemaps/new/news.xml.gz"],
  "includePatterns": ["/blog/"],
  "lastmodAfter": "30 days",
  "maxItems": 500
}
```

#### Output example

```json
{
  "url": "https://www.shopify.com/blog/email-marketing",
  "lastmod": "2026-11-13T00:00:00+00:00",
  "changefreq": null,
  "priority": null,
  "imageCount": 0,
  "domain": "www.shopify.com",
  "path": "/blog/email-marketing",
  "sitemapUrl": "https://www.shopify.com/sitemap.xml",
  "sitemapType": "xml",
  "input": "shopify.com",
  "extractedAt": "2026-11-14T11:04:43+00:00"
}
```

### Monitor mode: only new pages since the last run

Switch on **Only new URLs since last run**. The first run returns all matching URLs and remembers them in a key-value store in *your* account (`data-factory-sitemap-monitor`). Every later run with the same input returns only URLs that weren't there before. Add a daily schedule (Actor → Schedules) plus an integration (Slack, email, webhook, Google Sheets) and you have a new-page alert. Use **Monitor name** to keep several separate histories.

### How much does it cost?

**Pay per result: $0.50 per 1,000 URLs** ($0.0005 per URL). Sitemap files that are read but filtered out cost nothing.

- 1,000 URLs = $0.50
- 100,000 URLs = $50
- With monitor mode you pay only for the new URLs each run.
- Apify's free plan includes $5 of monthly usage, enough for about 10,000 URLs.

Use **Max URLs** or **Max URLs per website** to cap the cost of a run.

### API example

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("data_factory_nerd/sitemap-url-extractor").call(run_input={"startUrls": ["stripe.com"], "maxItems": 1000})
for row in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(row["url"], row["lastmod"])
```

### FAQ

#### How does it find a website's sitemap?

First from the `Sitemap:` lines in `robots.txt`, then from common locations: `/sitemap.xml`, `/sitemap_index.xml`, `/sitemap-index.xml`, `/wp-sitemap.xml`, `/sitemap.xml.gz` and `/sitemap.txt`. If a sitemap URL you enter returns 404, it searches the site for the real one.

#### A site has no sitemap. What happens?

The site is listed in `SUMMARY` with status `no_sitemap`, and you are not charged. For sites without sitemaps you need a link crawler instead.

#### Does it crawl the pages themselves?

No. It reads only the sitemap files, which keeps it fast and cheap. Use the URL list as input for any page scraper.

#### Can it handle huge sites?

Yes. Sitemap indexes with hundreds of files are followed (up to **Max sitemap files per website**, default 500). Use **Only sitemaps containing** (for example `post-sitemap` or `products`) to read only the parts you need.

#### Is it legal?

Sitemaps are files that websites publish specifically so that machines can read their URL lists. The Actor sends a clearly identified user agent and paces its requests.

#### Found a bug or need a field?

Open an issue on the **Issues** tab. We reply quickly.

### Related Actors by data_factory_nerd

| Actor | What it does |
|---|---|
| [Bulk WHOIS & DNS Lookup](https://apify.com/data_factory_nerd/domain-whois-dns-lookup) | Domain age, expiry, registrar, MX, SPF and DMARC for thousands of domains |
| [Wayback Machine Scraper](https://apify.com/data_factory_nerd/wayback-machine-scraper) | Archived snapshots and page history of any URL or domain |
| [Workday Jobs Scraper](https://apify.com/data_factory_nerd/workday-jobs-scraper) | Every job from any myworkdayjobs.com careers site |

# Actor input Schema

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

One per line. A domain (example.com) or homepage: sitemaps are found automatically via robots.txt and common locations. Or a direct sitemap URL (https://example.com/sitemap.xml, .xml.gz or .txt).

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

Keep only page URLs that contain any of these texts (case-insensitive), e.g. /blog/ or /products/. Prefix with re: for a regular expression, e.g. re:/20(25|26)/.

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

Drop page URLs that contain any of these texts (case-insensitive). Prefix with re: for a regular expression.

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

Keep only URLs whose sitemap lastmod is on or after this date (YYYY-MM-DD) or relative (e.g. 7 days). URLs without a lastmod are dropped when this is set.

## `sitemapFilter` (type: `array`):

Follow only child sitemaps whose URL contains one of these texts, e.g. post-sitemap or products. Saves time on huge sites.

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

Add the image URLs listed for each page (image sitemaps).

## `onlyNew` (type: `boolean`):

Return only page URLs not seen in your previous runs with the same input. The first run returns everything and remembers it. Perfect for scheduled new-page / competitor-content alerts.

## `monitorKey` (type: `string`):

Name for the seen-URLs history. Leave empty to derive it from the input.

## `maxItems` (type: `integer`):

Stop after this many page URLs in total (controls cost). 0 = no limit.

## `maxItemsPerSite` (type: `integer`):

0 = no limit.

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

Safety cap on how many sitemap files are downloaded per website.

## Actor input object example

```json
{
  "startUrls": [
    "apify.com",
    "https://www.python.org/sitemap.xml"
  ],
  "includeImages": false,
  "onlyNew": false,
  "maxItems": 200,
  "maxItemsPerSite": 0,
  "maxSitemaps": 500
}
```

# 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 = {
    "startUrls": [
        "apify.com",
        "https://www.python.org/sitemap.xml"
    ],
    "maxItems": 200
};

// Run the Actor and wait for it to finish
const run = await client.actor("data_factory_nerd/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",
        "https://www.python.org/sitemap.xml",
    ],
    "maxItems": 200,
}

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

```

## MCP server setup

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