# Sitemap URL Extractor - All Pages of Any Website (`bluemoonstone/sitemap-url-extractor`) Actor

Returns every URL listed in a website's XML sitemaps with lastmod, changefreq, priority and images. Finds sitemaps via robots.txt, follows sitemap indexes and .gz files. Input: domains or sitemap URLs. Filters: URL contains, modified in last N days.

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

## Pricing

$0.30 / 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.

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 - All Pages of Any Website

Get **every URL of a website** from its XML sitemaps, in seconds. Just enter a domain: the Actor finds the sitemaps in `robots.txt` (or at `/sitemap.xml`, `/sitemap_index.xml`, `/wp-sitemap.xml`), follows sitemap indexes, reads `.xml.gz` files and returns one clean row per URL.

### Features

- Auto-discovery from robots.txt, or give sitemap URLs directly
- Nested sitemap indexes, gzip sitemaps and plain-text sitemaps
- `lastmod`, `changefreq`, `priority`, and optional image URLs
- Filters: URL contains / excludes (e.g. only `/blog/`), modified in the last N days
- Bulk: many websites per run, de-duplicated

### Use cases

- SEO audits and content inventories
- Feed URLs to other scrapers (product pages, blog posts, job pages)
- Monitor competitors' new pages (schedule with "modified in the last 1 day")
- Build datasets for AI / RAG pipelines

### Input example

```json
{ "urls": ["apify.com", "https://www.example.com/sitemap.xml"], "urlContains": ["/blog/"], "modifiedSinceDays": 30 }
```

### Output example

```json
{ "url": "https://apify.com/blog/some-post", "lastmod": "2026-11-20", "changefreq": "weekly", "priority": 0.8, "domain": "apify.com", "sitemap": "https://apify.com/sitemap-blog.xml" }
```

Pay only per URL returned. Export to CSV, JSON, Excel or use the API, Make, Zapier, n8n.

### How much does it cost?

$0.30 per 1,000 URLs ($0.0003 per URL). Example: a 20,000-page website costs about $6. Apify's free plan includes monthly platform credit, enough to try it at no cost.

### How to use it

1. Click **Try for free** (an Apify account is free).
2. Fill in the input, or paste the JSON example below.
3. Click **Start** and wait for the run to finish.
4. Download the results as JSON, CSV, Excel or HTML, or get them by API, webhook or an integration (Google Sheets, Zapier, Make, n8n, Slack).

### Run it by API

Run the Actor and get the results in one call:

```bash
curl -X POST 'https://api.apify.com/v2/acts/bluemoonstone~sitemap-url-extractor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{"urls": ["https://apify.com"], "urlContains": ["/blog/"], "modifiedSinceDays": 30}'
```

Or use the official [JavaScript](https://docs.apify.com/api/client/js/) and [Python](https://docs.apify.com/api/client/python/) clients.

### Use it from AI agents (MCP)

This Actor works as a tool for Claude, ChatGPT, Cursor, VS Code and other MCP clients through the [Apify MCP server](https://mcp.apify.com/). Add this server URL to your client:

```
https://mcp.apify.com?tools=bluemoonstone/sitemap-url-extractor
```

Then ask, for example: *"List every blog URL on example.com that changed in the last 30 days."*

It also works with LangChain, LlamaIndex, CrewAI and the OpenAI Agents SDK through the Apify integrations.

### FAQ

**Do I need to know the sitemap URL?**

No. Enter the homepage; the Actor finds the sitemaps automatically from robots.txt, and follows nested sitemap indexes, gzip and plain-text sitemaps.

**Can I get only some pages?**

Yes. Use `urlContains`, `urlExcludes` and `modifiedSinceDays` to filter.

**Why use it instead of a crawler?**

Reading sitemaps is much faster and cheaper than crawling and gives you lastmod dates, which is ideal for SEO audits, migrations and feeding other scrapers.

**Something not working, or need a feature?**

Open an issue in the **Issues** tab. Feature requests are welcome and shape what gets built next.

### Related tools by the same developer

- [Greenhouse, Lever & Ashby Jobs Scraper - Company Careers](https://apify.com/bluemoonstone/ats-jobs-scraper)
- [Website Technology Detector - Tech Stack Lookup in Bulk](https://apify.com/bluemoonstone/tech-stack-detector)
- [Broken Link Checker - Find 404s & Dead Links on Any Site](https://apify.com/bluemoonstone/broken-link-checker)
- [SEO Audit Tool - Bulk On-Page SEO Checker for Any URL](https://apify.com/bluemoonstone/seo-page-audit)
- [Website Screenshot & PDF API - Bulk URL to PNG, JPEG or PDF](https://apify.com/bluemoonstone/website-screenshot-pdf)
- [PDF Text Extractor - Bulk PDF URLs to Text, Pages & Metadata](https://apify.com/bluemoonstone/pdf-text-extractor)

### Responsible use

- This Actor reads **publicly available** pages and data only. It never logs in and does not bypass CAPTCHAs or other access controls.
- You must have the right to access each target and must follow its terms of service and all applicable laws (including privacy and data-protection laws such as GDPR).
- It is not designed to collect personal data. Do not use it to build lists of people.
- Not affiliated with, endorsed by or sponsored by any company, website or brand named here; names are used only to describe compatibility.

# Actor input Schema

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

Website (example.com) to auto-discover its sitemaps from robots.txt, or direct sitemap URLs (https://example.com/sitemap.xml).

## `urlContains` (type: `array`):

Keep only URLs that contain any of these strings (e.g. /blog/, /products/).

## `urlExcludes` (type: `array`):

Drop URLs that contain any of these strings.

## `modifiedSinceDays` (type: `integer`):

Keep only URLs whose lastmod is within N days (URLs without lastmod are dropped).

## `includeImages` (type: `boolean`):

Add images listed in image sitemaps to each row.

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

Stop after this many URLs per website.

## Actor input object example

```json
{
  "urls": [
    "https://apify.com"
  ],
  "includeImages": false,
  "maxUrlsPerSite": 10000
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset items.

# 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"
    ]
};

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

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

```

## MCP server setup

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