Sitemap Extractor
Pricing
Pay per usage
Sitemap Extractor
Extracts and parses XML sitemaps from websites. Handles sitemap indexes, image sitemaps, robots.txt discovery, and outputs structured URL data for SEO audits, content inventories, and site migrations.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Luck Vergouwen
Maintained by CommunityActor stats
0
Bookmarked
2
Total users
1
Monthly active users
4 days ago
Last modified
Categories
Features
Share
Extract every URL from any website's XML sitemaps — including sitemap indexes, image sitemaps, and deeply nested sitemap trees. Built for SEO teams, content auditors, and site migration engineers who need a clean, structured inventory of all indexed pages.
What it does
For each input URL, the actor:
- Fetches
robots.txtand reads allSitemap:directives. - Falls back to probing common sitemap paths (
/sitemap.xml,/sitemap_index.xml,/wp-sitemap.xml, and others) ifrobots.txtyields nothing. - Detects sitemap index files and recursively fetches all child sitemaps.
- Parses each
<urlset>sitemap and extracts:loc,lastmod,changefreq,priority. - Optionally extracts image URLs from image sitemaps (
image:loc). - Outputs one dataset record per domain.
Gzipped sitemaps (.xml.gz) are detected and skipped with a note in the errors array — they require a decompression library not bundled in this lightweight actor.
Input
{// Required. One or more website or direct sitemap URLs."urls": ["https://example.com", "https://another-site.com/sitemap.xml"],// Optional. Extract image URLs from image sitemaps. Default: false."includeImages": false,// Optional. Maximum URLs to collect per domain. 0 = unlimited. Default: 50000."maxUrls": 50000}
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
urls | string[] | Yes | — | Root domain URLs or direct sitemap paths |
includeImages | boolean | No | false | Include image:loc entries in output |
maxUrls | integer | No | 50000 | Per-domain URL cap (0 = unlimited) |
You can pass either a root domain (https://example.com) or a direct sitemap URL (https://example.com/sitemap.xml). The actor handles both.
Output
One dataset record per input domain:
{"domain": "example.com","inputUrl": "https://example.com","sitemapUrls": ["https://example.com/sitemap_index.xml","https://example.com/sitemap-posts.xml","https://example.com/sitemap-pages.xml"],"totalUrls": 1842,"urls": [{"loc": "https://example.com/blog/post-1","lastmod": "2024-11-01","changefreq": "weekly","priority": "0.8","images": ["https://example.com/img/hero.jpg"] // only if includeImages: true}// ... more entries],"errors": [],"scannedAt": "2024-11-18T12:34:56.789Z"}
| Field | Type | Description |
|---|---|---|
domain | string | Hostname extracted from the input URL |
inputUrl | string | Original URL as provided in input |
sitemapUrls | string[] | All sitemap files fetched (root + child sitemaps) |
totalUrls | integer | Count of URL entries in the urls array |
urls | object[] | Extracted URL entries (see below) |
errors | string[] | Non-fatal errors encountered during extraction |
scannedAt | string | ISO 8601 timestamp when extraction ran |
URL entry fields
| Field | Type | Description |
|---|---|---|
loc | string | The page URL (always present) |
lastmod | string|null | Last modified date as declared in the sitemap |
changefreq | string|null | Change frequency hint (daily, weekly, etc.) |
priority | string|null | Priority score between 0.0 and 1.0 |
images | string[]|undefined | Image URLs (only present when includeImages: true) |
Common use cases
SEO audit
Run against your domain to get a full picture of what Google is being told to crawl. Cross-reference with your analytics to find pages that are sitemapped but receive no traffic, or pages that rank but are missing from the sitemap.
Content inventory
Export the dataset to CSV (via the Apify console) and sort by lastmod to find stale content. Filter by URL patterns to categorise content types (blog posts vs. product pages vs. landing pages).
Site migration
Run the actor before and after a migration. Compare the two URL lists to verify that all URLs have been properly redirected and that no pages were accidentally dropped from the new sitemap.
Competitor research
Input a competitor's domain to get a rough inventory of their content structure and publishing cadence (via lastmod and changefreq values).
Limitations
- Gzipped sitemaps (
.xml.gz) are detected and skipped. A note is added to theerrorsarray for each skipped sitemap. - Non-standard XML that is heavily malformed may not parse correctly. Standard WordPress, Yoast, Rank Math, and Google-generated sitemaps are fully supported.
- JavaScript-rendered sitemaps are not supported — the actor fetches raw HTTP responses only.
- Password-protected or IP-restricted sitemaps will return a non-200 status and be reported in
errors.
Pricing
This actor uses per-event charging. You are charged $0.01 per domain processed, regardless of how many sitemaps or URLs are extracted. There is no charge for failed domains where no sitemaps could be found.
Technical details
- Runtime: Node.js 22 on
apify/actor-node:22(lightweight, no browser) - XML parsing: regex-based (no external parser dependency)
- Dependencies:
apifySDK only - Memory: 128 MB minimum, 256 MB recommended for large sites (100k+ URLs)
- Timeout: 30 seconds per HTTP request; actors run with Apify's default run timeout