petelawrence/getaddress

There is no license information available for the latest version (0.3.1) of this package.

A PHP library for the getaddress.io postcode lookup service

0.3.1 2017-09-12 09:34 UTC

This package is not auto-updated.

Last update: 2024-04-27 15:10:01 UTC


README

A PHP library for the getaddress.io postcode lookup service

Pre-requisites

You will require a getaddress.io API key. For low use applications (fewer than 20 lookups/day) this is free.

Usage

$client = new \petelawrence\getaddress\GetAddressClient('YOUR-GETADDRESS.IO-KEY');
$result = $client->lookup('NR10 4JJ');
$address0 = $result->getAddresses()[0];
echo $address0->getTown();

Tests

GETADDRESSKEY=YOUR-GETADDRESS.IO-KEY vendor/bin/phpunit tests/