# Sitemap Url Extractor (`scraperoka/sitemap-url-extractor`) Actor

🔎 Sitemap Url Extractor extracts all URLs from sitemaps for faster SEO auditing and indexing. 🚀 Discover crawlable pages, validate structure, and streamline content discovery for faster rankings and smarter link building.

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

## Pricing

from $1.99 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#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 ⚡

Manually collecting site URLs can waste hours you could spend analyzing coverage and planning campaigns. **Sitemap URL Extractor** quickly pulls all URLs from a sitemap (including sitemap indexes) so you can build a clean URL list in one go. **Sitemap URL Extractor** helps marketers, SEOs, and researchers extract URLs from sitemap XML files and turn them into an actionable dataset—at scale, often in minutes, even for large sites.

***

### What You Get: Sample Output

Here's a sample record from a single run:

```json
{
  "url": "https://onescales.com/blog/how-to-grow",
  "lastmod": "2025-05-20",
  "changefreq": "weekly",
  "error_message": null
}
```

Below is what the actor outputs to the dataset for each discovered URL:

| Field | Type | What It Tells You |
|---|---|---|
| `url` | string | The extracted page URL you can crawl, audit, or import into a tool |
| `lastmod` | string | null | The “last modified” date from the sitemap (useful for freshness checks) |
| `changefreq` | string | The sitemap’s change frequency (defaults to `weekly` when not present) |
| `error_message` | null | string | Error details when something goes wrong for a record/run |

Export your dataset as JSON, CSV, or Excel — straight from the Apify dashboard.

***

### Why Sitemap URL Extractor?

There are a lot of ways to generate URL lists—here’s what sets **Sitemap URL Extractor** apart.

#### XML sitemap index support

It detects whether the root file is a sitemap index or a direct URL list, and it can follow sitemap indexes to process sub-sitemaps. This makes it a true sitemap URL mining tool for sites that split sitemaps across multiple files.

#### Clean, structured URL list output

Instead of raw XML, you get a straightforward dataset with `url`, `lastmod`, and `changefreq`. This makes Sitemap URL Extractor ideal for a sitemap link extraction tool workflow where you want usable fields right away.

#### Resilient extraction for real-world sitemaps

The actor fetches and parses sitemap XML and includes built-in resilience so runs continue when possible. That means fewer “dead ends” when a sitemap is incomplete or has unexpected formatting.

#### Residential proxy support for reliability

Sitemap URL Extractor is designed to work with residential proxy support, helping keep scraping reliable when fetching sitemap content at scale. This is especially helpful when you’re running bulk extract URLs from sitemap jobs.

***

### Configuring Your Run

Drop this into your `input.json` to get started:

```json
{
  "root_sitemap_url": "https://onescales.com/sitemap.xml"
}
```

| Parameter | Required | What It Does |
|---|---|---|
| `root_sitemap_url` | ✅ | The URL of the sitemap or sitemap index to start with |

***

### Core Capabilities

#### Extract URLs from urlset and sitemap indexes

Sitemap URL Extractor handles both direct URL sets and sitemap indexes. If the root is an index, it fetches sub-sitemaps and continues extracting URLs—perfect for extracting sitemap links across complex site structures.

#### Real-time dataset writing

As the actor parses sitemap XML, it pushes results as it collects them. This gives you an always-growing dataset while the Sitemap URL Extractor is still running.

#### Output-ready fields for analysis and crawling

Every extracted record includes `url`, `lastmod`, and `changefreq`. If a `changefreq` value is missing, it uses a default of `weekly`, which keeps your dataset consistent when you run sitemap XML to URL list workflows.

#### Built-in parsing for standard sitemap namespaces

The actor parses sitemap XML using standard sitemap URL schema handling, so it can correctly pull `loc`, `lastmod`, and `changefreq` values from sitemap content. This makes it a practical sitemap XML to URL list extraction tool for SEO sitemap URL scrapers.

#### Designed for automation at scale

Because results are written into an Apify dataset and the actor supports proxy configuration, it’s straightforward to run repeatedly for auditing, migrations, and ongoing coverage monitoring. For bulk extract URLs from sitemap tasks, it’s built to keep your process efficient.

***

### Who Gets the Most Out of This

Here's how different teams put Sitemap URL Extractor to work:

**SEO and content teams** — They use this sitemap URL parser to quickly generate a URL list for audits, internal linking planning, and coverage checks. The `lastmod` and `changefreq` fields make it easier to prioritize pages during reviews.

**Marketing analysts** — They generate URL lists from sitemap URL mining tool outputs to support funnel research, landing page inventories, and campaign planning. A structured URL dataset saves time versus manual collection.

**Technical SEO researchers** — They use extract all URLs from sitemap outputs to validate index coverage and track site structure changes over time. The sitemap index URL extractor behavior is especially useful on large sites with multiple sitemap files.

**Developer and automation specialists** — They integrate Sitemap URL Extractor into pipelines that need a sitemap link extraction tool step. Because the actor saves results to a dataset with consistent fields, it fits neatly into scheduled crawls and reporting jobs.

***

### Step-by-Step: How to Use It

No coding needed. Here's how to run Sitemap URL Extractor from start to finish:

