Website Sitemap URL Inventory Extractor avatar

Website Sitemap URL Inventory Extractor

Pricing

from $0.49 / 1,000 results

Go to Apify Store
Website Sitemap URL Inventory Extractor

Website Sitemap URL Inventory Extractor

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.

Pricing

from $0.49 / 1,000 results

Rating

0.0

(0)

Developer

Nimbryxo-studio

Nimbryxo-studio

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

2 hours ago

Last modified

Features

Limited permissions

Share

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:

FieldMeaning
urlThe page URL declared by the sitemap or feed, resolved to an absolute http(s) URL.
lastmodThe publisher's raw last-modified value, unchanged.
lastmodIsoThe same value normalised to UTC ISO 8601 when it can be parsed.
changefreqThe publisher's change-frequency hint, when declared.
priorityThe publisher's priority hint as a number, when declared.
hostHostname of the page URL.
sourceThe sitemap or feed file that declared this URL.
sourceTypeurlset, txt, rss or atom.
sitemapDepthHow many index levels deep the source sitemap was; 0 for a supplied file.
sourceSitemapLastmodThe lastmod on this sitemap's entry in its parent index, when present.
titleItem title for RSS/Atom feed rows.
imagesImage sitemap entries: loc, title, caption, license, geoLocation.
videosVideo sitemap entries. See the field list below.
newsGoogle News entries: title, publicationName, language, publicationDate, genres, keywords, stockTickers.
alternateshreflang links: hreflang, href, including x-default.
mobiletrue when the URL entry carries a mobile sitemap marker.
scrapedAtWhen 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

FieldTypeDefaultDescription
startUrlsarray-Sitemap, sitemap index, .xml.gz, .txt, RSS/Atom feed, robots.txt, bare domain or homepage URLs. Required.
discoverSitemapsbooleantrueFind sitemaps from robots.txt, the homepage sitemap link, common paths, and RSS/Atom autodiscovery links when a site URL is supplied.
followSitemapIndexesbooleantrueFetch and merge the child sitemaps listed in a sitemap index.
maxSitemapDepthinteger5Maximum sitemap-index depth to follow (0–10).
maxSitemapsinteger1000Maximum sitemap files to attempt per run (1–10,000).
maxUrlsinteger0Maximum URL rows to emit; 0 means unlimited. Filtered and duplicate URLs do not count.
lastmodAfterstring-Keep URLs dated on or after this point. Accepts ISO dates/timestamps and windows such as 7 days, 24 hours, 2 weeks.
keepUrlsWithoutLastmodbooleanfalseKeep undated URLs when a date filter is active.
urlFilterIncludestring-Keep only URLs matching this pattern.
urlFilterExcludestring-Drop URLs matching this pattern, after the include filter.
urlMatchModestringregexregex, text or glob for both URL filters.
sameHostOnlybooleanfalseDrop URLs whose host differs from the host of your input URLs.
deduplicateUrlsbooleantrueEmit each URL once even when several sitemaps list it.
includeImagesbooleantrueInclude image sitemap metadata.
includeVideosbooleantrueInclude video sitemap metadata.
includeNewsbooleantrueInclude Google News metadata.
includeAlternatesbooleantrueInclude 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

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

Discover the sitemaps from a bare domain

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

Only pages changed in the last week

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

Product URLs only, using a wildcard filter

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

RSS or Atom feed as a sitemap

{
"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.