# Website Sitemap URL Inventory Extractor (`nimbryxo-studio/website-sitemap-url-inventory-extractor`) Actor

Turn any website's sitemap, sitemap index or bare domain into a flat list of every declared URL with its last-modified date, priority, and image, video or language metadata.

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

## Pricing

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

## Website Sitemap URL Inventory Extractor

A website that wants search engines to index its pages publishes an XML sitemap, and often a sitemap index, an image sitemap, a video sitemap, a Google News sitemap, a text sitemap or an RSS/Atom feed. This actor reads those public files and turns them into one flat dataset row per URL, with the publisher's own dates and hints intact.

It is an inventory tool, not a crawler: it reads only the sitemap files, never the pages they list, so it stays fast, light and free of cookies, logins or proxy setup.

### What this actor does

- Reads XML sitemaps, sitemap indexes, gzip files, plain-text sitemaps and RSS/Atom feeds.
- Accepts a direct sitemap, index, `.xml.gz`, `.txt`, feed or `robots.txt` URL, a bare domain, or a homepage.
- Finds sitemaps from `robots.txt` `Sitemap:` lines, the homepage `<link rel="sitemap">` hint, and the usual sitemap paths. When no sitemap is advertised, it also follows RSS/Atom autodiscovery links from the homepage.
- Follows nested sitemap indexes with a user-controlled depth and file budget, and uses index `lastmod` values to skip stale branches when a date filter is on.
- Parses sitemaps with or without an XML namespace, and sitemaps that declare an old or non-standard xhtml namespace.
- Carries through `lastmod`, `changefreq` and `priority` whenever the publisher provides them, plus a normalised `lastmodIso`.
- Extracts the full Google image, video, Google News and hreflang annotations, including `x-default`.
- Removes duplicate URLs across overlapping sitemaps, and can filter by date, host, or a regex/plain-text/wildcard URL pattern.
- Omits every field the sitemap did not provide; there are no empty strings, nulls, empty arrays or empty objects in a row.
- Emits a single `sitemap_error` status row when nothing could be read, so an empty run is never silent.

### Output

Each dataset row describes one URL:

| Field | Meaning |
|---|---|
| `url` | The page URL declared by the sitemap or feed, resolved to an absolute http(s) URL. |
| `lastmod` | The publisher's raw last-modified value, unchanged. |
| `lastmodIso` | The same value normalised to UTC ISO 8601 when it can be parsed. |
| `changefreq` | The publisher's change-frequency hint, when declared. |
| `priority` | The publisher's priority hint as a number, when declared. |
| `host` | Hostname of the page URL. |
| `source` | The sitemap or feed file that declared this URL. |
| `sourceType` | `urlset`, `txt`, `rss` or `atom`. |
| `sitemapDepth` | How many index levels deep the source sitemap was; `0` for a supplied file. |
| `sourceSitemapLastmod` | The `lastmod` on this sitemap's entry in its parent index, when present. |
| `title` | Item title for RSS/Atom feed rows. |
| `images` | Image sitemap entries: `loc`, `title`, `caption`, `license`, `geoLocation`. |
| `videos` | Video sitemap entries. See the field list below. |
| `news` | Google News entries: `title`, `publicationName`, `language`, `publicationDate`, `genres`, `keywords`, `stockTickers`. |
| `alternates` | hreflang links: `hreflang`, `href`, including `x-default`. |
| `mobile` | `true` when the URL entry carries a mobile sitemap marker. |
| `scrapedAt` | When this run extracted the row. |

Video entries carry `title`, `description`, `thumbnail`, `contentUrl`, `playerUrl`, `durationSeconds`, `publicationDate`, `expirationDate`, `rating`, `viewCount`, `familyFriendly`, `tags`, `categories`, `galleryUrl`, `uploader`, `platforms`, `restrictions`, `requiresSubscription` and `live` when the sitemap declares them.

