dataconnect / postcode-api
Postcode API client voor postcodeapi.nu v3
1.0.0
2026-05-30 11:14 UTC
Requires
- php: ^8.1
- guzzlehttp/guzzle: ^7.5
README
PHP client for postcodeapi.nu v3.
Retrieve Dutch address data (street, city, province, coordinates) based on postcode and house number.
Requirements
postcode-api requires PHP 8.1 or above.
Installation
Can be installed with Composer.
To get the latest version of postcode-api use:
composer require dataconnect/postcode-api
Example
use PostcodeApi\PostcodeApiClient;
$client = new PostcodeApiClient('your-api-key');
$response = $client->lookup('6545CA', '29');
if ($response->ok) {
echo $response->straatnaam; // Waldeck Pyrmontsingel
echo $response->plaats; // Nijmegen
echo $response->provincie; // Gelderland
echo $response->lengtegraad; // 5.858910
echo $response->breedtegraad; // 51.843765
} else {
echo $response->error; // Error message
}
// Or as array (for JSON responses):
$array = $response->toArray();
Support
Want to support our work? A donation is very welcome: https://buymeacoffee.com/dataconnect
Contact
Please feel free to contact us, to add options if possible!