# XML Sitemap Scraper & URL Extractor API - SEO Crawler (`pink_comic/sitemap-url-extractor`) Actor

Parse XML website sitemaps and extract URLs for SEO crawls, audits, migrations, and RAG indexing. Auto-discovers sitemap files from robots.txt, follows nested indexes, and exports URL, lastmod, priority, changefreq, and image metadata.

- **URL**: https://apify.com/pink_comic/sitemap-url-extractor.md
- **Developed by:** [Ava Torres](https://apify.com/pink_comic) (community)
- **Categories:** Developer tools, AI
- **Features:** Limited permissions
- **Stats:** 24 total users, 4 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.40 / 1,000 url extracteds

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

## XML Sitemap Scraper & URL Extractor API

Parse XML website sitemaps and extract URLs for SEO crawls, audits, content migrations, RAG indexing, competitive research, and website monitoring. The actor can discover sitemap files from robots.txt, follow nested sitemap indexes, and export publisher-supplied URL metadata in bulk.

### What it does

Give it a full website URL or sitemap.xml link, and it returns listed URLs up to your `maxResults` cap, with available sitemap metadata such as `lastmod`, `changefreq`, and `priority`. Use it as a sitemap parser, URL extraction API, or lightweight SEO crawler seed-list generator.

**Key features:**

- **Auto-discovery** -- Checks robots.txt and common sitemap paths
- **Nested sitemap support** -- Follows sitemap index files up to four levels including the root
- **Gzip support** -- Parses gzip-compressed sitemap responses
- **Sitemap metadata** -- Extracts `lastmod`, `changefreq`, `priority`, and optional image declarations
- **Date filtering** -- Filters parseable publisher-supplied `lastmod` values
- **Bulk processing** -- Processes multiple websites with one total output cap
- **No external API key** -- Uses public website and sitemap responses

### Input

| Field | Description | Default |
|-------|-------------|---------|
| urls | Full website or sitemap.xml URLs to parse | `https://www.apify.com/sitemap.xml` |
| autoDiscover | Check robots.txt and common paths for website inputs | true |
| maxResults | Total output cap across all inputs | 25 |
| modifiedSince | Filter parseable publisher-supplied `lastmod` values | (all) |
| includeImages | Include image declarations from sitemap extensions | false |

### Output

Each result contains:

```json
{
  "url": "https://example.com/page",
  "sitemapSource": "https://example.com/sitemap.xml",
  "lastModified": "2026-04-01",
  "changeFreq": "weekly",
  "priority": "0.8",
  "images": []
}
```

### What the output means

A sitemap is a website-publisher declaration, not an independent crawl or verification. Results show that a URL and metadata appeared in the fetched sitemap response at run time. They do **not** prove that a page or image is reachable, indexed by a search engine, canonical, current, safe, owned by a particular party, or unchanged since `lastmod`.

`lastmod`, `changefreq`, and `priority` are optional publisher-supplied hints. They can be absent, stale, malformed, or ignored by search engines. When `modifiedSince` is set, entries with a parseable date before the cutoff are excluded; entries with missing or unparseable dates remain because their modification date is unknown. Auto-discovery checks robots.txt and a small set of conventional paths, so an empty result does not prove that no sitemap exists.

### Use cases

- **SEO Audit / Crawling** -- Get a complete list of sitemap URLs with metadata before a crawl
- **RAG Indexing** -- Build URL seed lists for documentation, help centers, and content ingestion
- **Content Migration** -- Map all URLs before migrating to a new platform
- **Competitive Analysis** -- See what pages competitors have and how often they update
- **Website Monitoring** -- Track new pages added since a specific date
- **Link Building** -- Find all pages on a target site to identify link opportunities
- **Content Inventory** -- Catalog all pages with their update frequency and priority

### Pricing

The live pay-per-result rate is **$0.0005 per extracted URL**: about **$0.0125 for the 25-result default** or **$0.50 per 1,000 results**. Set `maxResults` to control the total output and charge. Account-specific platform charges or credits may apply.

### How to use

1. Open [XML Sitemap Scraper & URL Extractor API - SEO Crawler](https://apify.com/pink_comic/sitemap-url-extractor) in Apify Console and click **Start** (or **Try for free**).
2. Fill in the input form - start with **Website or Sitemap URLs**, **Auto-Discover Sitemaps**, **Max Results**. Every field is optional unless marked required, and the form is prefilled with a working example.
3. Set **Maximum results** to cap your cost, then run the Actor.
4. Download the results as JSON, CSV, Excel, XML or HTML, or pull them with the Apify API.

#### Example input

```json
{
  "urls": [
    "https://www.apify.com/sitemap.xml"
  ],
  "autoDiscover": true,
  "maxResults": 100,
  "includeImages": false
}
```

### Output example

One record from a real run (long values shortened, contact details partly masked):

```json
{
  "url": "https://apify.com/",
  "sitemapSource": "https://apify.com/sitemap/pages.xml"
}
```

### FAQ

#### How much does XML Sitemap Scraper & URL Extractor API - SEO Crawler cost?

$0.0005 per url extracted. For example, 1,000 results cost about $0.50. Higher Apify plans get a Store discount.

#### Do I need an API key or login?

No. Just configure the input and run it.

#### Can I run it on a schedule or from code?

Yes. Use Apify Schedules for recurring runs, or call it from the Apify API, the JavaScript or Python client, Make, Zapier, n8n, or any MCP-compatible AI agent.

#### Why did my run return no results?

Your filters are probably too narrow. Remove a filter or broaden the search, then run again. You only pay the result price for records that are actually saved.

#### Is the data accurate and up to date?

Each run fetches live data from the source described above, so results are as current as that source. Verify critical records with the original source before acting on them.

# Actor input Schema

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

Website or sitemap URLs to parse. Use a full http(s) URL. Website URLs can be auto-discovered through robots.txt and common sitemap paths; direct sitemap.xml and sitemap index URLs are parsed as provided.

## `autoDiscover` (type: `boolean`):

Automatically find sitemaps by checking robots.txt and common sitemap paths. Disable if you're providing direct sitemap URLs.

## `maxResults` (type: `integer`):

Maximum number of output URLs across all inputs. The default 25-result run costs $0.0125 at the current $0.0005 per-result rate.

## `modifiedSince` (type: `string`):

Filter publisher-supplied, parseable lastmod dates (YYYY-MM-DD). Entries with missing or unparseable lastmod values remain included because their modification date is unknown.

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

Include image metadata declared in sitemap image extensions. This does not inspect page HTML or verify that an image is reachable.

## Actor input object example

```json
{
  "urls": [
    "https://www.apify.com/sitemap.xml"
  ],
  "autoDiscover": true,
  "maxResults": 25,
  "modifiedSince": "",
  "includeImages": false
}
```

# Actor output Schema

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

All records from this run in the default dataset, shown with the Overview table view.

# 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://www.apify.com/sitemap.xml"
    ]
};

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

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

```

## MCP server setup

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