Sitemap URL Extractor — All Pages, Lastmod, Images, Hreflang avatar

Sitemap URL Extractor — All Pages, Lastmod, Images, Hreflang

Pricing

from $0.24 / 1,000 url founds

Go to Apify Store
Sitemap URL Extractor — All Pages, Lastmod, Images, Hreflang

Sitemap URL Extractor — All Pages, Lastmod, Images, Hreflang

Get every URL of a website from its sitemaps: finds them in robots.txt and usual paths, follows sitemap indexes, opens .gz, reads lastmod, priority, images, hreflang and news. Filter by pattern or date. No duplicates. Failed sitemaps are free.

Pricing

from $0.24 / 1,000 url founds

Rating

0.0

(0)

Developer

DocFlow Tools

DocFlow Tools

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

a day ago

Last modified

Features

Limited permissions

Share

Get the list of URLs of a website from its XML sitemaps. Give it a domain (example.com) or a direct sitemap link. It finds the sitemaps in robots.txt or at the usual paths, follows sitemap indexes, opens .gz files and plain-text sitemaps, and returns one row per URL with lastmod, changefreq, priority, images, hreflang alternates and Google News data when the sitemap has them. You can filter by regular expression and by "modified since" date. Each URL is delivered once per run. A sitemap that fails is reported in the run summary, does not stop the run and costs nothing.

What you get

  • Sitemap discovery. For a domain, the actor reads the Sitemap: lines in robots.txt. If there are none, it tries these paths in order and uses the first one that is a valid sitemap: /sitemap.xml, /sitemap_index.xml, /sitemap-index.xml, /wp-sitemap.xml, /sitemap.xml.gz.
  • Direct sitemap links. Any input ending in .xml, .xml.gz, .gz or .txt (except robots.txt) is read as a sitemap directly.
  • Sitemap indexes are followed at any depth (up to the maxSitemaps limit).
  • Formats: XML sitemaps (with or without namespaces, with a BOM), gzip-compressed sitemaps (detected by content, not only by file name) and text sitemaps (one URL per line).
  • Per URL: lastmod, changefreq, priority, image URLs (image:image), hreflang alternates (xhtml:link), and Google News title and publication date.
  • Filters: keep URLs matching any include pattern, drop URLs matching any exclude pattern, keep only URLs whose lastmod is on or after a date.
  • No duplicates: a URL that appears in several sitemaps is delivered (and charged) once.
  • Run summary in the key-value store (SUMMARY): sitemaps read, URLs delivered, URLs filtered out, and the errors per sitemap or input.

Use cases

  • Build a full URL list of a site before an SEO audit, a migration or a content inventory.
  • Find pages changed since a date (for example, to re-index or re-check only what changed).
  • Get only one section of a site, such as /blog/ or /products/.
  • Check hreflang alternates and image entries declared in the sitemaps.
  • Feed the URL list into another Actor (crawler, screenshot tool, Markdown converter) or a spreadsheet.

How to use

  1. Open the Actor in Apify Console and click Try for free / Start.
  2. In Websites or sitemap URLs, add one or more domains or sitemap links.
  3. Optionally add Only URLs matching, Skip URLs matching or Modified since.
  4. Set Max URLs to the most URLs you want to pay for (see Pricing).
  5. Run it. Results appear in the Output tab; download them as JSON, CSV, Excel or other formats.

Input example

{
"startUrls": ["example.com", "https://www.example.org/sitemap_index.xml"],
"includePatterns": ["/blog/"],
"excludePatterns": ["\\?page="],
"modifiedSince": "2026-01-01",
"maxUrls": 5000,
"maxSitemaps": 1000
}
FieldTypeDefaultMeaning
startUrlsarray of stringsrequiredDomains or direct sitemap links (.xml, .xml.gz, .txt).
includePatternsarray of regexnoneKeep a URL if it matches at least one pattern.
excludePatternsarray of regexnoneDrop a URL if it matches any pattern.
modifiedSincedate (YYYY-MM-DD)noneKeep URLs with lastmod on or after this date. URLs without lastmod are skipped when this is set.
maxUrlsinteger50,000Stop after this many URLs are delivered.
maxSitemapsinteger1,000Maximum number of sitemap files read per run.

Patterns are Python regular expressions searched anywhere in the URL.

Output example

One dataset item per URL. Fields that are empty in the sitemap are left out of the item.

