# Sitemap URL Extractor: All URLs, Lastmod & Status (`xsi/sitemap-url-extractor`) Actor

Extract every URL of a website from its sitemaps: robots.txt discovery, nested indexes, .gz, text, RSS/Atom, hreflang, images, news. Filter by path or lastmod. Optional live HTTP status check. $0.20 per 1,000 URLs ($0.50 with status checks), failed sites free.

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

## Pricing

from $0.08 / 1,000 url returneds

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/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 URL of a website, with lastmod and live status

Sitemap URL Extractor returns every page URL a website lists in its sitemaps (found automatically via robots.txt, sitemap indexes and `.xml.gz` files), with `lastmod`, hreflang, image/news/video data and, optionally, each URL's live HTTP status.

> **What it does:** Finds and reads every sitemap of a website (robots.txt, sitemap index, gzip, news/image/video sitemaps) and returns all URLs with lastmod, optionally with each URL's HTTP status.
>
> **Who it's for:** SEO specialists, migration projects, crawler and RAG pipelines that need a site's full URL list fast.
>
> **Price:** $0.20 / 1,000 URLs, no start fee, errors and failed items are not charged. Works through the Apify API, as an MCP tool (`https://mcp.apify.com?tools=xsi/sitemap-url-extractor`), and in Zapier, Make, n8n and LangChain via Apify's integrations.

**Give a domain, get every page URL listed in its sitemaps.** The Actor finds the sitemaps itself (robots.txt first, then the usual locations), follows sitemap indexes, reads `.xml`, `.xml.gz`, text and RSS/Atom sitemaps, and returns one clean row per URL with `lastmod`, hreflang alternates, images, news and video data. You can filter by path or date, and switch on a **real status check** (HEAD, with a GET fallback when servers refuse HEAD) to find 404s, redirects and noindex pages.

Use it before a crawl (feed only the pages that matter to Website Content Crawler or an AI agent), for SEO audits (broken or redirected URLs in sitemaps), content monitoring ("what was published in the last 7 days?") and site inventories.

Part of **xsi**: small, honest, pay-per-result tools.

- ✅ **Works on real-world sitemaps.** Sitemap indexes nested up to 10 levels, gzip files even when served as `application/octet-stream`, namespace prefixes (`<sm:url>`), CDATA, entities, BOMs, text sitemaps, RSS 2.0 and Atom feeds, and sitemaps hosted on a CDN or S3 domain.
- ✅ **Doesn't fall for fake sitemaps.** An HTML page answering 200 at `/sitemap.xml` (a soft 404) is recognised and skipped, and the next location is tried. Loops (an index listing itself) are detected.
- ✅ **Never crashes a run.** Broken child sitemaps (404, HTML, corrupt gzip, gzip bombs over 60 MB, files over 55 MB) are listed in the summary and the run continues. There's a time limit per site, and one retry on timeouts, 429 (honouring `Retry-After`) and 5xx.
- ✅ **Status checks that don't lie.** Many servers answer 403, 405 or 501 to HEAD requests. When that happens we retry with a tiny 1 KB GET, so you get the real status. Redirects come with the final URL, and `X-Robots-Tag: noindex` is reported, together giving an `indexable` flag.
- ✅ **Polite and legal.** Honest user agent, no proxy, no login, robots.txt respected: paths it disallows are never requested during status checks. Only URLs are collected, no personal data.
- ✅ **You only pay for URLs.** Sites without a readable sitemap, unreachable sites, invalid input, duplicates (across sitemaps and sites) and URLs removed by your filters are free.

### Pricing: $0.20 per 1,000 URLs ($0.50 with status checks)

One charge per URL returned, never two:

| Apify plan | `url` (sitemap data) | `url-checked` (+ live HTTP status) |
|---|---|---|
| Free | $0.0002 → $0.20 / 1,000 | $0.0005 → $0.50 / 1,000 |
| Bronze | $0.00015 | $0.0003 |
| Silver | $0.0001 | $0.0002 |
| Gold / Platinum / Diamond | $0.00008 | $0.0001 |

No start fee. `Max URLs per site` defaults to 5,000 ($1 at most per site on the Free plan), and your **Maximum cost per run** is always respected: the run stops cleanly and the summary says so.

### Quick start

```json
{ "urls": ["docs.apify.com"] }
```

Blog posts changed in the last 30 days, with live status:

```json
{ "urls": ["example.com"], "includePatterns": ["*/blog/*"], "lastmodSince": "30 days", "checkStatus": true }
```

