# Sitemap URL Extractor: All Page URLs, Lastmod, Images, News (`fjordlabs/sitemap-extractor`) Actor

Get every URL a website lists in its XML sitemaps. Finds sitemaps via robots.txt, follows sitemap indexes and .gz files, and returns lastmod, changefreq, priority, images, news, video and hreflang. Filters, optional status check. Failed sitemaps are free.

- **URL**: https://apify.com/fjordlabs/sitemap-extractor.md
- **Developed by:** [Mivah](https://apify.com/fjordlabs) (community)
- **Categories:** SEO tools, Developer tools, Lead generation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.14 / 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

## Sitemap URL Extractor: All Page URLs, Lastmod, Images, News

Get **every URL a website lists in its XML sitemaps**, as a clean table: a sitemap scraper, sitemap parser and sitemap-to-CSV tool in one. Enter a domain and the Actor finds the sitemaps itself (via `robots.txt`, then common paths like `/sitemap.xml`), follows **sitemap indexes** and **`.xml.gz`** files, removes duplicates and returns one row per URL with `lastmod`, `changefreq`, `priority`, the sitemap it came from and, when present, **images, Google News, video and hreflang** data. Optionally it checks the **HTTP status** of each URL to find broken or redirected pages.

Fast and cheap: no browser, one request per sitemap file, **$0.20 per 1,000 URLs**. Failed sitemaps are free.

![Example output of Sitemap URL Extractor: a table with domain, url (path), lastmod, news.title, sitemapUrl and more](https://api.apify.com/v2/key-value-stores/bp61pnREuVYPEvqbu/records/output-sitemap-extractor)

### Who it's for

- **SEO specialists and agencies:** audit a site's sitemap, find 404s and redirects in it, compare sitemap coverage with crawled pages, check hreflang alternates.
- **Content and competitor monitoring:** "what did this competitor publish this week?" with **Modified since = 7 days**, scheduled daily, with results sent to Slack or Google Sheets.
- **Scraping pipelines:** a fast, complete list of product, article or listing URLs to feed into another scraper, filtered with regex (`/products/`, `/blog/`).
- **News and media watchers:** read Google News sitemaps (title, publication, language, date) without crawling.
- **AI agents:** a single-purpose tool over MCP: domain in, clean JSON list of URLs out.

### How it works

1. Add **websites or sitemap URLs**, one per line (`apify.com`, `https://example.com/sitemap_index.xml`, `https://example.com/sitemap.xml.gz`).
2. Optionally filter: **Only URLs matching** / **Skip URLs matching** (regex), **Modified since** (`2026-10-01` or `7 days`), and set **Max URLs**.
3. Click **Start**. Export the results as CSV, Excel or JSON, or call the Actor from the API.

Supported formats: XML `urlset` and `sitemapindex` (nested up to 4 levels), gzip, plain-text sitemaps (one URL per line), RSS and Atom feeds, and Google's image, news, video and `xhtml:link` hreflang extensions.

### Input example

```json
{
  "urls": ["apify.com", "https://www.bbc.com/sitemaps/https-index-com-news.xml"],
  "maxUrls": 100,
  "maxUrlsPerInput": 50,
  "includeRegex": [],
  "excludeRegex": ["/tag/"],
  "lastmodSince": "7 days",
  "checkStatus": false
}
```

### Output example

One row per URL:

```json
{
  "url": "https://www.allbirds.com/products/mens-wool-runners",
  "lastmod": "2026-11-07T12:24:17-08:00",
  "changefreq": "daily",
  "priority": null,
  "domain": "www.allbirds.com",
  "sitemapUrl": "https://www.allbirds.com/sitemap_products_1.xml?from=1878193471557&to=7369944137808",
  "input": "www.allbirds.com",
  "images": [
    {"url": "https://cdn.shopify.com/s/files/1/1104/4168/files/Allbirds_WL_RN_SF_PDP_Natural_Grey_LAT.png?v=1751143404",
     "title": "Men's Wool Runner - Natural Grey (Light Grey Sole)", "caption": null}
  ],
  "news": null,
  "videos": [],
  "alternates": [],
  "extractedAt": "2026-11-07T23:46:39Z"
}
```

A Google News sitemap row has `"news": {"title": "...", "publicationDate": "2026-11-07T16:53:04Z", "publicationName": "BBC Persian", "language": "fa", "keywords": null}`. Video rows list `videos[]` with `title`, `description`, `thumbnailUrl`, `contentUrl`, `playerUrl`, `durationSecs`, `publicationDate`; hreflang gives `alternates: [{"hreflang": "de", "url": "..."}]`. Turn **Include images, news, video and hreflang** off for just the core columns.

With **Check HTTP status** on, each row also gets `statusCode` (e.g. 200, 301, 404), `redirectUrl` and `statusError`.

Sitemaps that can't be read (HTTP errors, not a sitemap, blocked by `robots.txt`) and websites without any sitemap get a row with an `error` message, and **are not charged**. A run summary (URLs, sitemaps read, filtered, duplicates, errors) is saved as `SUMMARY` in the key-value store.

### Pricing

Pay only for results:

| Event | Price |
|---|---|
| Actor start | $0.00005 |
| URL extracted (one result row) | $0.0002 (**$0.20 per 1,000 URLs**) |

10,000 URLs cost about $2 (plus the tiny start fee), with no subscription. Status checks are included in the URL price. Error rows are **never charged**. Use **Max URLs** or the run's max charge to control spend; the Actor stops when the limit is reached.

### Notes and limits

- **Only what the site lists.** The Actor reads sitemaps; it doesn't crawl pages. Pages missing from a site's sitemap won't appear. If a site has no sitemap at `robots.txt` or a common path, enter its sitemap URL directly.
- **Modified since** relies on the site's own `lastmod` values, which some sites set to "now" on every page or leave out. URLs without `lastmod` are dropped when filtering by date unless you turn on **Keep URLs without lastmod**. Child sitemaps whose own `lastmod` is older than the date are skipped without downloading.
- **Polite by design:** `robots.txt` is respected (user agent `FjordlabsSitemapExtractor`; sitemaps a site advertises in its `robots.txt` are always allowed), sitemaps of one site are read one after another, and requests are retried with backoff on 429/5xx.
- Limits per run: 200 sitemap files by default (**Max sitemap files**), 60 MB per file, status checks capped by **Max status checks** (500 by default, up to 10,000; set 0 for none).
- **Very large sites:** up to about 1 million URLs fit the default 256 MB memory. For more, raise the run's memory to 1 GB.
- **Status check** sends a `HEAD` request without following redirects, so `statusCode` is what the URL itself answers (a 301 shows as 301 with `redirectUrl`). Some servers answer `HEAD` differently from a normal page view.
- If a site's `robots.txt` returns a server error, the site is treated as "disallow all" (RFC 9309) and you get a free error row; try again later or enter the sitemap URL directly.
- Sites behind strong bot protection may answer 403; those become free error rows.
- No personal data is collected: only URLs and the metadata a site publishes in its sitemaps.

### Changelog

- **2026-11-20:** Public on the Apify Store.
- **2026-11-15:** Pre-launch stress test across our Actors; clearer error messages where a run's outcome was confusing.
- **2026-11-10:** Unreachable sites get a clear "could not be reached" error instead of "no sitemap found". Invalid input now ends as a successful run with one free error row that says what to fix, instead of a failed run.

### How to use Sitemap URL Extractor

1. Add **websites or sitemap URLs**, one per line (`apify.com` finds the sitemaps via robots.txt).
2. Optionally filter with **Only URLs matching** / **Skip URLs matching** (regex) or **Modified since** (`7 days`).
3. Set **Max URLs** and click **Start**; turn on **Check HTTP status** to find 404s and redirects.
4. Export the URL list to CSV/Excel or Google Sheets, or feed it into another scraper.

### Use it from code (API)

Run it from Python with the official client (`pip install apify-client`):

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("fjordlabs/sitemap-extractor").call(run_input={'urls': ['apify.com', 'https://www.bbc.com/sitemaps/https-index-com-news.xml'], 'maxUrls': 100})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
```

Or with one HTTP call that returns the results directly:

```bash
curl -X POST "https://api.apify.com/v2/acts/fjordlabs~sitemap-extractor/run-sync-get-dataset-items?token=<YOUR_APIFY_TOKEN>" \
  -H "Content-Type: application/json" -d '{"urls": ["apify.com", "https://www.bbc.com/sitemaps/https-index-com-news.xml"], "maxUrls": 100}'
```

It also works with Make, Zapier, n8n, Google Sheets and webhooks through Apify's integrations.

### Use with AI agents (MCP)

Agents can call this Actor as a tool through Apify's MCP server (mcp.apify.com). Add `fjordlabs/sitemap-extractor` to the server's Actors. Results are clean JSON with a small default size, so they fit well in an agent's context.

### FAQ

**How does it find the sitemap?**
It reads the Sitemap lines in the site's robots.txt, then tries common paths like /sitemap.xml and /sitemap_index.xml. You can also enter any sitemap URL directly, including .xml.gz, .txt and RSS/Atom feeds.

**Does it crawl the website?**
No. It only reads the sitemaps the site publishes, so it's fast and cheap. Pages missing from the sitemap won't appear.

**How do I get only new or changed pages?**
Set Modified since to a date or a period like 7 days and schedule the Actor. It uses the site's lastmod values and skips whole sitemap files that haven't changed.

**Do I pay for sitemaps that fail?**
No. Unreadable sitemaps, sites without a sitemap and pages blocked by robots.txt become free error rows.

**Am I charged for errors?**
No. Rows that fail are never charged; you only pay for results.

### More from fjordlabs

- [Google Trends Scraper](https://apify.com/fjordlabs/google-trends)
- [Google Trends Trending Now](https://apify.com/fjordlabs/google-trending-now)
- [Google News Scraper](https://apify.com/fjordlabs/google-news)
- [Google Play Reviews & App Data Scraper](https://apify.com/fjordlabs/google-play-reviews)
- [App Store Reviews & App Data Scraper (iOS)](https://apify.com/fjordlabs/app-store-reviews)
- [Bulk PageSpeed & Core Web Vitals Audit](https://apify.com/fjordlabs/pagespeed-audit)
- [Google Autocomplete Keyword Expander](https://apify.com/fjordlabs/google-autocomplete)
- [App Store & Google Play Search Rank + Top Charts (ASO)](https://apify.com/fjordlabs/app-store-search-charts)
- [SEO & AI-Search Readiness Audit](https://apify.com/fjordlabs/seo-ai-readiness-audit)
- [Website Tech Stack Detector](https://apify.com/fjordlabs/tech-stack-detector)
- [Steam Reviews & Game Data Scraper](https://apify.com/fjordlabs/steam-reviews)
- [Chrome Web Store Extension Details Scraper](https://apify.com/fjordlabs/chrome-web-store)
- [Google Ads Transparency Center Scraper](https://apify.com/fjordlabs/google-ads-transparency)
- [Hacker News Scraper](https://apify.com/fjordlabs/hacker-news)
- [Shopify Store Products Scraper](https://apify.com/fjordlabs/shopify-products)
- [EU Public Tenders Scraper (TED)](https://apify.com/fjordlabs/eu-tenders-ted)
- [Domain Intel: WHOIS/RDAP, DNS, SSL, SPF/DMARC](https://apify.com/fjordlabs/domain-intel)
- [App Store & Google Play App Details + Developer Portfolio](https://apify.com/fjordlabs/app-details-portfolio)
- [Website Screenshot API: Full Page, Mobile, PDF](https://apify.com/fjordlabs/website-screenshot)
- [Wayback Machine Site History](https://apify.com/fjordlabs/wayback-history)

# Actor input Schema

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

Domains (apify.com), website URLs, or direct sitemap URLs (sitemap.xml, sitemap_index.xml, .xml.gz, .txt, RSS/Atom). For a website, sitemaps are found via robots.txt, then common paths like /sitemap.xml.

## `maxUrls` (type: `integer`):

Stop after this many URLs in total (after filters and de-duplication). Each URL is one result row. Up to about 1 million URLs fit the default 256 MB memory; for more, raise the run memory to 1 GB.

## `maxUrlsPerInput` (type: `integer`):

Optional cap per input, so one huge site can't use up the whole budget. 0 = no per-input cap.

## `includeRegex` (type: `array`):

Keep only URLs that match at least one of these regular expressions, e.g. /blog/ or /products/.

## `excludeRegex` (type: `array`):

Drop URLs that match any of these regular expressions, e.g. /tag/ or ?page=.

## `lastmodSince` (type: `string`):

Keep only URLs whose lastmod is on or after this date: YYYY-MM-DD, or a period like '7 days', '24 hours', '3 months'. Child sitemaps whose own lastmod is older are skipped entirely.

## `includeUrlsWithoutLastmod` (type: `boolean`):

Only used with 'Modified since'. Many sitemaps omit lastmod; by default such URLs are dropped when you filter by date.

## `includeExtensions` (type: `boolean`):

Adds images\[], news{}, videos\[] and alternates\[] (hreflang) from Google's sitemap extensions when present.

## `checkStatus` (type: `boolean`):

Sends one light HEAD request per URL (no page download) and adds statusCode and redirectUrl. Finds broken (404) and redirected URLs in your sitemap. Off by default; slower.

## `maxStatusChecks` (type: `integer`):

Upper limit on status checks per run. URLs beyond it get statusError 'maxStatusChecks reached'.

## `maxSitemaps` (type: `integer`):

Upper limit on sitemap files downloaded per run (indexes included).

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

How many inputs are processed at the same time. Sitemaps of one site are read one after another.

## `requestTimeoutSecs` (type: `integer`):

Timeout per HTTP request. Large sitemaps can take a while.

## Actor input object example

```json
{
  "urls": [
    "apify.com",
    "https://www.bbc.com/sitemaps/https-index-com-news.xml"
  ],
  "maxUrls": 100,
  "maxUrlsPerInput": 50,
  "includeUrlsWithoutLastmod": false,
  "includeExtensions": true,
  "checkStatus": false,
  "maxStatusChecks": 500,
  "maxSitemaps": 200,
  "maxConcurrency": 3,
  "requestTimeoutSecs": 30
}
```

# Actor output Schema

## `results` (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 = {
    "urls": [
        "apify.com",
        "https://www.bbc.com/sitemaps/https-index-com-news.xml"
    ],
    "maxUrls": 100,
    "maxUrlsPerInput": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("fjordlabs/sitemap-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": [
        "apify.com",
        "https://www.bbc.com/sitemaps/https-index-com-news.xml",
    ],
    "maxUrls": 100,
    "maxUrlsPerInput": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("fjordlabs/sitemap-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": [
    "apify.com",
    "https://www.bbc.com/sitemaps/https-index-com-news.xml"
  ],
  "maxUrls": 100,
  "maxUrlsPerInput": 50
}' |
apify call fjordlabs/sitemap-extractor --silent --output-dataset

```

## MCP server setup

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