Download the PHP package ammaar23/postcodes-io-sdk without Composer
On this page you can find all versions of the php package ammaar23/postcodes-io-sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ammaar23/postcodes-io-sdk
More information about ammaar23/postcodes-io-sdk
Files in ammaar23/postcodes-io-sdk
Package postcodes-io-sdk
Short Description A simple PHP sdk for Postcodes.io
License MIT
Homepage https://github.com/ammaar23/postcodes-io-sdk
Informations about the package postcodes-io-sdk
Postcodes.io PHP SDK

A simple PHP sdk for Postcodes.io
Install
Install using composer:
Documentation
Basic Usage Example
You can catch specific
Ammaar23\Postcodes\PostcodeException
and/or catch general\Exception
to catch any type.
Add/Modify Configuration Parameters
You can look at Guzzle HTTP Request Options to find out the availabe options.
Methods
Lookup a postcode
Returns a single postcode entity for a given postcode (case, space insensitive).
Bulk lookup postcodes
Returns a list of matching postcodes and respective available data.
$attributes
(not required) is an array attributes to be returned in the result object(s).
Reverse Geocoding
Returns nearest postcodes for a given longitude and latitude.
limit
(not required) Limits number of postcodes matches to return. Defaults to 10. Needs to be less than 100.radius
(not required) Limits number of postcodes matches to return. Defaults to 100m. Needs to be less than 2,000m.
Bulk Reverse Geocoding
Bulk translates geolocations into Postcodes.
- Maximum of 100 geolocations per request.
$attributes
(not required) is an array attributes to be returned in the result object(s).$wideSearch
(not required) Search up to 20km radius, but subject to a maximum of 10 results.
Random Postcode
Returns a random postcode and all available data for that postcode.
outcode
(not required) Filters random postcodes by outcode. Returns null if invalid outcode.
Validate a postcode
Convenience method to validate a postcode.
Validate a postcode format
Convenience method to validate a postcode format.
validateFormat
validates the format only where asvalidate
check's if it exists in the Postcodes.io database or not.
Nearest postcodes for postcode
Returns nearest postcodes for a given postcode.
limit
(not required) Limits number of postcodes matches to return. Defaults to 10. Needs to be less than 100.radius
(not required) Limits number of postcodes matches to return. Defaults to 100m. Needs to be less than 2,000m.
Autocomplete a postcode partial
Convenience method to return an list of matching postcodes.
limit
(not required) Limits number of postcodes matches to return. Defaults to 10. Needs to be less than 100.
Query for postcode
Submit a postcode query and receive a complete list of postcode matches and all associated postcode data. The result set can either be empty or populated with up to 100 postcode entities.
limit
(not required) Limits number of postcodes matches to return. Defaults to 10. Needs to be less than 100.
Testing
OR with coverage:
License
MIT License © 2019 – Ammaar Latif