eddypouw/geodata-postal-api

Geodata postal API to find Dutch addresses

1.0.2 2017-05-08 20:08 UTC

This package is not auto-updated.

Last update: 2024-12-22 04:17:02 UTC


README

PHP client to find Dutch addresses based on postal code and house number.

This library is based on the open geodata from https://nationaalgeoregister.nl.

Build Status

Usage

Install the latest version via composer:

php composer.phar require eddypouw/geodata-postal-api

Example:

<?php
require_once('vendor/autoload.php');

$client      = new \GuzzleHttp\Client(['base_uri' => 'https://geodata.nationaalgeoregister.nl/geocoder/Geocoder']);
$geodata_api = new \Eddypouw\GeodataPostalApi\GeodataAddressRepository($client);

$response = $geodata_api->findByPostal('1509AW', 7);

print $response->getStreet() . ' ' . $response->getHouseNumber() . "\n";
print $response->getPostalCode() . ' ' . $response->getMunicipality() . "\n";

Requirements

PHP 7.0.x or above.

License

This library is licensed under the MIT License - see the LICENSE file for details.