# Postcode App: Dutch address validation API and widget Validate Dutch addresses by postal code plus house number and auto-fill the street and city for the person filling in your form. ## Data source We use the [PDOK Locatieserver](https://www.pdok.nl/pdok-locatieserver), the free and open geocoding service from the Dutch Land Registry (Kadaster). This is open data and the source of truth for Dutch addresses. Because the data comes straight from Kadaster, a postal code plus house number resolves to exactly one official address. ## API usage Call the API with a postal code and house number in the path. The postal code accepts both `1234AB` and `1234 AB`. ```bash curl "https://api.cloud-captains.com/postcode/1234AB/56" ``` Response: ```json { "postcode": "1234AB", "huisnummer": 56, "straat": "Voorbeeldstraat", "plaats": "Amsterdam", "gemeente": "Amsterdam", "provincie": "Noord-Holland", "geo": { "lat": 52.3676, "lng": 4.9041 } } ``` When no address matches the combination, the API returns HTTP `404` with an empty body, so you can show a clear validation error in your form. ## Widget embed The widget is the fastest way to add validation without writing any request code yourself. Add the script once, then drop the element next to your address form. ```html
``` :::howto title="Add the widget to a form" 1. Add the `widget.js` `