Cookie

Cookie consent

We use some essential cookies to make this website work. We'd like to set additional cookies to help us measure your experience when you view and interact with the website.

Cookie policy

Sample code for address lookup

This page provides sample code to help you set up Postcoder address lookup.

You'll need an API key to make these examples work. Not got an API key? Sign up for a free trial.

Create a global address finder with JavaScript

These JavaScript examples are designed to help you add Postcoder address lookup to your website, without the need to write your own code from scratch.

Address autocomplete

This example displays real-time suggestions as the user types in their address or postcode, and populates an address form with the selected address. It uses the autocomplete/find endpoint for the suggestions and the autocomplete/retrieve endpoint to retrieve the selected address. All countries are supported.

Address and postcode lookup

This example displays a list of addresses that match the postcode or address entered by the user after they click the Find button, and populates an address form with the selected address. It uses the address endpoint and supports all countries.

Implement address lookup in other languages

These examples show how to make a request to the address endpoint to look up an address.