Home / Use cases / Convert a Sitemap.xml to CSV

Updated

Convert a Sitemap.xml to CSV (All URLs with lastmod)

A sitemap is XML, often split into an index and several child files (sometimes gzipped). For an SEO audit, a migration or a content inventory you want one flat table.

Try it now on Apify Sitemap URL Extractor: All URLs, lastmod, hreflang · $0.0001 per one url returned in the dataset · failed items are free

How to do it, step by step

  1. Enter the website in Sites (the sitemap is found from robots.txt or the usual paths), or the sitemap URL itself in Sitemap URLs.
  2. Set Max URLs per site.
  3. Run, then export the dataset as CSV or Excel.
  4. Filter on sitemap to see which child file each URL came from.

The exact input used for the example below:

{
  "sites": [
    "www.postgresql.org"
  ],
  "maxUrlsPerSite": 50
}

Real result

Run nzDtStDO5qxqd0QBr on 2026-12-05: status SUCCEEDED, 50 item(s), 2.6 s of run time. Output shortened for reading (long text cut with “…”).

50 URLs returned from 1 sitemap file(s) (sitemap.xml); 0 carry a lastmod date.

[
  {
    "url": "https://www.postgresql.org/",
    "lastmod": null,
    "changefreq": null,
    "priority": null,
    "alternates": [],
    "sitemap": "https://www.postgresql.org/sitemap.xml"
  },
  {
    "url": "https://www.postgresql.org/community/",
    "lastmod": null,
    "changefreq": null,
    "priority": null,
    "alternates": [],
    "sitemap": "https://www.postgresql.org/sitemap.xml"
  },
  {
    "url": "https://www.postgresql.org/support/versioning/",
    "lastmod": null,
    "changefreq": null,
    "priority": null,
    "alternates": [],
    "sitemap": "https://www.postgresql.org/sitemap.xml"
  }
]

Try it now with your own input

FAQ

What if the site has no sitemap?

The site row says NO_SITEMAP_FOUND with the paths tried; nothing is charged.

Gzipped sitemaps?

Yes, .xml.gz files are decompressed automatically.

Does it crawl pages that are not in the sitemap?

No, it reads sitemaps only; that is what makes it fast and cheap.

Related