Welcome to the Dutch Postcode API written in go! This API provides a simple and efficient way to retrieve location information based on Dutch postcodes. Whether you're building a location-based application or need to enhance your data with geographical details, this API has got you covered.
- Accurate Data: Utilizes up-to-date Dutch postcode data from "Basisregistratie Adressen en Gebouwen (BAG)".
- Easy Integration: Simple RESTful API design for easy integration into your applications.
- SQLite Database Export: Easily extract addresses as an SQLite database from the Docker container.
- Compact Image Size: The Docker image is optimized for efficiency, with a small size of only 364.96 MB.
- Run the docker container
docker run -p 80:80 ghcr.io/maantje/postcode:latest
-
Wait for the database to be extracted
-
done!
GET /postcode/{postcode}/{house_number}
Replace {postcode} and {house_number} with the desired postcode and house number.
curl -X GET https://localhost/postcode/9743EG/258
{
"postcode": "9743EG",
"house_number": 258,
"municipality": "Groningen",
"city": "Groningen",
"street_name": "Goudlaan",
"short_street_name": "",
"long_street_name": "Goudlaan",
"area": 124.0,
"usage": "woonfunctie",
"built_in": 1970,
"latitude": 53.2312990867121,
"longitude": 6.528704482471
}
The Docker image includes an SQLite database containing all Dutch addresses. Follow these steps to extract the database after starting the container.
- Identify the container ID:
docker ps
- Extract the SQLite database:
docker cp {CONTAINER ID}:/application/database/addresses.sqlite addresses.sqlite
You now have the addresses.sqlite file containing all Dutch addresses in your current directory.
Special thanks to @digitaldutch for their contribution to https://github.com/digitaldutch/BAG_parser, which makes this repository possible.