A .NET CLI tool for finding all zip codes within a specified distance (as crow flies) from a given address in Denmark.
- .NET 10.0 SDK or later.
git clone https://github.com/simontjell/ReachableZipCode.git
cd ReachableZipCode
Before using the CLI, you need to download the Danish zip code data:
./scripts/download-zip-codes.sh
This will download the latest zip code data from the Danish Address, Real Property and Land Register (DAR) API and save it to the data/zipcodes.json
file.
Build the entire solution:
dotnet build
Navigate to the CLI project folder and run the application:
cd src/ReachableZipCodeCli
dotnet run -- "Randersvej 13" -m 10 -z 8200
- Street Address (required): The starting address to search from
- -z, --zipcode (required): The zip code for the starting address
- -m, --max-distance (required): Maximum distance in kilometers (default: 10.0)
Find all zip codes within 10 kilometers of "Randersvej 13" in Aarhus (8200):
dotnet run -- "Randersvej 13" -m 10 -z 8200
This will output a list of zip codes and their corresponding city names that are within 10 kilometers of the specified address.

To run the test suite:
dotnet test
src/ReachableZipCode/
- Core library with calculation logicsrc/ReachableZipCodeCli/
- Command-line interfacetst/ReachableZipCode.Tests/
- Unit testsscripts/
- Data download scriptsdata/
- Downloaded zip code data
This tool uses zip code data from the Klimadatastyrelsen via https://dataforsyningen.dk/.