# XML Sitemap Scraper | Export URLs to JSON (`micro-tool-factory/sitemap-urls`) Actor

Extract URLs from public XML sitemaps and sitemap indexes into JSON or CSV, including lastmod where available. Bounded traversal for SEO inventory; no site-wide crawling or HTTP status checks.

- **URL**: https://apify.com/micro-tool-factory/sitemap-urls.md
- **Developed by:** [Micro Tool Factory](https://apify.com/micro-tool-factory) (community)
- **Categories:** Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.08 / 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.

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 URL Exporter — Public Data to JSON

**Export public XML sitemap page URLs, timestamps and priorities with bounded index traversal.** Use this lightweight Apify Actor when you need reliable JSON-shaped data from a known public source, without setting up an external scraper server.

**Designed for:** SEO teams, migration planners and data pipeline builders.

**Try a ready-made example:** [Open this Actor's public Example Task](https://apify.com/micro-tool-factory/sitemap-urls/examples/mtf-export-sitemap-urls) to start with a three-result input, without writing JSON. You can adjust the source and limits before running. Review the **Pricing** tab first; usage is not necessarily free.

### Quick preview: what you get

Inventory publicly exposed XML sitemap URLs and last-modified fields for SEO audits and migrations; this is not a crawler or page-status checker.

**Small example input (3 results):**

```json
{
  "sources": [
    "https://www.djangoproject.com/sitemap.xml"
  ],
  "maxTotalItems": 3,
  "maxItemsPerSource": 3
}
```

**Illustrative output, not a live result:**

```json
{
  "status": "ok",
  "url": "https://example.org/page",
  "sitemap": "https://example.org/sitemap.xml",
  "lastmod": null,
  "priority": null
}
```

Run with the example in the **Input** tab, then inspect **Output**. If the public source is unavailable or blocks access, you will receive an error rather than fabricated data.

### What can you do with it?

Map existing public pages before SEO audits, site migration and targeted crawling. Configure a recurring Apify schedule, integrate its dataset into existing automations, or fetch results via the Apify API. The Actor produces one structured dataset item per successful record, enabling easy import into spreadsheets or downstream services.

It uses public HTTPS requests and a lightweight Python parser — no browser, residential proxy, login, or external paid AI provider. Data is returned as the source provides it; the Actor does not fabricate missing fields.

### Quick start — no coding required

1. Open the **Input** tab and add the public source URL or identifier.
2. Set **Max results** to 3 for a small first test.
3. Click **Start** and inspect the **Output** tab.
4. Export the resulting dataset as JSON or CSV, or use the API and scheduling options in your Apify account.

#### Output fields

url, lastmod, priority, changefreq, sitemap. Each row additionally contains `status` and `input`, so downstream automation can trace where a record came from.

### Limits and source coverage

**XML urlsets and sitemap indexes only. The source URL must be public HTTPS. Up to 12 sitemap files, two index levels and 2 MB uncompressed per sitemap; no page status check or hidden URLs.** Supported requests use HTTPS only. Each run accepts up to 15 input sources, 40 upstream HTTP requests, 2 MB per upstream response and 250 successful output records. One source's error is reported as an error row rather than silently ignored.

This is a **public-data extractor**, not an account bypass, private-data service or full-site crawler. If a provider blocks, changes or rate-limits its public endpoint, its data may not be available. Follow the source's terms and applicable data-use requirements.

### How much does it cost?

The live **Pricing** tab shows the current charges for this Actor. Where Pay Per Event is enabled, the `result-item` event is for a **successful record**. Do not assume that attempted, blocked or missing results become paid records. Always consult the active Pricing tab before using this Actor at scale. For a safe pilot, start with 3 results and set a **maximum run charge** where available. If platform usage is charged separately, the Pricing tab will disclose it.

We do **not** claim a guaranteed 50% discount, unlimited results, 100% uptime, or that every source is accessible. If this Actor is not yet publicly listed, its price and features remain under review.

### Troubleshooting and support

**Empty data or a source error?** Check that the URL directly returns an XML sitemap. Redirects, private hosts and inaccessible indexes are not supported. Try the smallest possible input and verify the public endpoint independently.

**Can I schedule it?** Yes. Apify provides scheduling, datasets, monitoring and integration options for your Actor runs.

**Will I get results from private accounts?** No. There is no account login or credential input, and inaccessible sources cannot be bypassed.

**Need help or found a bug?** Use the **Issues** tab of this Actor with a public reproducible example. Do not post passwords, API tokens or private data. Issues help us improve parsing reliability and document provider-specific limitations.

***

*Micro Tool Factory — purpose-built public-data utilities. This description reflects implemented capabilities, not invented testimonials or guaranteed customer outcomes.*

# Actor input Schema

## `sources` (type: `array`):

Public HTTPS XML sitemap URL such as https://www.djangoproject.com/sitemap.xml, or a domain whose /sitemap.xml is public. Up to 15 sources per run. Use public information only.

## `maxTotalItems` (type: `integer`):

Maximum number of successful records returned across all sources (1–250).

## `maxItemsPerSource` (type: `integer`):

Maximum number of successful records retrieved from each input. Some upstream APIs impose tighter limits.

## Actor input object example

```json
{
  "sources": [
    "https://www.djangoproject.com/sitemap.xml"
  ],
  "maxTotalItems": 100,
  "maxItemsPerSource": 30
}
```

# Actor output Schema

## `results` (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 = {
    "sources": [
        "https://www.djangoproject.com/sitemap.xml"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("micro-tool-factory/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 = { "sources": ["https://www.djangoproject.com/sitemap.xml"] }

# Run the Actor and wait for it to finish
run = client.actor("micro-tool-factory/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 '{
  "sources": [
    "https://www.djangoproject.com/sitemap.xml"
  ]
}' |
apify call micro-tool-factory/sitemap-urls --silent --output-dataset

```

## MCP server setup

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