Skip to main content

Retrieve Additional Data

We can also pull in more data from the Postcode Address File by passing more arguments into the outputFields object.

In this instance, we pull location, organisation name (if any) and the Unique Delivery Point Reference Number.

You can access the full list of available datapoints.

Try a postcode with lots of local businesses like NW1 0BG.

 
PostcodeLookup.setup({
apiKey: "ak_test",
context: "#lookup_field",
removeOrganisation: true,
outputFields: {
line_1: "#first_line",
line_2: "#second_line",
line_3: "#third_line",
post_town: "#post_town",
postcode: "#postcode",
organisation_name: "#organisation_name",
longitude: "#longitude",
latitude: "#latitude",
uprn: "#uprn"
},
});

Live Demo

Loading...