AutoPostcode returns JSON over HTTPS, so calling it from PHP is a simple cURL or Guzzle request. Keep your key in server configuration and never expose it to the browser.
The pattern
- Store your API key in environment or framework config
- Send an authenticated GET with cURL, Guzzle or wp_remote_get
- json_decode the response and map fields to your model
- Cache common postcodes to reduce repeat calls
Where to start
Read API authentication & keys and the API quickstart. WordPress users can also use our plugin install guide.
Other stacks
Building in JavaScript? See Node.js and React address autocomplete.
Frequently asked questions
How do I call the postcode lookup API from PHP?
Send an authenticated HTTPS GET with cURL or Guzzle to the lookup endpoint, then json_decode the response to get a list of PAF-verified addresses.
Does it work with Laravel and WordPress?
Yes — use Laravel's HTTP client, Guzzle, or wp_remote_get in WordPress, keeping your API key in server config.
Where does the address data come from?
Addresses come from Royal Mail PAF data — complete, accurate and correctly formatted.
Ready to get started?
Add Royal Mail PAF-verified UK address lookup to your site in minutes — start free, no card required.
