# Sitemap & URL Discovery - Find All URLs on Any Site (`santamaria-automations/sitemap-url-discovery`) Actor

Discover every URL on any website by parsing sitemap.xml, robots.txt, and sitemap indexes. Extract URLs with last modified dates, change frequency, and priority. Perfect for SEO audits, content analysis, crawling preparation, and site mapping.

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

## Pricing

from $2.00 / 1,000 website analyzeds

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 Discovery

**Map every page on any website in seconds.**

Point this actor at any domain and it will discover every URL the site publishes — by parsing `robots.txt`, `sitemap.xml`, nested sitemap indexes, and image sitemaps. You get back a clean dataset of URLs with their last modified date, change frequency, and priority, ready to feed into SEO audits, content inventories, or the next stage of your crawling pipeline.

No scraping, no HTML parsing, no browser automation — just the standard files every well-behaved site publishes, fetched and parsed at machine speed.

### Features

- **robots.txt aware** — follows every `Sitemap:` directive found in robots.txt
- **Default location probing** — falls back to `/sitemap.xml`, `/sitemap_index.xml`, `/sitemap.xml.gz`
- **Sitemap index recursion** — follows `<sitemapindex>` files to any depth you allow
- **Gzip support** — transparently decompresses `.gz` sitemaps
- **Rich metadata** — extracts `<lastmod>`, `<changefreq>`, `<priority>`
- **Image sitemap support** — optional extraction of `<image:loc>` entries
- **Deduplication** — URLs seen in multiple sitemaps are emitted once
- **Safety caps** — per-site URL limit prevents runaway jobs on massive sites
- **Per-site summary** — one summary record per website with counts and source sitemaps
- **Fast & lightweight** — runs at minimal cost with no browser overhead

### Use with AI Agents (MCP)

Connect this actor to any MCP-compatible AI client — Claude Desktop, Claude.ai, Cursor, VS Code, LangChain, LlamaIndex, or custom agents.

**Apify MCP server URL:**

````

https://mcp.apify.com?tools=santamaria-automations/sitemap-url-discovery

````

**Example prompt once connected:**

> "Use `sitemap-url-discovery` to process data with sitemap url discovery. Return results as a table."

Clients that support dynamic tool discovery (Claude.ai, VS Code) will receive the full input schema automatically via `add-actor`.

### Example Output

Running against `https://www.apify.com` and `https://wordpress.org` returns records like:

