New: list a postcode's addresses free
GET /v1/postcodes/{postcode}/suggestions lists a full postcode's addresses as one-line suggestions, free. Retrieving the one your customer picks is one lookup.
Summary
GET /v1/postcodes/{postcode}/suggestions lists the addresses in a full postcode as one-line suggestions, in Royal Mail delivery order, so your customer can pick theirs. Listing them is free. Retrieve the address they pick with GET /v1/addresses/{udprn}, which is one lookup.
curl -H "x-api-key: $SNAPADDRESS_KEY" https://api.snapaddress.io/v1/postcodes/SW1A2AA/suggestions{
"postcode": "SW1A 2AA",
"suggestions": [
{
"type": "address",
"postcode": "SW1A 2AA",
"summary": "Prime Minister & First Lord Of The Treasury, 10 Downing Street, LONDON, SW1A 2AA",
"address_count": 1,
"udprn": "23747771"
}
],
"count": 1,
"total": 1,
"truncated": false
}Why: it's the same flow as Loqate's Find and Retrieve, and it's how Royal Mail's PAF licence counts: a list of up to 100 one-line entries is browsing, and the full address returned for the pick is the lookup. With /v1/postcodes/{postcode} a customer who searches a postcode costs a lookup whether or not they go on to pick an address.
How it works
- Full postcodes and BFPO numbers only, in any spacing or case (
SW1A 2AA,sw1a2aa,BFPO16). A partial postcode such asSW1A 2is refused with400 postcode_requiredand isn't charged: search it with/v1/autocomplete. - Up to 100 suggestions. Every standard PAF postcode has 100 addresses or fewer, so the list is complete. If a postcode has more (Multiple Residence data only),
truncatedistrueand/v1/postcodes/{postcode}?page=Nreturns the rest, one lookup per page. - The same order as
/v1/postcodes/{postcode}, so the first 100 suggestions are the same addresses as its first page. - Free, with the same limits as autocomplete. It needs a key with a balance above zero. Free suggestions also have a per-account limit, counted in addresses returned: well above what a checkout uses, and there to stop bulk copying. Over it, you get
429 suggestion_budget_exceededwith aRetry-Afterheader. - If we can't check that limit, we refuse rather than guess:
503, not charged. Retry after a short wait. - An unknown postcode is
404 postcode_not_found, and isn't charged.
Unchanged
/v1/postcodes/{postcode} still returns full addresses at one lookup per page of 100, and /v1/autocomplete and /v1/addresses/{udprn} are unchanged. Use whichever flow suits your form.