Inputs can be domains (`example.com`), any page of the site, a sitemap URL (`…/sitemap_index.xml`, `…/post-sitemap.xml.gz`, `…/feed/`) or a `robots.txt` URL. Up to 500 per run.

### Output (one row per URL)

```json
{
  "url": "https://docs.apify.com/sdk",
  "site": "docs.apify.com",
  "lastmod": null,
  "changefreq": "weekly",
  "priority": 0.5,
  "sitemap": "https://docs.apify.com/sitemap_base.xml",
  "imageCount": 0,
  "images": [],
  "alternates": [],
  "status": 200,
  "finalUrl": "https://docs.apify.com/sdk",
  "redirected": false,
  "contentType": "text/html",
  "xRobotsTag": null,
  "indexable": true,
  "checkMethod": "HEAD",
  "charged": true
}
```

News sitemaps add `newsTitle`, `newsPublicationDate` and `newsLanguage`; video sitemaps add `videoTitle` and `videoThumbnail`; RSS/Atom entries add `title`. The status fields (`status`, `finalUrl`, `redirected`, `redirectChain`, `contentType`, `xRobotsTag`, `indexable`, `checkMethod`, `robotsDisallowed`) only appear when `checkStatus` is on. Sites that fail get one free row with `errorType` (`invalid_input`, `dns_error`, `site_unreachable`, `no_sitemap`, `no_robots`) and the sitemaps that were tried.

The **OUTPUT** record gives a per-site summary: sitemap files found (type, entries, how each was discovered), sitemaps that failed and why, URLs found, returned, filtered and duplicated, the newest `lastmod`, and whether a limit stopped the site early.

### AI agent use cases (MCP, LLM frameworks, automation)

- **Plan a crawl before reading pages:** an agent asks for a site's URL list first, then picks only the pages it needs (cheaper than crawling everything).
- **RAG ingestion:** pass the URL list to a content crawler or to `xsi/website-to-llm-markdown`, filtered by path or by `lastmod` date.
- **"What changed this week?"** filter on `lastmod` to get only recently published or updated pages.
- **SEO migrations:** turn on the status check to find redirected or broken URLs that are still listed in sitemaps.

How to connect it:

- **Any MCP client** (Claude Desktop, Cursor, ChatGPT connectors, your own agent): add the Apify MCP server `https://mcp.apify.com/?tools=xsi/sitemap-url-extractor` and the Actor becomes a tool.
- **LLM frameworks:** call it from LangChain or LlamaIndex with Apify's integrations, or from any code through the Apify API (one POST, JSON back).
- **No-code automation:** n8n, Make and Zapier have Apify nodes: run it on a schedule or a trigger and send the rows to Sheets, a CRM or Slack.

### Use with AI agents (MCP)

Available through the Apify MCP server (`https://mcp.apify.com/?tools=xsi/sitemap-url-extractor`). It's a cheap first step for an agent that needs to know what's on a site before reading pages: flat JSON, small defaults, dates in ISO 8601, and errors returned as data.

### Why this one? (problems we fixed from other sitemap Actors)

| Problem seen on the Store | What this Actor does | Regression test |
|---|---|---|
| "Doesn't work even with easy tasks, burns money only" (public review); the most-used official sitemap Actor shows about 9% failed and 14% aborted runs over 30 days (public Store stats, 26 Nov 2026) | Discovery from robots.txt plus 8 fallback locations, a tolerant parser, per-site time limits, no crash on broken files, and you only pay for URLs | `S1`, `S5`, `S6`, `S7`, `S16`, unit tests |
| HEAD-only status checks report false 403/405 | HEAD, then a ranged GET fallback | `S11` |
| Duplicate URLs across sitemaps billed twice | Global de-duplication, free | `S3` |
| Gzip sitemaps served without Content-Encoding fail | Gzip detected by its magic bytes | `S1`, unit tests |
| Sitemaps on a CDN or S3 host return nothing | The site's domain is taken from the URLs inside | `S19` |
| Proxy on by default (extra cost) | No proxy needed: sitemaps are meant to be read by crawlers | — |

### Questions people ask

#### How do I get all URLs of a website?

Enter the domain. The Actor discovers sitemaps from robots.txt and common paths and returns every URL with its lastmod date.

#### How do I find a website's sitemap?

It checks robots.txt `Sitemap:` lines, /sitemap.xml, /sitemap_index.xml and other usual paths, and follows nested sitemap indexes.

