PHP SDK
ideal-postcodes/sdk is our PHP SDK for the Ideal Postcodes API. It has one typed method for every API operation, sends requests through the PSR-18 HTTP client already in your project and runs on PHP 8.2 or later. A Symfony bundle and a Laravel package wire it into each framework.
Details
- Every operation: Postcode lookup, address search and autocomplete, UPRN lookup, address cleanse, places, email and phone validation, plus key, licensee and configuration management
- Any HTTP client: Guzzle, Symfony HttpClient or any other PSR-18 client, found by
php-http/discovery. There is no bundled transport to configure - Typed responses: Every response is a read-only object generated from the OpenAPI spec, and each dataset's native record has its own class, from
PafAddresstoUspsAddress - Static analysis friendly: Parameters are PHPStan array shapes and enums are literal types, so a misspelt argument fails analysis before the code runs
- Typed errors: An HTTP error throws
ApiException, with the HTTP status fromgetStatusCode()and the API error code fromgetCode() - Symfony bundle:
ideal-postcodes/symfony-bundleconfigures your keys once and injects the client into your services. Symfony 6.4, 7 or 8 - Laravel package:
ideal-postcodes/laravelreads your keys from.envand provides the client through the container or anIdealPostcodesfacade. Laravel 12 or 13 - Agent skill:
npx skills add ideal-postcodes/skillsgives coding agents theideal-postcodes-php-sdkskill
Install with composer require ideal-postcodes/sdk, then start with the PHP SDK documentation.