# Sitemap Extractor \[$0.30/1k] - All URLs from Any Website (`kadi_bence/sitemap-extractor`) Actor

Extract every URL from a website's XML sitemaps. Input: websites or sitemap URLs; optional URL globs, date filter, status check, new-URLs-only monitor. Returns per URL: url, lastmod, changefreq, priority, images, hreflang, source sitemap. Default: 20 URLs per site. $0.30/1k URLs.

- **URL**: https://apify.com/kadi_bence/sitemap-extractor.md
- **Developed by:** [Bence Kadi](https://apify.com/kadi_bence) (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.24 / 1,000 urls

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 from any website's sitemap

*Last updated: 24 November 2026*

Give it a website and get **every URL listed in its XML sitemaps** as clean rows, with `lastmod`, `changefreq`, `priority`, image count and hreflang alternates. No browser, no API key, **$0.30 per 1,000 URLs**.

**Sample output** (real rows from a test run, shortened)

| Url | Image count | Site | Sitemap url |
|---|---|---|---|
| https://apify.com/ | 0 | https://apify.com | https://apify.com/sitemap/pages.x... |
| https://apify.com/about | 0 | https://apify.com | https://apify.com/sitemap/pages.x... |
| https://apify.com/actors | 0 | https://apify.com | https://apify.com/sitemap/pages.x... |
| https://apify.com/ai-agents | 0 | https://apify.com | https://apify.com/sitemap/pages.x... |

Schedule it with **Only new URLs** and it becomes a monitor: each run returns just the pages a site added since last time.

### ✨ What it does

- 🔍 **Finds the sitemaps for you.** Reads the `Sitemap:` lines in robots.txt, then tries the usual paths (`/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml` and more).
- 🌲 **Follows nested sitemap indexes** and reads `.xml`, `.gz` and plain-text sitemaps.
- 🧹 **Keeps going on messy files.** URLs are recovered from malformed XML, duplicates are removed and loops are detected.
- 🆕 **New-URL monitor.** Track a competitor's new product pages, blog posts or landing pages.
- 🎯 **Filters.** Include or exclude by URL pattern (`/blog/*`), or keep only pages modified in the last N days.
- ✅ **Optional HTTP status check** for every URL, with final URL and redirect count, at the same price.

### 🎯 Use cases

- Seed a crawler or a scraper with a complete URL list.
- SEO audits: compare what the sitemap lists with what is indexed, and find dead URLs in the sitemap.
- Competitor monitoring: get told when a site publishes new pages.
- Build a content inventory, or a URL list for RAG ingestion.

### 🚀 How do I use Sitemap Extractor?

1. Paste one or more websites or sitemap URLs into **Websites or sitemap URLs**.
2. Set **Max URLs per site** to control the cost.
3. Click **Start**, then export as CSV, Excel or JSON.

### 🔧 Input

| Field | What it does | Default |
|---|---|---|
| `startUrls` | Websites or sitemap files. `urls`, `sitemapUrls` and `domains` are accepted too | - |
| `maxUrlsPerSite` | Stop after this many URLs per site | 20 |
| `includeGlobs` / `excludeGlobs` | Shell-style URL patterns, e.g. `/blog/*` | - |
| `modifiedWithinDays` | Keep URLs with a recent `lastmod`. URLs without one are dropped when this is set | - |
| `onlyNewUrls` / `monitorName` | Return only URLs not returned before; names keep separate histories | off |
| `checkStatus` | Adds `status`, `finalUrl`, `redirectCount` | off |

### 📦 What data does Sitemap Extractor return?

```json
{
  "url": "https://example.com/blog/post",
  "lastmod": "2026-11-01",
  "changefreq": "weekly",
  "priority": 0.8,
  "imageCount": 1,
  "alternates": [{ "hreflang": "de", "url": "https://example.com/de/blog/post" }],
  "site": "https://example.com",
  "sitemapUrl": "https://example.com/sitemap-posts.xml.gz"
}
```

The `RUN_SUMMARY` record shows how each site's sitemaps were found, how many files were read, and any that failed.

### 💰 How much does Sitemap Extractor cost?

**$0.30 per 1,000 URLs saved** plus a tiny Actor start fee. Duplicates, filtered URLs and already-seen URLs are free. A site with no sitemap costs nothing: the run ends empty with the reason in its status message.

### ❓ FAQ

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

The run succeeds with no rows and no URL charges. To discover pages by following links, use our [SEO Site Audit](https://apify.com/kadi_bence/seo-site-audit).

#### Does it respect robots.txt?

Yes. It identifies itself as `SitemapExtractorBot` and does not fetch URLs that robots.txt disallows.

#### Is it legal?

Sitemaps are published so that machines can read them. You are responsible for how you use the data and for following each site's terms.

# Actor input Schema

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

A website (apify.com) or a sitemap file (https://example.com/sitemap.xml). For a website the Actor reads the Sitemap: lines in robots.txt, then tries the usual paths. Nested sitemap indexes and .gz files are followed.

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

Stop after this many URLs per site. You pay per URL saved.

## `includeGlobs` (type: `array`):

Shell-style patterns matched against the full URL or path, e.g. /blog/\*. Empty keeps everything.

## `excludeGlobs` (type: `array`):

Shell-style patterns, e.g. */tag/*.

## `modifiedWithinDays` (type: `integer`):

Keep URLs whose lastmod is at most this old. URLs without a lastmod are dropped when this is set.

## `onlyNewUrls` (type: `boolean`):

Return only URLs not returned by an earlier run. Schedule it to get new pages of a site or a competitor.

## `monitorName` (type: `string`):

Use different names to keep separate histories.

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

Sends one HEAD request per URL and adds status, finalUrl and redirectCount. Slower. Same price.

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

Usually not needed. If a site blocks the Actor, try the datacenter Apify Proxy. Residential proxies are not supported.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://apify.com"
    }
  ],
  "maxUrlsPerSite": 20,
  "onlyNewUrls": false,
  "monitorName": "default",
  "checkStatus": false,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `urls` (type: `string`):

One row per URL found in the sitemaps.

## `runSummary` (type: `string`):

Sitemaps read, URLs found and saved per site, errors.

# 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://apify.com"
        }
    ],
    "maxUrlsPerSite": 20,
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kadi_bence/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 = {
    "startUrls": [{ "url": "https://apify.com" }],
    "maxUrlsPerSite": 20,
    "proxyConfiguration": { "useApifyProxy": False },
}

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

```

## MCP server setup

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