Address cleanse
addressCleanse matches a freeform UK address to the closest address on file. It returns the match, a confidence score and a match level for each address element.
How do I clean an address?
Send the address as body.query. The match and its score sit in data.result.
import { createIdpcClient, addressCleanse } from "@ideal-postcodes/sdk";
const client = createIdpcClient({ apiKey: "ak_test" });
const { data } = await addressCleanse({
client,
body: { query: "10 Downing Street, London, SW1A 2AA" },
});
console.log(data.result.match, data.result.confidence);
What does a cleanse cost?
A cleanse that returns a match costs one lookup. A no-match costs nothing.
What confidence score should I accept?
No single threshold suits every project. Each incorrect, missing or misspelled element lowers the score, and inputs repeat the same errors within a project, so set the threshold per project. Sort a sample of results by score and note where matches turn ambiguous or wrong.
See addressCleanse for the request fields, and the API reference for the match levels.
Try it
Enter a browser API key and select Start example. Requests use your account. Do not enter a Management Key.