Sitemap to JSON — sitemap.xml to structured URL list
Under maintenancePricing
Pay per usage
Sitemap to JSON — sitemap.xml to structured URL list
Under maintenanceParse sitemap.xml and sitemap indexes into structured JSON or CSV: url, lastmod, changefreq, priority. Follows sitemap indexes one level deep, zero parsing dependencies, no API keys. Great for SEO audits, crawl seeding, content inventories and site migrations.
Pricing
Pay per usage
Rating
0.0
(0)
Developer
Tang
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
12 days ago
Last modified
Categories
Features
Share
Sitemap to JSON / CSV
Parse sitemap.xml and sitemap indexes into structured data. Zero parsing dependencies: Node http/https + regex XML parsing (only runtime dependency is the Apify platform SDK).
Output
json mode — one dataset record per URL
{"sitemapUrl": "https://example.com/sitemap.xml","url": "https://example.com/page-1","lastmod": "2026-11-01","changefreq": "daily","priority": "0.8"}
csv mode — one record per sitemap
{"sitemapUrl": "https://example.com/sitemap.xml","urlCount": 123,"csv": "url,lastmod,changefreq,priority\r\n\"https://...\",2026-11-01,daily,0.8","fetchedAt": "..."}
CSV follows RFC4180 (quotes fields containing comma/quote/newline; rows end with \r\n).
Input
| Field | Type | Default | Description |
|---|---|---|---|
sitemapUrls | array of strings | — (required) | Sitemap or sitemap-index URLs (local path / file:// works locally) |
maxUrls | integer | 500 | Total URL entries to output (1–50000) |
outputMode | json / csv | json | Per-URL records or per-sitemap CSV |
Behavior
- Sitemap index recursion is one level deep (index → child sitemaps; child indexes are not followed again).
- Supports gzip (Content-Encoding or
.gzextension) and follows up to 5 HTTP redirects. - Missing
lastmod/changefreq/priorityare returned asnull. - Per-source failures are logged; other sitemaps continue. In csv mode a failed source returns
{ sitemapUrl, error }. maxUrlscaps the total emitted across all sitemaps; child sitemaps stop being fetched once the cap is reached.
Local run
npm installmkdir -p storage/key_value_stores/defaultecho '{"sitemapUrls":["https://example.com/sitemap.xml"],"maxUrls":50}' > storage/key_value_stores/default/INPUT.jsonnode src/main.js# results: storage/datasets/default/*.json
Verified locally with a fixture sitemap index (2 child sitemaps, 5 URLs) in both json and csv modes.
Limitations
- Not a crawler: it only reads sitemaps, it does not fetch the listed pages.
- Text-layer only: no rendering, no JS, no link discovery outside sitemaps.
- Very large sitemaps are capped by
maxUrlsand 50 child sitemaps per index. - Compressed sitemaps inside a
.tar.gzbundle are not supported (plain.xml.gzis).
Platform notes
.actor/actor.json:actorSpecification: 1,version: "0.0", input/readme copies inside.actor/.package.jsonmain/start=src/main.js; only dependency isapify.- Dockerfile:
node:22-slim+npm ci --omit=dev+CMD node src/main.js. - When creating the Actor, pass source file contents as plain text, not base64.