# Sitemap Extractor - All Sitemap URLs, Lastmod & Status Codes (`uianalize/sitemap-url-extractor`) Actor

Sitemap extractor and sitemap URL scraper: every URL from robots.txt, sitemap indexes and .gz sitemaps, with lastmod, hreflang and images. Optional 404/redirect status check and 'modified since' filter for new pages. Pay per URL.

- **URL**: https://apify.com/uianalize/sitemap-url-extractor.md
- **Developed by:** [Webstack Data](https://apify.com/uianalize) (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.30 / 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 Extractor - All URLs, Lastmod & Status Codes

Give it a website and get **every URL listed in its sitemaps**, one clean row per URL, with `lastmod`, `changefreq`, `priority`, `hreflang` alternates and image count. Built by **Webstack Data**.

- **Automatic discovery:** reads `robots.txt` `Sitemap:` lines, then `/sitemap.xml`, `/sitemap_index.xml` and `/wp-sitemap.xml`.
- **Follows sitemap indexes** to any depth, and reads gzipped (`.xml.gz`) and plain-text sitemaps.
- **"Modified since" filter:** only return pages added or updated after a date. Use it to monitor competitors' new pages or to feed a scraper with fresh URLs only.
- **Optional status check:** request each URL and get the HTTP status, redirect target and response time. This finds 404s and redirects that should not be in your sitemap.
- No browser and no proxy. It is fast and cheap.

### Use cases

- **SEO audits:** compare the sitemap with what is indexed, and find broken or redirected URLs inside the sitemap.
- **Scraping pipelines:** get the full list of product or article URLs before you scrape them.
- **Competitor monitoring:** run it weekly with `modifiedSince` to see new pages, products or blog posts.
- **Migrations:** export every URL of the old site to build the redirect map.

### Input

```json
{
  "startUrls": ["example.com", "https://shop.example.com/sitemap_products_1.xml"],
  "maxUrlsPerSite": 10000,
  "modifiedSince": "2026-10-01",
  "checkStatusCodes": false
}
```

### Output

One row per URL:

```json
{
  "type": "url",
  "site": "https://example.com",
  "sitemap": "https://example.com/post-sitemap.xml",
  "url": "https://example.com/blog/hello-world/",
  "lastmod": "2026-10-05T09:12:00+00:00",
  "changefreq": "weekly",
  "priority": 0.8,
  "alternates": [{ "hreflang": "es", "href": "https://example.com/es/blog/hola/" }],
  "imageCount": 2,
  "statusCode": 200,
  "redirectTo": null,
  "responseTimeMs": 143
}
```

`statusCode`, `redirectTo` and `responseTimeMs` appear only when **Check HTTP status** is on. Each site also gets one `site-summary` row with the number of URLs and sitemaps, any sitemaps that failed, and `NO_SITEMAP_FOUND` if the site has none.

### Pricing

Pay per event, no subscription:

- **$0.00005** per run start
- **$0.0003 per URL extracted** ($0.30 per 1,000 URLs)
- **$0.0006 per URL extracted and status-checked** ($0.60 per 1,000), only when the status check is on

Sites without a sitemap cost nothing beyond the start fee. Set a maximum cost per run in Apify and the Actor stops cleanly when it is reached.

### API and automation

```bash
curl -X POST "https://api.apify.com/v2/acts/uianalize~sitemap-url-extractor/run-sync-get-dataset-items?token=YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": ["example.com"], "modifiedSince": "2026-10-01"}'
```

Templates and tutorials: [github.com/uunnaaiii/webstack-data](https://github.com/uunnaaiii/webstack-data).

### Other Webstack Data Actors

- [SEO Audit Crawler](https://apify.com/uianalize/seo-audit-crawler): on-page SEO audit with a site score.
- [Broken Link Checker](https://apify.com/uianalize/broken-link-checker): find broken links across whole websites.
- [Tech Stack Detector](https://apify.com/uianalize/tech-stack-detector): which CMS, ecommerce platform and analytics a site uses.
- [Domain Availability Checker](https://apify.com/uianalize/domain-availability-checker): bulk domain availability with registrar and expiry dates.

# Actor input Schema

## `startUrls` (type: `array`):

Websites (example.com) or direct sitemap URLs (https://example.com/sitemap.xml). For websites, sitemaps are discovered from robots.txt and the usual locations.

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

Stop after this many URLs for each site.

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

Optional date (YYYY-MM-DD). Only URLs whose sitemap lastmod is on or after this date are returned. Useful to monitor new or updated pages.

## `checkStatusCodes` (type: `boolean`):

Also request every URL (HEAD, GET fallback) and return status code, redirect target and response time. Finds 404s and redirects listed in your sitemap.

## `maxConcurrency` (type: `integer`):

Parallel requests when checking status codes.

## `timeoutSecs` (type: `integer`):

Timeout for each sitemap or URL request.

## Actor input object example

```json
{
  "startUrls": [
    "apify.com"
  ],
  "maxUrlsPerSite": 10000,
  "checkStatusCodes": false,
  "maxConcurrency": 10,
  "timeoutSecs": 20
}
```

# 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 = {
    "startUrls": [
        "apify.com"
    ]
};

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

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

```

## MCP server setup

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