If no URL can be extracted, the dataset contains one row with `type: "sitemap_error"`, a `reason`, a plain-language `message`, the requested URLs, the sitemap URLs visited and, when applicable, the failed ones.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `startUrls` | array | - | Sitemap, sitemap index, `.xml.gz`, `.txt`, RSS/Atom feed, `robots.txt`, bare domain or homepage URLs. Required. |
| `discoverSitemaps` | boolean | `true` | Find sitemaps from robots.txt, the homepage sitemap link, common paths, and RSS/Atom autodiscovery links when a site URL is supplied. |
| `followSitemapIndexes` | boolean | `true` | Fetch and merge the child sitemaps listed in a sitemap index. |
| `maxSitemapDepth` | integer | `5` | Maximum sitemap-index depth to follow (0–10). |
| `maxSitemaps` | integer | `1000` | Maximum sitemap files to attempt per run (1–10,000). |
| `maxUrls` | integer | `0` | Maximum URL rows to emit; 0 means unlimited. Filtered and duplicate URLs do not count. |
| `lastmodAfter` | string | - | Keep URLs dated on or after this point. Accepts ISO dates/timestamps and windows such as `7 days`, `24 hours`, `2 weeks`. |
| `keepUrlsWithoutLastmod` | boolean | `false` | Keep undated URLs when a date filter is active. |
| `urlFilterInclude` | string | - | Keep only URLs matching this pattern. |
| `urlFilterExclude` | string | - | Drop URLs matching this pattern, after the include filter. |
| `urlMatchMode` | string | `regex` | `regex`, `text` or `glob` for both URL filters. |
| `sameHostOnly` | boolean | `false` | Drop URLs whose host differs from the host of your input URLs. |
| `deduplicateUrls` | boolean | `true` | Emit each URL once even when several sitemaps list it. |
| `includeImages` | boolean | `true` | Include image sitemap metadata. |
| `includeVideos` | boolean | `true` | Include video sitemap metadata. |
| `includeNews` | boolean | `true` | Include Google News metadata. |
| `includeAlternates` | boolean | `true` | Include hreflang alternates. |

`urlMatchMode=regex` uses Python regular expressions, case-insensitively. `text` matches a literal substring. `glob` uses `*` for any characters except `/`, `**` for any characters including `/`, and `?` for one character.

### Examples

#### Read a known sitemap index

```json
{
  "startUrls": ["https://example.com/sitemap_index.xml"],
  "maxUrls": 5000
}
```

#### Discover the sitemaps from a bare domain

```json
{
  "startUrls": ["example.com"],
  "discoverSitemaps": true,
  "deduplicateUrls": true
}
```

#### Only pages changed in the last week

```json
{
  "startUrls": ["https://example.com/sitemap.xml"],
  "lastmodAfter": "7 days",
  "includeAlternates": false,
  "includeImages": false
}
```

#### Product URLs only, using a wildcard filter

```json
{
  "startUrls": ["https://example.com/sitemap.xml"],
  "urlMatchMode": "glob",
  "urlFilterInclude": "**/products/**",
  "urlFilterExclude": "**/products/tag/**"
}
```

#### RSS or Atom feed as a sitemap

```json
{
  "startUrls": ["https://example.com/feed.xml", "https://example.com/sitemap.txt"],
  "maxUrls": 2000
}
```

### Limits and honest notes

- The sitemap protocol asks publishers to keep each file at or below 50,000 URLs and 50 MB uncompressed. This is a publisher limit, not an actor truncation: the actor reads larger files and only refuses a single fetched file above 100 MB as a safety guard.
- `maxUrls` defaults to `0`, which means no total-row limit. You can set a cap up to 1,000,000. The actor attempts at most 10,000 sitemap files (default 1,000) and follows at most 10 index levels (default 5); these two are hard actor caps.
- A date filter uses `lastmod`, then the feed date, then a news publication date. When none is readable, the URL counts as undated and is dropped unless `keepUrlsWithoutLastmod` is on. With a date filter, a child sitemap whose own entry in the parent index is older than the cutoff is skipped for speed; turn on `keepUrlsWithoutLastmod` to fetch every child anyway. An invalid date window is logged and ignored rather than failing the run.
- `changefreq` and `priority` are the publisher's hints. Search engines may ignore them; this actor does not invent or recalculate them.
- A sitemap can be incomplete. Pages that the site owner did not include in a sitemap cannot appear here.
- Some sites block sitemap requests from automated clients (a 403 challenge or a captcha) or return an HTML page at the sitemap URL. Those paths fail softly and are logged; check the site in a browser and pass the exact file if you know it.
- This actor does not check the HTTP status, canonical tag or indexing status of the pages it lists, and does not remember URLs between runs. Use a dedicated link checker for status checks and a scheduler plus your own storage for new-URL monitoring.
- The actor does not use a proxy or cookies. If a site blocks the request, the block is a site-side limitation, not a missing setting.