1. **Open the actor on Apify** — go to [console.apify.com](https://console.apify.com) and open the Sitemap URL Extractor actor page.
2. **Enter your input** — set `root_sitemap_url` to the sitemap (or sitemap index) URL you want to extract.
3. **Configure proxy settings** — if prompted, enable proxy support for more reliable runs on larger sites.
4. **Hit Run and watch the live log** — monitor the extraction progress and see when the actor starts parsing urlsets or sitemap indexes.
5. **View results in the dataset tab** — your extracted URLs appear as the actor pushes results to the dataset.
6. **Export as JSON, CSV, or Excel** — download the dataset in the format that matches your workflow.

The whole process takes under 5 minutes to set up.

***

### Integrations & Export Options

Once your data is collected, Sitemap URL Extractor plugs directly into your existing workflow.

You can export your dataset as **JSON, CSV, or Excel** directly from the Apify dashboard (from the dataset tab). For structured datasets like sitemap XML to URL list outputs, that makes it easy to move into spreadsheets, BI tools, or internal systems.

You can also use Apify’s ecosystem to connect results to your workflow via the **Apify API** (see [apify.com/docs/api](https://apify.com/docs/api)), and you can automate downstream actions using tools like **Zapier** or **Make**. For details on scheduled runs and integrations, check the Apify docs.

***

### Pricing & Free Trial

Sitemap URL Extractor runs on the Apify platform, which offers a **free tier** — no credit card required to get started. That free tier includes platform credits intended for trying out actors and validating outputs before scaling.

For bigger extractions, you’ll use pay-as-you-go compute pricing on Apify’s platform. For exact plan and credit details, refer to the Apify pricing page. Start for free at [apify.com](https://apify.com) and scale when you're ready.

***

### Reliability & Performance

| What We Handle | How |
|---|---|
| Sitemap URL extraction completeness | Supports both direct urlsets and sitemap indexes |
| Proxy-based reliability | Designed to work with residential proxy support for fetching sitemap content |
| Error handling | Logs errors and continues where possible; failures are reflected in dataset behavior |
| Consistent dataset structure | Outputs `url`, `lastmod`, and `changefreq` with a default for missing `changefreq` |
| Real-time availability | Results are saved as they are collected during the run |

Limitations: Sitemap URL Extractor can only extract what’s present in the sitemap XML files you provide. If a sitemap is missing, misconfigured, or empty, there may be few or no results to extract.

For enterprise-scale runs, contact us to discuss custom configurations.

***

### Frequently Asked Questions

#### Is there a free plan or trial?

Yes. Apify provides a free tier with platform credits so you can run Sitemap URL Extractor and validate results before scaling.

#### Do I need to log in to use this?

No. You only need the `root_sitemap_url` to start extracting URLs from the sitemap XML content.

#### How accurate is the data?

The output accuracy depends on the sitemap content itself. The actor extracts `loc` URLs plus `lastmod` and `changefreq` values from the provided sitemap XML.

#### How many results can I get per run?

You can extract as many URLs as are present in the sitemap(s) you provide, including sitemap indexes that reference sub-sitemaps. Practical limits are determined by Apify platform run constraints and your chosen run configuration.

#### How often is the data updated / how fresh is it?

Freshness depends on when the sitemap XML was generated and updated by the website you’re extracting from. Sitemap URL Extractor reads the sitemap at run time, so it reflects the sitemap’s current state.

#### Is this legal? Does it comply with GDPR / CCPA?

Sitemap URL Extractor works with **publicly available data** found in sitemap XML files. It’s your responsibility to ensure your use complies with GDPR, CCPA, and any applicable platform terms or local regulations.

#### Can I export results to Google Sheets or Excel?

Yes. You can export from the Apify dataset tab in formats like CSV and Excel. You can also connect to Google Sheets via Apify integrations and automation tools, depending on your setup.

#### Can I run this on a schedule automatically?

Yes. You can run actors on scheduled runs using Apify scheduling features so Sitemap URL Extractor can re-extract URL lists regularly.

#### Can I access this via API?

Yes. You can trigger runs and retrieve results programmatically via the Apify API (see [apify.com/docs/api](https://apify.com/docs/api)).

#### What happens if the actor hits an error?

If the actor fails to fetch the root sitemap or encounters parsing issues, it logs errors and the run may complete with fewer results. The dataset captures what was successfully extracted during the run.

***

### Need Help or Have a Request?

Got a question about Sitemap URL Extractor or want a new feature added? Reach out at <dataforleads@gmail.com>. We’re happy to help with setup questions, and we actively consider feature requests like enhanced exports and webhook notifications on completion.

***

### Disclaimer & Responsible Use

*Sitemap URL Extractor is the fastest, most reliable way to generate a clean URL list from sitemap XML — start your free run today.*

This actor extracts **publicly available data** from sitemap XML files. It does not access private accounts, login-gated content, or password-protected pages. You are responsible for GDPR, CCPA, and applicable platform terms compliance. For data-removal requests, contact <dataforleads@gmail.com>. Use responsibly, ethically, and only for lawful purposes.

# Actor input Schema

## `root_sitemap_url` (type: `string`):

The URL of the sitemap or sitemap index to start with.

## Actor input object example

```json
{
  "root_sitemap_url": "https://onescales.com/sitemap.xml"
}
```

# 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 = {
    "root_sitemap_url": "https://onescales.com/sitemap.xml"
};

// Run the Actor and wait for it to finish
const run = await client.actor("scraperoka/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 = { "root_sitemap_url": "https://onescales.com/sitemap.xml" }

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

```

## MCP server setup

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