I did not like the documentation of the Amsterdam Data API, and I wanted to make a script that would be easy to use for a personal project of mine.
AddressUtil.py is a Python script that retrieves geographical information based on Dutch postcodes or street names using the PDOK Locatieserver API and the Amsterdam Data API. It provides the corresponding "gebied" (neighborhood) in Amsterdam for the given input.
- Accepts both postcodes and street names as input.
- Retrieves area information from the PDOK Locatieserver API.
- Fetches detailed data from the Amsterdam Data API.
- Ensure you have Python installed on your machine.
- Install the required packages using pip:
pip install requests
- Run the script:
python AddressUtil.py
- When prompted, enter a Dutch postcode or street name:
Please enter the address (ideally just the postcode): 1103JT - The script will output the corresponding area:
The gebied for postcode 1103JT is: [Area Name]
- The script handles various errors, including:
- Invalid input (empty postcode or street name).
- API query errors.
- No data found for the given input.
Yes, no problem.
Thanks to PDOK for the Locatieserver API and the Amsterdam gemeente for the Amsterdam Data API.