```json
{
  "website": "https://www.apify.com",
  "url": "https://apify.com/store",
  "lastmod": "2026-03-15",
  "changefreq": "daily",
  "priority": "0.8",
  "source_sitemap": "https://apify.com/sitemap.xml",
  "is_image": false,
  "image_url": null,
  "scraped_at": "2026-04-07T10:15:32Z"
}
````

Plus one summary record per website:

```json
{
  "website": "https://wordpress.org",
  "type": "summary",
  "robots_txt_found": true,
  "sitemaps_found": 4,
  "sitemap_urls": [
    "https://wordpress.org/sitemap.xml",
    "https://wordpress.org/news/sitemap.xml",
    "https://wordpress.org/plugins/sitemap.xml",
    "https://wordpress.org/themes/sitemap.xml"
  ],
  "total_urls": 8243,
  "scraped_at": "2026-04-07T10:15:45Z"
}
```

### Input Parameters

| Parameter | Type | Default | Description |
|---|---|---|---|
| `websites` | array | **required** | Website URLs to analyze. Bare domains or full URLs both work. |
| `followSitemapIndex` | boolean | `true` | Recursively follow `<sitemapindex>` files. |
| `respectRobotsTxt` | boolean | `true` | Read robots.txt and follow `Sitemap:` directives. |
| `maxUrlsPerSite` | integer | `10000` | Safety cap on URLs returned per website. |
| `maxDepth` | integer | `3` | Max recursion depth for nested sitemap indexes. |
| `includeLastmod` | boolean | `true` | Include `<lastmod>` dates when present. |
| `includeImages` | boolean | `false` | Include `<image:loc>` entries from image sitemaps. |
| `timeoutSeconds` | integer | `30` | Per-sitemap HTTP timeout. |
| `proxyConfiguration` | object | disabled | Optional Apify proxy. Usually not needed. |

### Use Cases

#### SEO Audits

Cross-reference the URLs a site exposes in its sitemap against what's actually in Google's index. Find orphaned pages (in sitemap, not indexed) and rogue pages (indexed, not in sitemap). Spot missing `lastmod` tags that weaken crawl budget.

#### Content Inventory

Answer "how many pages does this site have?" in seconds. Break down by section by grouping URLs on path prefix. Track growth over time by comparing snapshots.

#### Crawling Preparation

Instead of crawling from the homepage and hoping to find everything, feed a clean URL list into your content extractor. Faster, more predictable, and much easier on the target site.

#### Competitor Analysis

Run weekly against competitor domains and diff the results to detect new product pages, blog posts, or landing pages the moment they ship.

#### Site Migration Planning

Get a complete URL inventory of the legacy site before migration. Use it to build 301 redirect maps, verify coverage after launch, and guarantee no page is left behind.

#### Content Mining

Filter discovered URLs by path (`/blog/`, `/products/`, `/jobs/`) to focus downstream extraction on exactly the content type you care about.

### Pricing

- **$0.001** per run start
- **$0.002** per website analyzed

Pricing is per website, not per URL. Discovering 100,000 URLs on one site costs the same as discovering 10 URLs — so you can run this against large domains without worrying about a surprise bill.

### Issues & Feedback

Found a bug or have a feature request? Please [open an issue](https://apify.com/santamaria-automations) on the actor page.

### Related Actors

- [Website Contact Extractor](https://apify.com/santamaria-automations/website-contact-extractor) — Extract emails, phones, and team members from any company website.
- [Website Tech Stack Detector](https://apify.com/santamaria-automations/website-tech-detector) — Identify the CMS, frameworks, analytics, and hosting stack behind any site.
- [Domain WHOIS & DNS Lookup](https://apify.com/santamaria-automations/domain-whois-dns) — Resolve DNS records and WHOIS registration data for any domain.

# Actor input Schema

## `websites` (type: `array`):

List of website URLs to analyze. You can provide bare domains (example.com) or full URLs (https://example.com). The actor will probe robots.txt and the default sitemap locations for each.

## `followSitemapIndex` (type: `boolean`):

When a sitemap index (<sitemapindex>) is detected, recursively fetch all child sitemaps. Disable to only inspect the top-level sitemap.

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

Read robots.txt and follow any Sitemap: directives found. When disabled, only the default sitemap locations (/sitemap.xml, /sitemap\_index.xml, /sitemap.xml.gz) are probed.

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

Safety cap on URLs returned per website. Large sites (news, e-commerce) can have hundreds of thousands of URLs — increase this value if you need the full set.

## `maxDepth` (type: `integer`):

Maximum recursion depth when following nested sitemap indexes. Depth 1 = top-level index + its child sitemaps. Most sites have depth 1-2.

## `includeLastmod` (type: `boolean`):

Include the <lastmod> date when available. Useful for detecting new or recently updated content.

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

Include <image:loc> entries from image sitemaps. When enabled, image URLs are emitted as extra rows with is\_image=true.

## `timeoutSeconds` (type: `integer`):

HTTP timeout applied to every sitemap, robots.txt, and child sitemap fetch.

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

Optional Apify proxy settings. Most sitemaps are served without anti-bot protection, so proxy is usually not needed.

## Actor input object example

```json
{
  "websites": [
    "https://www.apify.com",
    "https://wordpress.org"
  ],
  "followSitemapIndex": true,
  "respectRobotsTxt": true,
  "maxUrlsPerSite": 10000,
  "maxDepth": 3,
  "includeLastmod": true,
  "includeImages": false,
  "timeoutSeconds": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Dataset of all URLs discovered from sitemaps and robots.txt

# 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 = {
    "websites": [
        "https://www.apify.com",
        "https://wordpress.org"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("santamaria-automations/sitemap-url-discovery").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 = { "websites": [
        "https://www.apify.com",
        "https://wordpress.org",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("santamaria-automations/sitemap-url-discovery").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "websites": [
    "https://www.apify.com",
    "https://wordpress.org"
  ]
}' |
apify call santamaria-automations/sitemap-url-discovery --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=santamaria-automations/sitemap-url-discovery",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Sitemap & URL Discovery - Find All URLs on Any Site",
        "description": "Discover every URL on any website by parsing sitemap.xml, robots.txt, and sitemap indexes. Extract URLs with last modified dates, change frequency, and priority. Perfect for SEO audits, content analysis, crawling preparation, and site mapping.",
        "version": "1.0",
        "x-build-id": "J1t1UB2tOCdMXhFNc"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/santamaria-automations~sitemap-url-discovery/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-santamaria-automations-sitemap-url-discovery",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/santamaria-automations~sitemap-url-discovery/runs": {
            "post": {
                "operationId": "runs-sync-santamaria-automations-sitemap-url-discovery",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/santamaria-automations~sitemap-url-discovery/run-sync": {
            "post": {
                "operationId": "run-sync-santamaria-automations-sitemap-url-discovery",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "websites"
                ],
                "properties": {
                    "websites": {
                        "title": "Websites",
                        "type": "array",
                        "description": "List of website URLs to analyze. You can provide bare domains (example.com) or full URLs (https://example.com). The actor will probe robots.txt and the default sitemap locations for each.",
                        "items": {
                            "type": "string"
                        }
                    },
                    "followSitemapIndex": {
                        "title": "Follow Sitemap Index",
                        "type": "boolean",
                        "description": "When a sitemap index (<sitemapindex>) is detected, recursively fetch all child sitemaps. Disable to only inspect the top-level sitemap.",
                        "default": true
                    },
                    "respectRobotsTxt": {
                        "title": "Read robots.txt",
                        "type": "boolean",
                        "description": "Read robots.txt and follow any Sitemap: directives found. When disabled, only the default sitemap locations (/sitemap.xml, /sitemap_index.xml, /sitemap.xml.gz) are probed.",
                        "default": true
                    },
                    "maxUrlsPerSite": {
                        "title": "Max URLs per Site",
                        "minimum": 1,
                        "maximum": 1000000,
                        "type": "integer",
                        "description": "Safety cap on URLs returned per website. Large sites (news, e-commerce) can have hundreds of thousands of URLs — increase this value if you need the full set.",
                        "default": 10000
                    },
                    "maxDepth": {
                        "title": "Max Sitemap Depth",
                        "minimum": 1,
                        "maximum": 10,
                        "type": "integer",
                        "description": "Maximum recursion depth when following nested sitemap indexes. Depth 1 = top-level index + its child sitemaps. Most sites have depth 1-2.",
                        "default": 3
                    },
                    "includeLastmod": {
                        "title": "Include Last Modified",
                        "type": "boolean",
                        "description": "Include the <lastmod> date when available. Useful for detecting new or recently updated content.",
                        "default": true
                    },
                    "includeImages": {
                        "title": "Include Images",
                        "type": "boolean",
                        "description": "Include <image:loc> entries from image sitemaps. When enabled, image URLs are emitted as extra rows with is_image=true.",
                        "default": false
                    },
                    "timeoutSeconds": {
                        "title": "Per-Sitemap Timeout (seconds)",
                        "minimum": 5,
                        "maximum": 300,
                        "type": "integer",
                        "description": "HTTP timeout applied to every sitemap, robots.txt, and child sitemap fetch.",
                        "default": 30
                    },
                    "proxyConfiguration": {
                        "title": "Proxy Configuration",
                        "type": "object",
                        "description": "Optional Apify proxy settings. Most sitemaps are served without anti-bot protection, so proxy is usually not needed.",
                        "default": {
                            "useApifyProxy": false
                        }
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
