# Sitemap URL Extractor (All Website URLs + Change Monitor) (`zingy_trunk/sitemap-url-extractor`) Actor

Get every URL of a website from its XML sitemaps for SEO and content audits: auto-finds sitemaps, follows indexes, reads .xml.gz and text sitemaps, returns lastmod, priority, images and hreflang. Monitor mode returns only new or updated pages. $0.40 per 1,000 URLs.

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

## Pricing

from $0.24 / 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.
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

## Sitemap URL Extractor (All Website URLs + Change Monitor)

**$0.40 per 1,000 URLs. No start fee; sites without a sitemap, filtered-out URLs and unchanged URLs are free.** This sitemap URL extractor gets every page URL of a website from its XML sitemaps in seconds, without crawling the site. Paste a homepage and it finds the sitemaps for you (robots.txt `Sitemap:` lines, then the usual locations), follows sitemap indexes to the bottom, reads `.xml.gz`, plain-text and RSS/Atom sitemaps, and returns one clean row per URL with `lastmod`, `changefreq`, `priority`, image count and optional hreflang language versions.

Switch on **monitor mode** and schedule it to get **only new or updated pages** on every run: a lightweight way to watch competitors' new product pages, blog posts, landing pages or job listings.

Typical uses: **SEO audits** (find every indexable URL, spot stale `lastmod` dates, check hreflang coverage), **content audits and inventories** (export all blog or product URLs to a spreadsheet), site migrations (list old URLs for redirect mapping), and feeding a URL list to other scrapers.

### Why this one

- **Finds the sitemap for you.** Give it `https://docs.apify.com` and it reads robots.txt, opens the sitemap index, and walks every child sitemap. WordPress (`/wp-sitemap.xml`), Yoast (`/sitemap_index.xml`) and text sitemaps are covered by the fallbacks.
- **A change feed, not just a dump.** Monitor mode remembers each URL and its `lastmod`, and marks each row `change: "new"` or `"updated"`. Unchanged URLs are skipped and never charged.
- **Pay only for the URLs you keep.** Include and exclude patterns (`/blog/`, `*/products/*`, `re:/20(25|26)/`) and a "modified after" date are applied before charging. Duplicates across sitemap files are merged.
- **Seconds, not hours.** No page is crawled; only sitemap files are downloaded. A 50,000-URL site typically finishes in under a minute on the default 512 MB.
- **Polite and safe by default.** Honours `robots.txt`, keeps a minimum delay per host, retries on errors and rate limits with back-off, refuses private or internal addresses, and caps each file at the protocol's size limit.
- **Clear failures.** A site without a sitemap, or a child sitemap returning 404, becomes a free row with a plain-English `error`, so you know exactly what was missed.

### You give it / you get back

| You give it | You get back (one row per page URL) |
|---|---|
| A website: `https://acme.com` | `url`, `lastmod` (ISO 8601), `changefreq`, `priority` |
| A sitemap or sitemap index: `https://acme.com/sitemap.xml`, `.xml.gz`, `.txt` | `images`: number of images listed for the page |
| Optional include / exclude patterns and a date | `alternates`: hreflang language versions (on request) |
| Monitor mode on a schedule | `change`: `new` or `updated` since the last run |
| | `news`: title and date from Google News sitemaps, when present |
| | `sitemapUrl`: the file the URL came from |

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | list of URLs | required | Websites or sitemap URLs (up to 1,000). |
| `maxUrlsPerSite` | integer | 10,000 | Cap per start URL (up to 1,000,000). |
| `includePatterns` | list | empty | Keep URLs matching any pattern: text, `*` wildcard, or `re:` regex. |
| `excludePatterns` | list | empty | Drop URLs matching any pattern. |
| `lastmodAfter` | string | empty | `2026-11-01` or relative, e.g. `7 days`. URLs without lastmod are kept. |
| `onlyNew` | boolean | false | Monitor mode: only new or updated URLs since the last run. |
| `includeAlternates` | boolean | false | Add hreflang alternates. |
| `sameHostOnly` | boolean | true | Skip URLs on other domains (subdomains are kept). |
| `maxSitemapsPerSite` | integer | 200 | Stop after this many sitemap files per site. |
| `maxConcurrency` | integer | 5 | Sites processed in parallel. |
| `requestIntervalMs` | integer | 500 | Minimum delay between requests to the same host. |

