# Sitemap URL Extractor - every page of any site (`sbr35/sitemap-url-extractor`) Actor

Input: any website URL. Output: every page the site lists in its sitemap, with last-modified date, change frequency and priority. Sitemap indexes are followed automatically. Use when you need a complete URL inventory of a site without crawling it.

- **URL**: https://apify.com/sbr35/sitemap-url-extractor.md
- **Developed by:** [Alexandre de La Fayette](https://apify.com/sbr35) (community)
- **Categories:** SEO tools, Developer tools, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 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/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Sitemap URL Extractor

Get **every page a website publishes**, straight from its sitemap. No crawling.

Point it at a domain. It finds the sitemap the way a search engine does — robots.txt first, then
the conventional paths — follows sitemap indexes, and returns the full URL inventory.

### Why not crawl?

A crawler visits thousands of pages to discover what exists. A sitemap *is* that list, published
by the site for exactly this purpose. Reading it is faster, cheaper, complete, and cannot break
on a redesign.

### What you get

| Field | Description |
|---|---|
| `url` | The page URL |
| `lastModified` | `lastmod` from the sitemap, where declared |
| `changeFrequency` | `changefreq` hint |
| `priority` | `priority` value, 0.0–1.0 |
| `sourceDomain` | Site the URL belongs to |
| `sitemapUrl` | Which sitemap it came from |
| `scrapedAt` | Collection time |

### Input

```json
{
  "sites": ["apify.com", "vercel.com"],
  "urlContains": "/blog/",
  "modifiedAfter": "2026-01-01",
  "maxUrlsPerSite": 1000
}
```

| Option | Default | What it does |
|---|---|---|
| `sites` | required | Domains or direct sitemap URLs — both work |
| `urlContains` | empty | Keep only URLs containing this, e.g. `/blog/` |
| `modifiedAfter` | empty | Keep only pages modified on or after this date |
| `maxUrlsPerSite` | 1000 | Cap per site |

Sitemap indexes are followed automatically (up to 25 child sitemaps), and duplicate URLs across
overlapping sitemaps are removed.

### Who this is for

- **SEO teams** auditing indexable pages, or finding pages missing from a sitemap
- **Content teams** inventorying every article on a site with `urlContains: "/blog/"`
- **Migration planning** — a complete URL list before moving a site
- **Competitive research** — see a competitor's full content footprint and publishing cadence
  via `lastModified`
- **Feeding a crawler** a precise URL list instead of letting it discover blindly

Pairs with our **RSS Feed Finder & Reader**: that one gives you a site's recent articles, this
one gives you everything it has ever published.

### Honest limits

- **A sitemap is what the site chooses to declare.** Pages excluded from it will not appear —
  this is an inventory of the published sitemap, not a guarantee of every page in existence.
- `lastModified`, `changeFrequency` and `priority` are optional in the standard, and many sites
  omit them. Empty values mean the site did not declare them.
- Sites with no sitemap return `no sitemap found`. That costs you nothing.
- Very large sitemap indexes are followed to 25 children to keep runs bounded.

### Pricing

Pay per event. Charged per URL returned. A site with no sitemap costs nothing.

### Changelog

**1.0** — First release. robots.txt discovery, sitemap index following, filters and dedup.

# Actor input Schema

## `sites` (type: `array`):

Website URLs, or direct sitemap.xml URLs. The sitemap is located via robots.txt and the usual paths if you give a plain domain.

## `urlContains` (type: `string`):

Keep only URLs containing this text, e.g. /blog/ to get just blog posts.

## `modifiedAfter` (type: `string`):

Keep only URLs whose lastmod is on or after this date. Format YYYY-MM-DD.

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

Cap on URLs returned per site.

## Actor input object example

```json
{
  "sites": [
    "apify.com",
    "vercel.com"
  ],
  "maxUrlsPerSite": 1000
}
```

# Actor output Schema

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

Every page listed in the site's sitemap.

## `urlsCsv` (type: `string`):

The same URLs as a spreadsheet-ready CSV.

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

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

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

```

## MCP server setup

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