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.
Clean an address
Send the address as body.query. The match and its score sit in data.result.
address-cleanse.tsts
import { createIdpcClient, addressCleanse } from "@ideal-postcodes/sdk";
const client = createIdpcClient({ apiKey: "ak_test" });
const { data } = await addressCleanse({
client,
body: { query: "9 Malyons Road, Swanley, BR8 7RE" },
});
console.log(data.result.match, data.result.confidence);
Cost
A cleanse that returns a match costs one lookup. A no-match costs nothing.
Confidence threshold
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
Select Cleanse to run the cleanse. Edit the address in the code to try another.
Loading...