### FAQ

**Do I need a proxy, login or API key?**
No. Sitemaps are public files meant for search engines. The actor reads them over plain HTTPS without cookies or credentials.

**What if I do not know the sitemap URL?**
Pass the domain or homepage. The actor reads `robots.txt`, the homepage's `<link rel="sitemap">` hint, common sitemap paths, and—when no sitemap is advertised—the homepage's RSS/Atom autodiscovery links. If the site blocks those probes, pass the exact sitemap or feed URL.

**Which formats are supported?**
XML urlsets, sitemap indexes, gzip files (detected by content, not by the `.gz` suffix), plain-text sitemaps, RSS 2.0, RSS 1.0/RDF and Atom feeds.

**Are nested sitemap indexes followed?**
Yes, up to `maxSitemapDepth`. Set it to 0 or turn off `followSitemapIndexes` to read only the files you supplied.

**Why is `lastmod` or `priority` missing on some rows?**
Both are optional in the sitemap standard. The field is omitted rather than padded with a placeholder.

**Why do I also see `lastmodIso`?**
`lastmod` is exactly what the publisher wrote, while `lastmodIso` is the same moment in UTC ISO 8601 for sorting and joins. It is present only when the value can be parsed.

**Does it extract image, video, news and hreflang data?**
Yes, when the sitemap carries those extensions. Each toggle can turn a block off to keep the dataset smaller. hreflang is read even from old or non-standard xhtml namespaces.

**Does it follow the page URLs?**
No. It reads only the sitemap files, which keeps runs cheap and avoids touching the target site's pages.

**What happens when a site has no sitemap?**
The run emits one `sitemap_error` row explaining that no URLs were extracted. A site without a published sitemap cannot be inventoried this way.

# Actor input Schema

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

One or more URLs. Accepts a sitemap, sitemap index, .xml.gz file, sitemap.txt, RSS/Atom feed, robots.txt URL, bare domain (example.com) or homepage. With discovery on, site URLs are resolved through robots.txt, the homepage's sitemap link and common sitemap paths.

## `discoverSitemaps` (type: `boolean`):

When the input is a domain or homepage, read robots.txt, the homepage <link rel="sitemap"> hint, common sitemap paths and—when no sitemap is advertised—the homepage's RSS/Atom autodiscovery links. Turn off to read only the exact URLs you supplied.

## `followSitemapIndexes` (type: `boolean`):

When a sitemap index points to child sitemaps, fetch and merge them. Turn off to read only the sitemap files you supplied and stop at any index.

## `maxSitemapDepth` (type: `integer`):

How many levels of nested sitemap indexes to follow. 0 reads only the supplied sitemaps, 1 follows one index level, and so on.

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

Stop after attempting this many sitemap files (indexes and child sitemaps both count). Protects very large sitemap trees such as newspaper archives.

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

Total URL rows to emit across all inputs. Set to 0 for no limit. Filtered and duplicate URLs do not count toward this cap.

## `lastmodAfter` (type: `string`):

Keep URLs whose lastmod, feed date or news publication date is on or after this point. Use an ISO date (2026-01-01), a full timestamp, or a relative window such as "7 days", "24 hours" or "2 weeks". Leave blank to keep every URL.

## `keepUrlsWithoutLastmod` (type: `boolean`):

When a date filter is set, also keep URLs and feed items that carry no usable date. Without this, undated entries are dropped by the date filter.

## `urlFilterInclude` (type: `string`):

Keep only URLs that match this pattern. Interpretation depends on URL match mode: a regular expression, a plain-text substring, or a wildcard pattern. Leave blank to keep every URL.

