A simple CLI tool to fetch, parse, and convert website sitemaps to CSV.
Simple. No setup. No dependencies.
Download a binary and put it to PATH.
For example, on Linux.
sudo curl -L -o /usr/local/bin/sitemap2csv $(curl --silent "https://api.github.com/repos/etsxxx/go-sitemap2csv/releases/latest" | jq --arg PLATFORM_ARCH "$(echo `uname -s`-`uname -m` | tr A-Z a-z)" -r '.assets[] | select(.name | endswith($PLATFORM_ARCH)) | .browser_download_url')
sudo chmod 755 /usr/local/bin/sitemap2csvA full list of binaries are here.
sitemap2csv <sitemap_url> <output_csv_file>You get a CSV file like the following. The first record is a header row with "loc" and "lastmod". "lastmod" is empty if there is no lastmod value.
loc,lastmod
https://example.com/foo,
https://example.com/bar,2025-05-22T01:02:03.000Z
https://example.com/baz,
If you don't need header row, add '-no-header' option.
sitemap2csv -no-header <sitemap_url> <output_csv_file>With '-no-header' option, you get a CSV file like the following.
https://example.com/foo,
https://example.com/bar,2025-05-22T01:02:03.000Z
https://example.com/baz,
First, fork this repo, and get your clone locally.
- Install go
- Install
make - Install golangci-lint
Write code and remove unused modules.
make tidy
To test, run
make lint
make test
To build, run
make build