Skip to main content

resolveAddress

Resolve Address

Returns the complete address for an autocomplete suggestion, identified by its address ID.

This is the step of the autocomplete flow that costs a lookup. Fetching suggestions is free.

The API returns resolved addresses, including addresses outside the UK, in a UK format (up to 3 address lines) using UK nomenclature such as postcode and county.

An ID that matches no address returns 404.

Endpoint​

GET /autocomplete/addresses/{address}/gbr

See the API reference for this endpoint.

Import​

import { resolveAddress } from "@ideal-postcodes/sdk";

Path Parameters​

NameTypeRequiredDescription
addressstringyesID of address suggestion ID of address suggestion provided by the API to fully resolve.

Query Parameters​

NameTypeRequiredDescription
api_keystringnoAPI Key Your unique identifier that allows access to our APIs. Begins ak_. Available from your dashboard.
tagsstringnoTags A comma separated list of tags to query over. Useful if you want to specify the circumstances in which the request was made. If you specify multiple tags, the response comprises only requests that satisfy all of them. Searching "foo,bar" queries only requests tagged both "foo" and "bar".

Response Type​

import type { ResolveAddressResponse } from "@ideal-postcodes/sdk";

Errors​

HTTP errors throw an ApiError with the HTTP status and the API error code and message. Network failures and aborts reject with the runtime's native error. Pass throwOnError: false to get { data, error } instead. See error handling.

Example​

resolve-address.tsts
import { createIdpcClient, resolveAddress } from "@ideal-postcodes/sdk";

export const example = async () => {
const client = createIdpcClient({ apiKey: "ak_test" });
const { data } = await resolveAddress({
client,
path: { address: "paf_18524336" },
});
return data;
};