```json
{
    "startUrls": ["https://docs.apify.com", "https://crawlee.dev/sitemap.xml"],
    "includePatterns": ["/blog/"],
    "maxUrlsPerSite": 5000,
    "onlyNew": true
}
```

### Output

Real rows from a test run (the full set is in `sample-output.json` in the source):

```json
{
    "site": "https://www.gov.uk/",
    "url": "https://www.gov.uk/hmrc-internal-manuals/vat-repayment-supplement-manual",
    "lastmod": "2026-09-30T09:36:46.000Z",
    "changefreq": null,
    "priority": 0.5,
    "images": 0,
    "alternates": [],
    "sitemapUrl": "https://www.gov.uk/sitemaps/sitemap_1.xml",
    "extractedAt": "2026-11-15T16:22:01.226Z"
}
```

```json
{
    "site": "https://docs.apify.com/",
    "url": "https://docs.apify.com/academy",
    "lastmod": null,
    "changefreq": "weekly",
    "priority": 0.5,
    "images": 0,
    "alternates": [],
    "sitemapUrl": "https://docs.apify.com/sitemap_base.xml",
    "extractedAt": "2026-11-15T16:21:50.793Z"
}
```

A site that cannot be read produces one free row instead:

```json
{ "site": "https://no-such-host-for-testing-8841.example/", "error": "Host no-such-host-for-testing-8841.example could not be resolved (ENOTFOUND).", "sitemapsRead": 0, "extractedAt": "2026-11-15T16:20:00.000Z" }
```

### Pricing

Pay per event:

- **$0.0004 per URL saved** ($0.40 per 1,000), with lower prices on higher Apify plans (down to $0.16 per 1,000).
- **No custom start fee**; only Apify's standard tiny platform start event applies.
- Free: error rows, URLs removed by your filters or date, duplicates, and unchanged URLs in monitor mode.

Examples: a full export of a 20,000-page store costs $8 once. Monitoring 30 competitor sites daily, with about 100 new or changed pages a day between them, costs about $0.04 a day.

### How to monitor a competitor's new pages

1. Add the competitor's homepage to `startUrls` and set `onlyNew: true`. Narrow it with `includePatterns`, for example `/products/` or `/blog/`.
2. Run once. The first run returns every matching URL marked `new` and remembers them.
3. Create an Apify **Schedule** (daily or weekly) for this input.
4. Connect the run to Slack, email, Google Sheets, Make, Zapier, n8n or a webhook. Each later run delivers only pages that are new or whose `lastmod` changed.

Monitor state lives in the key-value store `sitemap-url-extractor-state` in your account (up to 150,000 remembered URLs per start URL). Delete it to start fresh.

### Use with