{
"url": "https://example.com/blog/how-to-start",
"lastmod": "2026-10-02T08:15:00+00:00",
"changefreq": "weekly",
"priority": 0.8,
"images": ["https://example.com/img/how-to-start.jpg"],
"alternates": [
{ "hreflang": "es", "href": "https://example.com/es/blog/como-empezar" }
],
"sitemap": "https://example.com/post-sitemap.xml",
"input": "example.com"
}

News sitemaps add newsTitle and newsPublicationDate. sitemap is the file the URL came from; input is the start entry that led to it.

The SUMMARY record in the key-value store looks like this:

{
"inputs": 2,
"sitemapsRead": 7,
"urlsOutput": 5000,
"urlsFilteredOut": 1834,
"errors": [{ "source": "https://example.org/sitemap-old.xml", "error": "Client error '404 Not Found' ..." }],
"stoppedEarly": true,
"stoppedAtSpendingLimit": false
}

If no URL is delivered, the dataset gets one free item with "status": "no_urls" and the same summary fields, so you can see why.

Pricing

Prices by Apify discount tier: the prices below are for the Bronze tier. Free plan: 50 % off. Silver: 10 % off. Gold and higher: 20 % off. Apify applies the right price automatically.

Pay per event, in USD:

EventPriceWhen
Actor start$0.00005Charged by Apify when a run starts, per GB of run memory (default memory: 512 MB)
url-found$0.0003For each URL delivered to the dataset.

Not charged: duplicate URLs, URLs removed by your filters, failed sitemaps and the no_urls status item.

Control spend with maxUrls. The default is 50,000 URLs (up to $15). Large sites can have millions of URLs, so set maxUrls to what you need. The run also stops cleanly if it reaches the maximum cost per run you set in Apify.

Examples:

  • 100 URLs: $0.00005 + 100 × $0.0003 = $0.03005
  • 10,000 URLs: $0.00005 + 10,000 × $0.0003 = $3.00005
  • A site with 80,000 URLs, includePatterns: ["/blog/"] keeps 2,500: $0.00005 + 2,500 × $0.0003 = $0.75005 (the 77,500 filtered URLs are free).

Use it from code, AI agents and integrations

Apify API (one call, returns the dataset items):

curl -X POST "https://api.apify.com/v2/acts/docflow-tools~sitemap-url-extractor-reliable/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
-H "Content-Type: application/json" \
-d '{"startUrls": ["example.com"], "maxUrls": 1000}'

Synchronous endpoints wait a limited time; for very large sites start the run asynchronously and read the dataset when it finishes.

Python (apify-client):

from apify_client import ApifyClient
client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("docflow-tools/sitemap-url-extractor-reliable").call(
run_input={"startUrls": ["example.com"], "includePatterns": ["/blog/"], "maxUrls": 1000}
)
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
print(item["url"], item.get("lastmod"))
summary = client.key_value_store(run["defaultKeyValueStoreId"]).get_record("SUMMARY")["value"]

AI agents: the Actor can be called by AI agents through the Apify MCP server at https://mcp.apify.com.

No-code: connect it to Make, Zapier, n8n and other tools through Apify integrations, or schedule it in Apify.

Limits and notes

  • Only sitemaps are read. The actor does not open or crawl the pages themselves, so it returns what the sitemaps declare. Pages missing from the sitemaps are not found.
  • robots.txt is read only to find Sitemap: lines.
  • Only http and https URLs are fetched. Domains that resolve to private, loopback, link-local or other internal addresses are blocked.
  • Sitemap URLs listed in robots.txt or in a sitemap index are followed as given, even if they are on another host.
  • Each downloaded sitemap file can be up to 100 MB; larger downloads are reported as errors.
  • Up to 8 sitemap files are downloaded in parallel; each request has a 60-second timeout.
  • maxSitemaps counts every sitemap file attempted, including those that fail.
  • The errors list in SUMMARY keeps the first 200 errors.
  • When modifiedSince is set, URLs without lastmod are skipped.

FAQ

Do I pay for duplicates or filtered URLs? No. Only URLs delivered to the dataset are charged. A URL is checked for duplicates before the filters run.

What if the site has no Sitemap: line in robots.txt? The actor tries the usual sitemap paths listed above. If none is a valid sitemap, the input is listed in errors with "no sitemap found in robots.txt or usual locations".

Can I give a sitemap index directly? Yes. Any link ending in .xml, .xml.gz, .gz or .txt is read directly, and indexes are followed.

How do I get only recently changed pages? Set modifiedSince (for example 2026-01-01). Only URLs with a lastmod on or after that date are kept.

Does one broken sitemap stop the run? No. It is listed in SUMMARY.errors and the other sitemaps continue.