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

List every URL in a website's sitemaps with lastmod, changefreq, priority and hreflang alternates. Finds sitemaps via robots.txt, follows sitemap indexes and .xml.gz files, reads broken XML. Filter by regex or lastmod date. Never downloads the pages themselves.

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

## Pricing

from $0.20 / 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

**Sitemap URL Extractor** lists **every page URL in a website's sitemaps** — with `lastmod`, `changefreq`, `priority`, the sitemap file it came from and (optionally) its **hreflang language alternates**.

Give it a domain and it finds the sitemaps for you: the `Sitemap:` lines in robots.txt first, then `/sitemap.xml` and `/sitemap_index.xml`. Sitemap indexes are followed to any depth you allow, `.xml.gz` files are unpacked, and XML that is broken half-way is still read. Only the sitemap files are downloaded — never the pages themselves — so it is fast and light on the site.

### How to use

1. Click **Start** — the input is prefilled with `https://webscraper.io`, so you see real rows in a few seconds (about 450 URLs, ≈ $0.23 on the Free plan; lower **Max results** first if you only want a peek).
2. Replace it with your own websites (`https://example.com`) or sitemap URLs (`https://example.com/sitemap.xml`). Add as many as you like; different sites are read in turns.
3. Optional: keep only some URLs with **Only URLs matching** (e.g. `/blog/`), drop some with **Skip URLs matching**, or keep only recently changed pages with **Changed since** (e.g. `7 days`).
4. Set **Max results** to cap what you pay, then click **Start**.
5. Open the **Output** tab for the URL table (export as JSON, CSV or Excel) and the **Run report** for every sitemap file read and anything skipped, with the reason.

**Polite by design:** obeys robots.txt (RFC 9309 matching, including `*` and `$` wildcards), waits at least 1 second between requests to the same site (longer if robots.txt sets a Crawl-delay), never logs in, no proxy rotation, no CAPTCHA solving. If a site says no, we stop.

### What you get

