elifuzz / postcode-nl
PHP wrapper for the Postcode.nl Dutch address verification API
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 2
Type:project
Requires
- php: ^7.2.5
- ext-json: *
- guzzlehttp/guzzle: 6.5.2
Requires (Dev)
- friendsofphp/php-cs-fixer: 2.16.1
- phpunit/phpunit: 8.5.2
This package is auto-updated.
Last update: 2024-11-19 23:10:35 UTC
README
Postcode.nl PHP API REST Client
A PHP wrapper, which offers methods to directly talk with the Postcode.nl API.
Installation
- Create an account: Postcode.nl API
- Add library to your project
- Instantiate the PHP class with your authentication details
- Call the
lookupAddress
method
Usage
try { $client = new RestApi\RestClient('{your key}', '{your secret}'); $address = $client->lookupAddress('{postcode}', '{houseNumber}', '{houseNumberAddition}'); var_dump($address); } catch (RestApi\Exception\AddressNotFoundException $e) { die($e->getMessage()); } catch (RestApi\Exception\InputInvalidException $e) { die($e->getMessage()); } catch (RestApi\Exception\AuthenticationException $e) { die($e->getMessage()); } catch (RestApi\Exception\ServiceException $e) { die($e->getMessage()); }