# Sitemap Extractor - All Website URLs from XML Sitemaps (`scrolahdata/sitemap-extractor`) Actor

Sitemap extractor: get all URLs of any website from its XML sitemaps. Auto-finds sitemaps via robots.txt, follows sitemap indexes and .xml.gz. lastmod, priority, hreflang, image and video sitemap data, regex and date filters. $0.10 per 1,000 URLs.

- **URL**: https://apify.com/scrolahdata/sitemap-extractor.md
- **Developed by:** [Leping Gong](https://apify.com/scrolahdata) (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.08 / 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 Extractor — Get All URLs of a Website from XML Sitemaps (sitemap.xml, Index, .gz, Image & News Sitemaps)

Enter a **domain** and get **every URL of the website** from its sitemaps — or paste sitemap URLs directly. The extractor **finds sitemaps automatically** (robots.txt `Sitemap:` lines, `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml` …), follows **sitemap indexes** recursively, unpacks **.xml.gz**, reads **sitemap.txt** and **RSS / Atom feeds**, and returns each URL with **lastmod, changefreq, priority, hreflang alternates, image sitemap and video sitemap data and Google News sitemap fields**.

Fast and cheap — **$0.10 per 1,000 URLs**, no start fee.

### Why this sitemap extractor?

- 🔍 **Sitemap finder** — just type `example.com`; robots.txt and common sitemap locations are checked for you
- 🗂️ **Sitemap index + .gz** — nested indexes (up to 5 levels), gzip, 50,000-URL files, broken XML (regex fallback)
- 📅 **New & updated pages** — *Modified since* keeps only URLs with a recent `lastmod`; child sitemaps that weren't modified are skipped
- 🎯 **Regex filters** — include `/blog/` or `/products/`, exclude `/tag/|/page/`
- 🖼️ **Image & video sitemaps** — image URLs, titles, captions; video title, thumbnail, duration
- 🌍 **hreflang** — `xhtml:link` alternate language URLs per page
- 📰 **Google News sitemaps** — article title, publication date, publication name, language
- 🧾 Optional list of every **sitemap file** with its type and URL count (free rows)

### Input

```json
{
  "urls": ["apify.com", "https://www.bbc.com/sitemaps/https-index-com-news.xml"],
  "includePattern": "/store/",
  "modifiedSince": "2026-11-01",
  "maxUrlsPerDomain": 10000
}
```

### Output

```json
{
  "url": "https://www.bbc.com/sport/cricket/articles/c0q44le0z5wo",
  "domain": "www.bbc.com",
  "path": "/sport/cricket/articles/c0q44le0z5wo",
  "lastmodIso": "2026-11-15T13:34:57+00:00",
  "changefreq": null,
  "priority": null,
  "sitemapUrl": "https://www.bbc.com/sitemaps/https-sitemap-com-news-1.xml",
  "imageCount": 0,
  "alternates": [],
  "news": {"title": "Australia v England: ...", "publicationDate": "2026-11-15T13:34:57Z", "publicationName": "BBC News", "language": "en"}
}
```

### Use cases

- **Website URL list** for crawling, scraping or content audits — feed the URLs into any other Actor
- **SEO audits** — count indexable pages, find pages without lastmod, check hreflang coverage. Pair with the [SEO Meta Tags & Schema Extractor](https://apify.com/scrolahdata/seo-meta-tags-extractor) and the [Bulk URL Status Checker](https://apify.com/scrolahdata/bulk-url-status-checker)
- **Competitor monitoring** — schedule daily with *Modified since* to see new products, blog posts or landing pages
- **News monitoring** — read Google News sitemaps of publishers for the latest articles
- **Site migrations** — export the full URL inventory before and after a redesign
- **AI / RAG pipelines** — get the list of documentation pages to load into your knowledge base

### Tips & limits

- Websites without any sitemap are reported with an error row (not charged).
- URLs are deduplicated across sitemaps. A *Max URLs per website* limit also stops downloading further sitemap files.
- Some sites block datacenter IPs — enable *Proxy* → Apify Proxy.

### Pricing

- **URL extracted** — $0.10 per 1,000 URLs. Sitemap list rows and errors are free.

Discounts for Apify Silver, Gold and higher plans.

### Integrations & API

- **API** — run it from Python, Node.js or any language with the Apify API / `apify-client`; export JSON, CSV or Excel.
- **Schedules** — run daily or weekly and watch for new pages.
- **Zapier, Make, n8n, Google Sheets, Slack, webhooks** — send new URLs to your tools.
- **AI agents (MCP)** — use it from Claude, ChatGPT, Cursor or any MCP client through the Apify MCP server.

### FAQ

**Does it crawl the website?** No — it reads the sitemaps the website publishes, which is much faster and cheaper than crawling.

**What if a site lists its sitemaps only in robots.txt?** That's the first place we look.

**Is there a limit on sitemap size?** Standard sitemaps hold up to 50,000 URLs per file; indexes of hundreds of files are fine.

### More from ScrolahData

- [SEO Meta Tags & Schema Extractor](https://apify.com/scrolahdata/seo-meta-tags-extractor)
- [Bulk URL Status Checker](https://apify.com/scrolahdata/bulk-url-status-checker)
- [Tech Stack Detector](https://apify.com/scrolahdata/tech-stack-detector)
- [Domain WHOIS, DNS & SSL Checker](https://apify.com/scrolahdata/domain-whois-dns-checker)
- [Website Contact Scraper](https://apify.com/scrolahdata/website-contact-scraper)

# Actor input Schema

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

A domain (example.com — sitemaps are found via robots.txt and common paths) or a direct sitemap URL (sitemap.xml, sitemap index, .xml.gz, sitemap.txt, RSS/Atom feed). One per line.

## `maxUrls` (type: `integer`):

Stop after this many URLs. 0 = no limit.

## `maxUrlsPerDomain` (type: `integer`):

0 = no limit.

## `includePattern` (type: `string`):

Only output URLs matching this regular expression, e.g. /blog/ or /products/.

## `excludePattern` (type: `string`):

Skip URLs matching this regular expression, e.g. /tag/|/page/.

## `modifiedSince` (type: `string`):

Only URLs with lastmod on or after this date (new and updated pages). URLs without lastmod are skipped when set.

## `includeImagesVideos` (type: `boolean`):

Image sitemap (image URLs, titles, captions) and video sitemap entries (title, thumbnail, duration).

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

xhtml:link hreflang language versions for each URL.

## `outputSitemapList` (type: `boolean`):

Add one free row per sitemap file (type, entry count).

## `browserUserAgent` (type: `boolean`):

Send a desktop Chrome user agent (some sites block bots from sitemaps).

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

Sitemap files downloaded in parallel.

## `proxyConfiguration` (type: `object`):

Optional. Use Apify Proxy if a site blocks datacenter IPs.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com",
    "https://www.python.org/jobs/feed/rss/"
  ],
  "maxUrls": 0,
  "maxUrlsPerDomain": 0,
  "includeImagesVideos": true,
  "includeAlternates": true,
  "outputSitemapList": false,
  "browserUserAgent": true,
  "maxConcurrency": 5,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# 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 = {
    "urls": [
        "https://apify.com",
        "https://www.python.org/jobs/feed/rss/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("scrolahdata/sitemap-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": [
        "https://apify.com",
        "https://www.python.org/jobs/feed/rss/",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("scrolahdata/sitemap-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": [
    "https://apify.com",
    "https://www.python.org/jobs/feed/rss/"
  ]
}' |
apify call scrolahdata/sitemap-extractor --silent --output-dataset

```

## MCP server setup

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