One row per page URL. These rows are from real runs on 2026-11-15 (webscraper.io's blog sitemap, which publishes `lastmod`, and crawlee.dev, which publishes `changefreq` and `priority`):

```json
[
{"url": "https://webscraper.io/blog/web-scraper-features-and-capabilities", "lastmod": "2026-11-13T11:35:36+00:00", "changefreq": null, "priority": null, "sitemapUrl": "https://webscraper.io/blog_sitemap.xml", "depth": 1, "foundVia": "robots.txt", "sitemapDomain": "webscraper.io"},
{"url": "https://crawlee.dev/blog/archive", "lastmod": null, "changefreq": "weekly", "priority": 0.5, "sitemapUrl": "https://crawlee.dev/sitemap.xml", "depth": 0, "foundVia": "robots.txt", "sitemapDomain": "crawlee.dev"}
]
```

With **Include hreflang alternates** on, each row also has `alternates` (from a real run on stripe.com's sitemap, shortened):

```json
{"url": "https://stripe.com/legal", "sitemapUrl": "https://stripe.com/sitemap/partition-0.xml", "depth": 1, "alternates": [{"hreflang": "es-US", "href": "https://stripe.com/es-us/legal"}, {"hreflang": "de-AT", "href": "https://stripe.com/at/legal"}, "..."]}
```

| Field | Meaning |
|---|---|
| `url` | The page URL, as listed in the sitemap. |
| `lastmod` | Last modification date as the site publishes it (W3C date/time, e.g. `2026-11-13` or `2026-11-13T11:35:36+00:00`); `null` if the sitemap has none. |
| `changefreq` / `priority` | As published (`priority` 0.0–1.0, `null` if missing or invalid). |
| `sitemapUrl` | The sitemap file that listed this URL. |
| `depth` | 0 = a sitemap you gave or that robots.txt lists; 1 = listed by a sitemap index; 2 = an index inside an index, … |
| `foundVia` | `input`, `robots.txt` or `default-path` (/sitemap.xml or /sitemap_index.xml). |
| `sitemapDomain` | Host of the sitemap file. |
| `alternates` | Only with hreflang on: `[{hreflang, href}]` from `xhtml:link rel="alternate"`. |

Export as JSON, CSV, Excel or via the Apify API, or connect to Google Sheets, Zapier and Make.

### Use cases

- **SEO audits** — the full list of URLs a site asks search engines to index, with `lastmod` to spot stale sections and hreflang to check language versions.
- **Change monitoring** — schedule a daily run with **Changed since** `1 day` to get only new or updated pages (new blog posts, new products, new job pages).
- **Seed lists for other scrapers** — feed the URLs (filtered with a regex, e.g. `/products/`) into the crawler of your choice.
- **Content inventories and migrations** — count pages per section before a redesign or a domain move.

### Input

| Field | What it does |
|---|---|
| `startUrls` | Websites (`https://example.com`) and/or sitemap URLs (`.xml`, `.xml.gz`, `.txt`, RSS / Atom feeds, or any URL with "sitemap" in it). For a website, the sitemaps come from robots.txt; if it lists none, `/sitemap.xml` then `/sitemap_index.xml` are tried. |
| `includePatterns` | Regular expressions; keep only URLs matching at least one. |
| `excludePatterns` | Regular expressions; drop URLs matching any. |
| `lastmodSince` | Keep URLs with `lastmod` on/after a date (`2026-11-01`, UTC) or within a period (`7 days`, `12 hours`, `2 weeks`). A date-only `lastmod` counts as the whole day, so a daily run with `1 day` doesn't miss yesterday evening's changes. |
| `keepUrlsWithoutLastmod` | With `lastmodSince`: also keep URLs that have no `lastmod` (default off). |
| `includeHreflang` | Add the `alternates` column (default off). |
| `deduplicateUrls` | Each URL once per run, even if several sitemaps list it (default on; turned off, every listing is a paid row). |
| `maxItems` | Stop after this many rows (default 1,000, max 1,000,000). |
| `maxSitemaps` | Stop after reading this many sitemap files (default 1,000). |
| `maxDepth` | How deep to follow indexes inside indexes (default 5). |
| `requestIntervalSecs` | Seconds between requests to the same site (default and minimum 1). |

Example:

```json
{
  "startUrls": [
    { "url": "https://webscraper.io" },
    { "url": "https://crawlee.dev/sitemap.xml" }
  ],
  "includePatterns": ["/blog/"],
  "lastmodSince": "30 days",
  "keepUrlsWithoutLastmod": true,
  "maxItems": 5000
}
```

### Pricing

**$0.50 per 1,000 URLs** on the Apify Free plan, **$0.30 per 1,000** on Bronze and **$0.20 per 1,000** on Silver and higher plans (pay per event: one charge per URL row, plus Apify's standard actor-start event of $0.00005 per run). Sitemap files, URLs removed by your filters or as duplicates, and skipped inputs are free. Example: a 20,000-page site costs $10.00 on Free, $4.00 on Silver. Set **Max results** or a **maximum cost per run** and the actor stops cleanly when it is reached (`stoppedAtMaxItems` / `stoppedAtMaxCharge` in the run report); rows are saved as each sitemap is read, so you keep everything you paid for.

### What gets skipped, and why

The **RUN_REPORT** record in the run's key-value store lists every sitemap file read (type, entries, kept, depth, parent index, repairs made) and every skipped URL with a reason. Skipped items are never charged.

| reason | meaning |
|---|---|
| `no_sitemap_found` | robots.txt lists no sitemap and neither `/sitemap.xml` nor `/sitemap_index.xml` is a sitemap. The detail says what each address returned. |
| `not_a_sitemap` | The URL returned an HTML page, an empty file, a broken gzip file, or XML that is not a sitemap / feed. |
| `robots_txt` | robots.txt disallows the sitemap for our bot — or robots.txt itself answered a server error or couldn't be reached, which [RFC 9309](https://www.rfc-editor.org/rfc/rfc9309#section-2.3.1.4) says means "treat the whole site as closed" (to be safe we treat 401 / 403 / 429 the same way, and a Crawl-delay over 60 seconds too, since waiting it out would stall the run). We don't work around it. |
| `http_error` | 404, 403, 5xx after retries, a broken response (e.g. fake gzip), or 429 "too many requests": we retry only when the site asks us to wait 30 seconds or less, and after two 429s in a row we skip the rest of that site (`rateLimitedHosts`). |
| `redirect_blocked` | The sitemap redirected to another site, or to a blocked / private / robots-disallowed address. Not followed — paste the final sitemap URL instead. |
| `terms_of_use` / `blocked_site` | Sites whose terms forbid robots (e.g. Amazon, eBay, Craigslist) and some of the largest retailers and marketplaces (e.g. Walmart, Etsy). No request is sent. |
| `private_page` / `invalid_url` | Login / account / cart addresses, `localhost`, private / internal IP addresses (also host names that resolve to one), non-http(s) or malformed URLs. |
| `max_depth` / `sitemap_limit` | The `maxDepth` or `maxSitemaps` limit was reached. |

### Limits — be aware

- The output is what the site publishes. Many sitemaps have no `lastmod`, `changefreq` or `priority` (those fields are then `null`), and some `lastmod` values are simply the time the sitemap was generated. A sitemap may not list every page on the site.
- Sitemaps that only appear after JavaScript runs, sitemaps behind a login, and sites that block bots with 403 / CAPTCHA are not read.
- A single file is read up to 60 MB uncompressed, whether it is a `.gz` file or sent compressed (the sitemap standard allows 50 MB); a bigger file is cut there and the run report says so.
- One request per second per site: a site with 1,000 sitemap files takes at least 17 minutes. Large single files are fast (a 14,885-URL gzip sitemap was read in one request).
- `maxItems` is for the whole run: with several sites, a site with a huge sitemap can use it up before the others. Run large sites separately if you need all of each.

### Responsible use

- You decide which sites to read. Sitemaps are published for crawlers, but only use the data in ways the site allows.
- The bot identifies itself: `DojitoSitemapBot/1.0 (+https://apify.com/dojito/sitemap-url-extractor; contact djkim@dojito.com)`. Site owners can block it in robots.txt and it will obey.
- Output is URLs and the dates / hints from the sitemap only — no page content and no personal-data fields (names, emails, phone numbers). A URL a site lists can itself contain a person's name (e.g. profile pages); if you process such URLs, data-protection law such as the GDPR may apply to you.
- Background: [sitemaps.org protocol](https://www.sitemaps.org/protocol.html), [RFC 9309 Robots Exclusion Protocol](https://www.rfc-editor.org/rfc/rfc9309), [Apify — Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/). General information, not legal advice.

### FAQ

**Does it download the pages?** No. Only robots.txt and sitemap files. If you need page content, feed the URLs to a crawler.

**Why do I get fewer rows than the sitemap has?** Check the run report: `filteredOut` counts URLs removed by your patterns, by `lastmodSince`, or as duplicates; `stoppedAtMaxItems` means the cap was reached.

**My site's sitemap is at an unusual address.** Paste the sitemap URL itself in Websites or sitemap URLs — any URL ending in `.xml`, `.xml.gz` or `.txt`, or containing "sitemap", is read as a sitemap.

**Does it follow sitemaps on another host (e.g. a CDN)?** Yes, if robots.txt or a sitemap index points there directly. A redirect to another host is not followed.

### More tools from this developer

Other public actors by [dojito](https://apify.com/dojito):

- [Product Price & Stock Checker for US Online Stores](https://apify.com/dojito/us-product-price-stock) — price, currency, in-stock status, SKU/GTIN and brand from public product pages that publish schema.org Product data (Shopify, WooCommerce, BigCommerce, Magento and others).
- [ATS Job Board Feed](https://apify.com/dojito/ats-job-boards-feed) — every open job from Greenhouse, Lever, Ashby, Recruitee, Personio and Teamtailor boards in one schema, from their documented public APIs and feeds.
- [Wayback Machine Snapshot History](https://apify.com/dojito/wayback-snapshot-history) — every Internet Archive capture of a URL, folder or whole domain from the official CDX API, or one summary row per URL.
- [Domain RDAP & DNS Lookup](https://apify.com/dojito/domain-rdap-dns-lookup) — registered or available, registrar, created and expiry dates, nameservers and DNSSEC from the registry's RDAP server, plus DNS records. One row per domain.

Using them together:

- **Checking a domain before you buy or link to it:** run Domain RDAP & DNS Lookup for registration status, expiry date and DNS, then Wayback Machine Snapshot History with Match = "Domain + subdomains" and Output = "Summary" to see when the site was first and last archived and how often its content changed.
- **Site migration or content audit:** list a site's URLs with Sitemap URL Extractor, then paste the pages you care about into Wayback Machine Snapshot History (Output = "Summary") to get each page's first and last capture.

***

Built on the Polite Web Scraper Kit (robots.txt, pacing, retries). Not affiliated with any website mentioned.

# Actor input Schema

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

Add a website (https://example.com — its sitemaps are found via robots.txt, then /sitemap.xml and /sitemap_index.xml) or a sitemap URL (…/sitemap.xml, …/sitemap.xml.gz, a text sitemap or an RSS/Atom feed). Sitemap indexes are followed.

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

Keep only page URLs that match at least one of these regular expressions, e.g. /blog/ or /products/. Leave empty to keep all.

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

Drop page URLs that match any of these regular expressions, e.g. /tag/ or ?page=. Filtered URLs are free.

## `lastmodSince` (type: `string`):

Keep only URLs whose sitemap lastmod is on or after this date: an absolute date like 2026-11-01 (UTC) or a period like 7 days, 12 hours, 2 weeks. Leave empty to keep all.

## `keepUrlsWithoutLastmod` (type: `boolean`):

With 'Changed since': also keep URLs whose sitemap gives no lastmod (off = drop them, because their age is unknown).

## `includeHreflang` (type: `boolean`):

Add an 'alternates' column with the language versions (hreflang + href) listed for each URL in the sitemap.

## `deduplicateUrls` (type: `boolean`):

Output each page URL once per run, even if several sitemaps list it. Removed duplicates are free (turn this off and every listing is a paid row).

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

Set the most URL rows you want (you pay per row). The run stops cleanly when it is reached.

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

Stop after reading this many sitemap files (indexes count too). Sitemap files are free; this only bounds run time.

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

How deep to follow sitemap indexes that point to other indexes (0 = read only the start sitemaps).

## `requestIntervalSecs` (type: `number`):

Seconds to wait between sitemap downloads from the same site (minimum 1). A longer Crawl-delay in robots.txt wins. Different sites are interleaved.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://webscraper.io"
    }
  ],
  "keepUrlsWithoutLastmod": false,
  "includeHreflang": false,
  "deduplicateUrls": true,
  "maxItems": 1000,
  "maxSitemaps": 1000,
  "maxDepth": 5,
  "requestIntervalSecs": 1
}
```

# Actor output Schema

## `overview` (type: `string`):

One row per page URL: url, lastmod, changefreq, priority, sitemapUrl, depth, foundVia, sitemapDomain (and alternates if hreflang is on). Each row is one paid result.

## `runReport` (type: `string`):

JSON: rows, sitemap files read (type, entries, kept, depth, parent, repairs), URLs filtered out by pattern / lastmod / duplicate, skipped inputs by reason (robots_txt, no_sitemap_found, not_a_sitemap, http_error, terms_of_use, ...), requests sent. Free.

# 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": [
        {
            "url": "https://webscraper.io"
        }
    ]
};

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

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

```

## MCP server setup

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