## `urlFilterExclude` (type: `string`):

Drop URLs that match this pattern, applied after the include filter. Uses the same URL match mode.

## `urlMatchMode` (type: `string`):

How the include and exclude filters are interpreted. Regular expressions are case-insensitive. Plain text matches a literal substring. Wildcards use \* for any characters except /, \*\* for any characters including /, and ? for one character.

## `sameHostOnly` (type: `boolean`):

Drop URLs whose hostname differs from the host of your input URLs. Useful when a sitemap includes CDN or alternate-domain pages you do not want.

## `deduplicateUrls` (type: `boolean`):

Emit each page URL once even when it appears in several sitemaps. Turn off to keep one row per sitemap listing.

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

Add the image sitemap entries attached to a URL (location, title, caption, license, geo location).

## `includeVideos` (type: `boolean`):

Add the video sitemap entries attached to a URL, including thumbnail, player/content URLs, duration, dates, tags, categories, ratings, restrictions and live status.

## `includeNews` (type: `boolean`):

Add the Google News entries attached to a URL: publication name and language, publication date, headline, genres, keywords and stock tickers.

## `includeAlternates` (type: `boolean`):

Add the xhtml:link hreflang alternates attached to a URL, including x-default, even when the sitemap uses a legacy xhtml namespace.

## Actor input object example

```json
{
  "startUrls": [
    "https://onescales.com/sitemap.xml"
  ],
  "discoverSitemaps": true,
  "followSitemapIndexes": true,
  "maxSitemapDepth": 5,
  "maxSitemaps": 1000,
  "maxUrls": 500,
  "keepUrlsWithoutLastmod": false,
  "urlMatchMode": "regex",
  "sameHostOnly": false,
  "deduplicateUrls": true,
  "includeImages": true,
  "includeVideos": true,
  "includeNews": true,
  "includeAlternates": true
}
```

# Actor output Schema

## `urls` (type: `string`):

Dataset containing one row per URL extracted from the supplied sitemaps, indexes, text sitemaps or feeds.

# 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": [
        "https://onescales.com/sitemap.xml"
    ],
    "discoverSitemaps": true,
    "followSitemapIndexes": true,
    "maxSitemapDepth": 5,
    "maxSitemaps": 1000,
    "maxUrls": 500,
    "keepUrlsWithoutLastmod": false,
    "urlMatchMode": "regex",
    "sameHostOnly": false,
    "deduplicateUrls": true,
    "includeImages": true,
    "includeVideos": true,
    "includeNews": true,
    "includeAlternates": true
};

// Run the Actor and wait for it to finish
const run = await client.actor("nimbryxo-studio/website-sitemap-url-inventory-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": ["https://onescales.com/sitemap.xml"],
    "discoverSitemaps": True,
    "followSitemapIndexes": True,
    "maxSitemapDepth": 5,
    "maxSitemaps": 1000,
    "maxUrls": 500,
    "keepUrlsWithoutLastmod": False,
    "urlMatchMode": "regex",
    "sameHostOnly": False,
    "deduplicateUrls": True,
    "includeImages": True,
    "includeVideos": True,
    "includeNews": True,
    "includeAlternates": True,
}

# Run the Actor and wait for it to finish
run = client.actor("nimbryxo-studio/website-sitemap-url-inventory-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": [
    "https://onescales.com/sitemap.xml"
  ],
  "discoverSitemaps": true,
  "followSitemapIndexes": true,
  "maxSitemapDepth": 5,
  "maxSitemaps": 1000,
  "maxUrls": 500,
  "keepUrlsWithoutLastmod": false,
  "urlMatchMode": "regex",
  "sameHostOnly": false,
  "deduplicateUrls": true,
  "includeImages": true,
  "includeVideos": true,
  "includeNews": true,
  "includeAlternates": true
}' |
apify call nimbryxo-studio/website-sitemap-url-inventory-extractor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nimbryxo-studio/website-sitemap-url-inventory-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/YC5cBkA5b3MUz3iaH/builds/02aZv7M1d156algH4/openapi.json
