# Sitemap Scraper: Extract All URLs from Any Website (`veenkes/veenkes-sitemap-urls`) Actor

Extract every URL from a website's XML sitemaps: auto-discovers sitemaps via robots.txt, follows sitemap indexes, reads .xml.gz, and returns URL, lastmod, changefreq, priority, hreflang alternates and image URLs. Fast, no browser, ideal for SEO audits and crawl seeds.

- **URL**: https://apify.com/veenkes/veenkes-sitemap-urls.md
- **Developed by:** [veenkes](https://apify.com/veenkes) (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.10 / 1,000 url saveds

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 Scraper: Extract All URLs from Any Website

A fast **sitemap scraper / sitemap URL extractor**. Enter a domain and it **finds the sitemaps automatically** (robots.txt and common locations), **follows sitemap indexes**, reads **gzipped sitemaps**, and returns **every URL with lastmod, changefreq, priority, hreflang alternates and image URLs**.

Perfect for SEO audits, content inventories and as a URL list for other crawlers. No browser — tens of thousands of URLs per minute.

### Why use this sitemap scraper?

- 🧭 **Auto-discovery** via robots.txt, sitemap.xml, sitemap_index.xml and wp-sitemap.xml.
- 🪆 **Nested sitemap indexes** and **.xml.gz** handled.
- 🌐 **hreflang alternates** and **image URLs**.
- 🎯 **Regex filter** to keep only /blog/, /products/ and so on.
- 💸 **$0.10–$0.25 per 1,000 URLs.**
- 💸 **From $0.10 per 1,000 URLs.** No monthly rental.

### Who is it for?

- **SEO specialists:** audit indexable pages, lastmod freshness and hreflang setups.
- **Content and e-commerce teams:** inventory every product or article URL of any site.
- **Developers:** seed crawlers and change monitors with complete URL lists.
- **Competitive researchers:** see how many pages and products a competitor has.

### What data does it extract?

| Field | Example |
|---|---|
| `website`, `url` | `https://www.shopify.com/about` |
| `lastmod`, `changefreq`, `priority` | `2026-11-16`, `weekly`, `0.8` |
| `sitemapUrl` | the sitemap file the URL came from |
| `alternates` | `[{"hreflang": "de", "url": "https://example.com/de/"}]` |
| `images` | image URLs (optional) |

### How to use it

1. Enter **websites** or sitemap URLs.
2. Optionally set **max URLs** and a **URL filter**.
3. Click **Start** and export to CSV, Excel or JSON.

### Run it from the API

You can start this Actor from any language with the official [Apify API client](https://docs.apify.com/api/client/python). Replace `YOUR_APIFY_TOKEN` with a token from [Apify Console > Integrations](https://console.apify.com/account/integrations). Never put the token in a public repo.

#### Python

```python
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("veenkes/veenkes-sitemap-urls").call(run_input={
    "websites": [
        "https://www.shopify.com",
        "wordpress.org"
    ],
    "maxUrlsPerWebsite": 50000
})

for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

#### JavaScript

```javascript
import { ApifyClient } from 'apify-client';

const client = new ApifyClient({ token: process.env.APIFY_TOKEN });
const run = await client.actor('veenkes/veenkes-sitemap-urls').call({
    "websites": [
        "https://www.shopify.com",
        "wordpress.org"
    ],
    "maxUrlsPerWebsite": 50000
});
const { items } = await client.dataset(run.defaultDatasetId).listItems();
console.log(items);
```

Schedule the Actor, send results to a webhook, or connect it in Zapier, Make or n8n. Store page: <https://apify.com/veenkes/veenkes-sitemap-urls>.

### Use from AI agents (Apify MCP)

AI agents can run this Actor through the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp). Connect Claude, Cursor or any MCP-compatible client to Apify, then ask the agent to call `veenkes/veenkes-sitemap-urls` with an input like the example above. The agent discovers the tool from the Actor title and description.

### How much does it cost?

| Apify plan tier | Price per 1,000 URLs |
|---|---|
| FREE | $0.25 |
| BRONZE | $0.20 |
| SILVER | $0.15 |
| GOLD and above | $0.10 |

There is also a $0.00005 start fee per run.

### Input example

```json
{
    "websites": [
        "apify.com",
        "https://example.com/sitemap.xml"
    ],
    "maxUrlsPerWebsite": 10000,
    "urlFilter": "/blog/",
    "includeImages": true
}
```

### Output example

```json
{
    "website": "https://wordpress.org",
    "url": "https://wordpress.org/themes/goodwill-charity/",
    "lastmod": "2025-11-18T05:53:47Z",
    "changefreq": null,
    "priority": null,
    "sitemapUrl": "https://wordpress.org/themes/sitemap-8.xml"
}
```

The key-value store record `SUMMARY` lists every input with its status and the number of items saved.

### Limitations

- Only URLs listed in the site's sitemaps are returned; pages missing from sitemaps are not crawled.
- Sites that block bots may return errors for their sitemaps; such websites are reported in the SUMMARY record.
- Duplicate URLs within a website are removed.

### Why this one?

Automatic discovery, nested and gzipped sitemaps, hreflang and images, at a fraction of the price of other sitemap extractors.

### FAQ

**Do I need to know the sitemap URL?**
No, just enter the domain.

**Can it handle millions of URLs?**
Yes, set max URLs accordingly; results stream into the dataset.

**Is it legal?**
Sitemaps are public files published for crawlers.

***

### Integrations

- **Apify API** — Python and JavaScript clients (examples above), plus a REST API.
- **AI agents** — run it via the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp).
- **Automation tools** — Zapier, Make, n8n, or an Apify webhook when a run finishes.
- **Export** — download the dataset as JSON, CSV, Excel or XML, or load it from a scheduled run.

[Open the Actor in Apify Store](https://apify.com/veenkes/veenkes-sitemap-urls).

*None*

# Actor input Schema

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

Domains or homepages (apify.com, https://www.shopify.com) — sitemaps are found automatically via robots.txt — or direct sitemap URLs.

## `maxUrlsPerWebsite` (type: `integer`):

Stop after this many URLs per website.

## `urlFilter` (type: `string`):

Only keep URLs matching this regular expression, e.g. /blog/ or /products/.

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

Add image URLs listed in image sitemaps to each row.

## Actor input object example

```json
{
  "websites": [
    "https://www.shopify.com"
  ],
  "maxUrlsPerWebsite": 500,
  "includeImages": false
}
```

# Actor output Schema

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

No description

## `summary` (type: `string`):

No description

# 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.shopify.com"
    ],
    "maxUrlsPerWebsite": 500
};

// Run the Actor and wait for it to finish
const run = await client.actor("veenkes/veenkes-sitemap-urls").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.shopify.com"],
    "maxUrlsPerWebsite": 500,
}

# Run the Actor and wait for it to finish
run = client.actor("veenkes/veenkes-sitemap-urls").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 '{
  "websites": [
    "https://www.shopify.com"
  ],
  "maxUrlsPerWebsite": 500
}' |
apify call veenkes/veenkes-sitemap-urls --silent --output-dataset

```

## MCP server setup

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

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/vexSHVxBlEIMH0sWd/builds/zJMnQurSQ5PIhDJL6/openapi.json