#### How do I check which sitemap URLs are broken?

Turn on HTTP status checking; each URL gets its status code.

#### How much does sitemap extraction cost?

$0.20 per 1,000 URLs, or $0.50 per 1,000 with status checks. No start fee; invalid domains are free.

#### Can ChatGPT, Claude or my own AI agent use this tool?

Yes. Add Apify's MCP server (`https://mcp.apify.com?tools=xsi/sitemap-url-extractor`) to Claude, ChatGPT, Cursor or any MCP client and authenticate with your Apify token. Agents can also call it with the Apify API, or pay without an account by buying a capped prepaid token at agi.apify.com (x402, card).

#### Is there a free trial?

Apify's free plan includes monthly platform credit, which covers many runs at these prices. You only pay for results; failures are free.

### Comparison with alternatives

| Tool | Price | Start fee | Users (30 days) |
|---|---|---|---|
| **xsi/sitemap-url-extractor** (this Actor) | $0.20 / 1,000 URLs | no | new |
| apify/sitemap-extractor | $0.50 / 1,000 results | no | 56 |
| maged120/get-urls-pro | $13 / 1,000 | $0.00005 | 14 |
| onescales/sitemap-url-extractor | $30 / 1,000 | $0.00005 | 13 |

*Competitor prices and 30-day user counts: public Apify Store API, checked 26 Nov 2026. Prices change, so check each page before buying.*

**Keywords:** sitemap extractor, get all urls of a website, sitemap to csv, sitemap parser api, url list for crawling, seo url audit

### FAQ

**Is it legal?** Sitemaps are published for crawlers to read. We read only them (and the pages themselves, with a HEAD request, if you ask for status checks), respect robots.txt and collect URLs, not personal data.

**Why does a site return `no_sitemap`?** It has no sitemap in robots.txt or at the usual locations, or blocks automated clients. Try passing the sitemap URL directly. It's free either way.

**A URL has no `lastmod`.** The site didn't provide one. When you use `lastmodSince`, such URLs are left out, and they're counted in the summary.

Missing a feature or found a sitemap that doesn't parse? Open an issue on the **Issues** tab.

# Actor input Schema

## `urls` (type: `array`):

A domain (example.com) finds the sitemaps itself (robots.txt, then the usual locations). You can also give a sitemap URL (…/sitemap.xml, .xml.gz, .txt, RSS/Atom feed) or a robots.txt URL. Up to 500 per run.

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

Stops each site at this many URLs (cost control: 5,000 URLs = $1). Up to 1,000,000.

## `checkStatus` (type: `boolean`):

Requests each URL (HEAD, then a tiny GET if the server refuses HEAD) and returns HTTP status, redirect target, X-Robots-Tag and an indexable flag. Paths disallowed by robots.txt are not requested. Priced $0.50/1,000 instead of $0.20/1,000.

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

Glob (\* = anything), e.g. "*/blog/*", or a /regex/. A URL is kept if it matches at least one. Filtered URLs are free.

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

Glob or /regex/, e.g. "*/tag/*", "*?page=*".

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

A date (2025-01-31) or a period ("7 days", "24 hours", "3 months"). URLs without a lastmod are dropped when this is set. Child sitemaps whose own lastmod is older are skipped entirely (faster).

## `sameSiteOnly` (type: `boolean`):

Drop URLs on other domains (subdomains of the site are kept).

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

Sitemap index → child sitemaps levels. Loops are detected anyway.

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

Safety limit on the number of sitemap files read per site.

## `maxSecondsPerSite` (type: `integer`):

A slow site never blocks the whole run: it stops at this limit and keeps what was found.

## `requestTimeoutSecs` (type: `integer`):

Per sitemap file (one retry on timeout, 429 or 5xx).

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

How many sites are processed at the same time.

## `statusConcurrency` (type: `integer`):

Kept low on purpose to stay polite with the site.

## Actor input object example

```json
{
  "urls": [
    "docs.apify.com"
  ],
  "maxUrlsPerSite": 5000,
  "checkStatus": false,
  "sameSiteOnly": true,
  "maxDepth": 5,
  "maxSitemapsPerSite": 1000,
  "maxSecondsPerSite": 900,
  "requestTimeoutSecs": 30,
  "maxConcurrency": 5,
  "statusConcurrency": 5
}
```

# 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 = {
    "urls": [
        "docs.apify.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("xsi/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 = { "urls": ["docs.apify.com"] }

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

```

## MCP server setup

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