# Sitemap URL Scraper (`neuro-scraper/sitemap-url-scraper`) Actor

Sitemap Scraper SD - Sitemap Scraper is an SEO crawling tool that extracts every URL from a website's sitemaps (robots.txt, sitemap.xml, indexes, gzip, RSS) with lastmod, changefreq, priority, hreflang and news data.

- **URL**: https://apify.com/neuro-scraper/sitemap-url-scraper.md
- **Developed by:** [Neuro Scraper](https://apify.com/neuro-scraper) (community)
- **Categories:** SEO tools, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.49 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
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 Scraper — every URL in a website's sitemaps

Sitemap Scraper finds a website's sitemaps — from robots.txt `Sitemap:` lines, or `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`, `/sitemap.xml.gz`, `/sitemap.txt` — follows sitemap indexes to the end, unpacks gzip files and exports every URL with **lastmod, changefreq and priority**, plus hreflang alternates, image counts and Google News titles and dates. Give it a website or a sitemap URL.

Filter by URL globs or by last-modified date (for incremental runs), and optionally check each URL's HTTP status.

#### Input

| Field | Type | Default | Meaning |
|---|---|---|---|
| `startUrls` | URL list | crawlee.dev (prefill) | Websites or sitemap / sitemap-index URLs (.xml, .xml.gz, .txt) |
| `maxItems` | integer | 1000 | URLs saved |
| `maxSitemaps` | integer | 200 | Sitemap files read (indexes included) |
| `includeUrlGlobs` / `excludeUrlGlobs` | glob lists | – | e.g. `https://site.com/blog/**` |
| `lastmodAfter` | date | – | Only URLs with `<lastmod>` on/after YYYY-MM-DD |
| `checkUrlStatus` | boolean | false | Request each URL and add `statusCode`, `finalUrl`, `statusNote` |
| `tryWellKnownPaths` | boolean | true | Probe common sitemap paths when robots.txt lists none |
| `respectRobotsTxt` | boolean | true | Skip sitemap files / URL checks robots.txt disallows |
| `requestDelayMs` | integer | 1000 | Pause between requests to one host |
| `proxyConfiguration` | proxy | Apify datacenter | RESIDENTIAL for sites that block datacenter IPs |

#### Output (one row per URL)

| Field | Meaning |
|---|---|
| `url` | Page URL from the sitemap |
| `lastmod`, `changefreq`, `priority` | As published in the sitemap (null when absent) |
| `imageCount`, `alternates` | Image-sitemap entries; hreflang alternates `[{hreflang, href}]` |
| `newsTitle`, `newsPublishedAt` | Google News sitemap data |
| `sitemapUrl`, `sitemapType`, `inputUrl` | Which file it came from (`urlset`, `rss`, `atom`, `text`) and which input |
| `statusCode`, `finalUrl`, `statusNote` | Only with `checkUrlStatus` |
| `scrapedAt` | ISO time |

A per-site summary (sitemaps found and how, files read, URLs saved, problems) is stored in the key-value store record `SUMMARY`.

#### Measured (2026-10-03, see TEST_REPORT.md)

- crawlee.dev: 1,000 URLs in 8 s; target.com gzip store index: 2,026 URLs in 10 s; wordpress.org: 30 files (17 indexes) -> 2,576 unique URLs in 36 s.

#### Limits

- Only URLs the site lists in its sitemaps (python.org publishes none: 0 rows, said plainly).
- `checkUrlStatus` makes one request per URL at the per-host delay — about 1 URL per second per site.
- Sitemaps behind anti-bot pages cannot be read; try a RESIDENTIAL proxy.

#### Example

```json
{"startUrls": [{"url": "https://www.theguardian.com"}], "lastmodAfter": "2026-10-01", "maxItems": 500}
```

# Actor input Schema

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

A website (https://crawlee.dev - its sitemaps are found through robots.txt or /sitemap.xml) or a sitemap / sitemap index URL (https://crawlee.dev/sitemap.xml, .xml.gz and .txt work too).

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

Maximum number of URLs saved (one row per URL).

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

Maximum number of sitemap files (indexes included) read per run.

## `includeUrlGlobs` (type: `array`):

Only save URLs matching one of these globs, e.g. https://crawlee.dev/python/\*\* (\*\* = anything, \* = anything except '/').

## `excludeUrlGlobs` (type: `array`):

Never save URLs matching these globs, e.g. **/tag/**

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

YYYY-MM-DD. Keeps only URLs whose sitemap <lastmod> is on or after this date (URLs without lastmod are left out when this is set).

## `checkUrlStatus` (type: `boolean`):

Request every saved URL (HEAD, or GET without downloading the body) and add statusCode and finalUrl. One request per URL, spaced by the delay below - slow for large sites.

## `tryWellKnownPaths` (type: `boolean`):

When robots.txt lists no sitemap, try /sitemap.xml, /sitemap_index.xml, /sitemap-index.xml, /wp-sitemap.xml, /sitemap.xml.gz and /sitemap.txt.

## `respectRobotsTxt` (type: `boolean`):

Do not read sitemap files or check URLs that the site's robots.txt disallows.

## `requestDelayMs` (type: `integer`):

Pause between two requests to the same host.

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

Apify Proxy (datacenter by default). Choose RESIDENTIAL for sites that block datacenter IPs.

## Actor input object example

```json
{
  "startUrls": [
    {
      "url": "https://crawlee.dev"
    }
  ],
  "maxItems": 1000,
  "maxSitemaps": 200,
  "checkUrlStatus": false,
  "tryWellKnownPaths": true,
  "respectRobotsTxt": true,
  "requestDelayMs": 1000,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# 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://crawlee.dev"
        }
    ],
    "proxyConfiguration": {
        "useApifyProxy": true
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("neuro-scraper/sitemap-url-scraper").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://crawlee.dev" }],
    "proxyConfiguration": { "useApifyProxy": True },
}

# Run the Actor and wait for it to finish
run = client.actor("neuro-scraper/sitemap-url-scraper").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://crawlee.dev"
    }
  ],
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}' |
apify call neuro-scraper/sitemap-url-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,neuro-scraper/sitemap-url-scraper"
        }
    }
}
```

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/B0YEXRzL1Ns9ifRW8/builds/SoFyHqbI9SLmZcHWu/openapi.json