| Actor | How they fit |
|---|---|
| [Website Email Scraper & Contact Finder](https://apify.com/zingy_trunk/website-contact-company-enrichment) | Found a list of company sites? Get their role e-mails, phones and socials in one row per domain. |
| [Website Tech Stack Detector](https://apify.com/zingy_trunk/website-tech-stack) | Feed it interesting URLs from a sitemap to see which CMS, analytics and hosting each page uses. |
| [RSS Feed Reader & Monitor](https://apify.com/zingy_trunk/rss-feed-monitor) | Pair a site's sitemap change feed with its blog feed for complete "what's new" monitoring. |
| [Is This Company Hiring? Job Openings by Domain](https://apify.com/zingy_trunk/hiring-signals-jobs-by-domain) | A competitor adding careers pages? Check its open roles by department. |
| [WHOIS Lookup (RDAP), Bulk Domain Age & Registrar](https://apify.com/zingy_trunk/rdap-domain-lookup) | Registrar, creation and expiry dates for the domains you are watching. |
| [Email List Cleaner](https://apify.com/zingy_trunk/email-list-validator) | Clean the contact addresses you collect before outreach. |

### FAQ

**How do I get all URLs of a website?**
Paste the homepage into `startUrls` and run. If the site publishes a sitemap (almost every CMS does), you get every URL it lists. Pages the owner left out of the sitemap are not included; for those you need a crawler.

**Where is a website's sitemap?**
Usually listed in `https://site.com/robots.txt` on a `Sitemap:` line, or at `/sitemap.xml`. This Actor checks robots.txt first, then `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml` and `/sitemap.txt`. If yours lives elsewhere, paste its URL directly.

**Does it read compressed `.xml.gz` sitemaps and sitemap indexes?**
Yes. Gzip is detected from the file content, and indexes are followed recursively until `maxSitemapsPerSite` files have been read.

**What does `lastmod` mean, and can I trust it?**
It is the "last modified" date the site owner puts in the sitemap. Many sites keep it accurate; some set it to the build date for every page. Monitor mode uses it to flag updates, so a site that rewrites every `lastmod` on each deploy will show many `updated` rows.

**Can I export only blog posts or product pages?**
Yes: `includePatterns: ["/blog/"]` or `["*/products/*"]`. For complex rules use a regex with the `re:` prefix, e.g. `re:/20(25|26)/`.

**Is this a site audit tool?**
No. It lists URLs and their sitemap metadata. It does not fetch pages, check status codes or grade SEO.

**Can an AI agent use it?**
Yes, through the Apify API or Apify's MCP server. Input is a list of URLs and the output is a flat list of page URLs, ideal as the first step before reading or summarising pages.

**Is it allowed to read sitemaps?**
Sitemaps are published by site owners specifically so automated clients can discover their pages. The Actor also honours each host's robots.txt and a polite per-host delay.

### Data source, terms and limits

- Reads only the sitemap files and robots.txt of the sites you provide. Page content is never downloaded.
- Page URLs and metadata belong to each site owner; check a site's terms before reusing its content.
- Sites behind a login, or that block automated clients (HTTP 403), cannot be read; they appear as free error rows.
- Maximum 1,000 start URLs, 1,000,000 URLs per site and 5,000 sitemap files per site per run.

**Sitemap not parsing?** Open an issue with the sitemap URL; fixes usually ship within days.

# Actor input Schema

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

A website ("https://crawlee.dev") or a sitemap URL ("https://crawlee.dev/sitemap.xml"). For a website, the sitemaps listed in robots.txt are used, then /sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml and /sitemap.txt. Up to 1,000 per run.

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

Caps the URLs saved (and charged) for each start URL.

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

Keep only URLs that match at least one pattern. Plain text matches anywhere ("/blog/"), "*" is a wildcard ("*/products/\*"), and "re:" starts a regular expression ("re:/20(25|26)/"). Filtered-out URLs are free.

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

Drop URLs that match any pattern (same syntax as above), e.g. "/tag/" or "?page=".

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

Only URLs whose sitemap lastmod is after this date. Accepts 2026-11-01 or a relative time like "7 days". URLs without a lastmod are kept.

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

Return only URLs that did not appear in a previous run for the same start URL, or whose lastmod changed. Each row gets change = "new" or "updated". Schedule it daily to watch competitors' new pages. State is kept in your key-value store "sitemap-url-extractor-state".

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

Adds the language versions listed in the sitemap (xhtml:link hreflang) to each row.

## `sameHostOnly` (type: `boolean`):

Skip URLs on other domains that some sitemaps list. Subdomains of the start URL are kept.

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

Large sites split their sitemap into many files. Stops after this many files per start URL.

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

How many start URLs are processed at the same time. Files of one site are always read one after another.

## `requestIntervalMs` (type: `integer`):

Minimum time between two requests to the same host.

## Actor input object example

```json
{
  "startUrls": [
    "https://docs.apify.com",
    "https://crawlee.dev/sitemap.xml"
  ],
  "maxUrlsPerSite": 20,
  "onlyNew": false,
  "includeAlternates": false,
  "sameHostOnly": true,
  "maxSitemapsPerSite": 200,
  "maxConcurrency": 5,
  "requestIntervalMs": 500
}
```

# Actor output Schema

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

One row per page URL found in the sitemaps (lastmod, changefreq, priority, image count, optional hreflang alternates). Sitemaps that could not be read appear as free rows with an error field.

# 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": [
        "https://docs.apify.com",
        "https://crawlee.dev/sitemap.xml"
    ],
    "maxUrlsPerSite": 20
};

// Run the Actor and wait for it to finish
const run = await client.actor("zingy_trunk/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": [
        "https://docs.apify.com",
        "https://crawlee.dev/sitemap.xml",
    ],
    "maxUrlsPerSite": 20,
}

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

```

## MCP server setup

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