SnapAddress is launching soon. Join the waitlist for early access and 20% off your first credit pack. Join waitlist →

Response Format

Stable

Detailed breakdown of the SnapAddress API response object and address fields.

Top-level response

Every successful response from the /v1/postcodes/{postcode} endpoint returns a JSON object with these fields:

FieldTypeDescription
postcodestringThe postcode in its correctly formatted form (e.g. "SW1A 2AA")
addressesarrayArray of address objects at this postcode
countnumberTotal number of addresses at this postcode (across all pages)
pagenumberCurrent page number (starts at 1)
limitnumberAddresses per page (default and maximum 100)

Example:

{
  "postcode": "SW1A 2AA",
  "count": 1,
  "page": 1,
  "limit": 100,
  "addresses": [...]
}

Address object

Each entry in the addresses array is a structured object with the following fields:

FieldTypeDescription
line_1stringPrimary address line (building name, number, or organisation)
line_2stringSecondary address line (street name)
line_3stringTertiary address line (locality or additional detail)
townstringPost town
countystringCounty (may be empty for addresses in metropolitan areas)
postcodestringPostcode for this address
countrystringCountry within the UK: "England", "Scotland", "Wales", or "Northern Ireland"
udprnstringRoyal Mail UDPRN (Unique Delivery Point Reference Number) — a stable identifier for this address
formatted_addressstringFull address as a single comma-separated string

Example:

{
  "line_1": "Prime Minister & First Lord Of The Treasury",
  "line_2": "10 Downing Street",
  "line_3": "",
  "town": "LONDON",
  "county": "",
  "postcode": "SW1A 2AA",
  "country": "England",
  "udprn": "23747771",
  "formatted_address": "Prime Minister & First Lord Of The Treasury, 10 Downing Street, LONDON, SW1A 2AA"
}

Empty fields

Fields that do not apply to a given address are returned as empty strings (""), never null. You can also use the formatted_address field directly, or build your own:

const fullAddress = [
  address.line_1,
  address.line_2,
  address.line_3,
  address.town,
  address.county,
  address.postcode,
].filter(Boolean).join(", ");

Multiple addresses

Most postcodes return multiple addresses. The addresses array is ordered as delivered by Royal Mail PAF. A typical residential postcode may return 10-30 addresses, while a business postcode may return fewer.

Note

Some postcodes (e.g. large organisations with a dedicated postcode) may return only a single address.

Pagination

Results are paginated. count is the total number of addresses at the postcode; page and limit describe the page you received. The default limit is 100 (also the maximum), so most postcodes return everything in one call. Request further pages with the page and limit query parameters:

curl -H "x-api-key: YOUR_API_KEY" \
  "https://api.snapaddress.io/v1/postcodes/SW1A2AA?page=2&limit=50"

Mapping to form fields

A common use case is populating an address form. Here is a typical mapping:

Form fieldSource
Address line 1line_1
Address line 2line_2
City / Towntown
Countycounty
Postcodepostcode
Countrycountry

line_3 can be appended to line 2 or placed in a separate field depending on your form layout. The udprn field is useful for deduplication or as a stable identifier when storing addresses.

Autocomplete response

The /v1/autocomplete endpoint returns a different shape. The top-level object is:

FieldTypeDescription
querystringThe query you sent
countnumberNumber of suggestions returned
suggestionsarrayArray of suggestions (see below)

Each suggestion represents either a postcode (for postcode-shaped queries — many addresses grouped under one postcode) or a single address (for street, building, or business-name queries):

FieldTypeDescription
postcodestringThe postcode of this suggestion
summarystringDisplay label. For postcode suggestions: "<postcode> - <street>, <town>". For individual addresses: the full formatted address.
address_countnumberNumber of addresses represented — greater than 1 for postcode suggestions, always 1 for individual addresses

Example:

{
  "query": "SW1A",
  "count": 1,
  "suggestions": [
    {
      "postcode": "SW1A 2AA",
      "summary": "SW1A 2AA - Downing Street, LONDON",
      "address_count": 4
    }
  ]
}

After the user selects a suggestion, use its postcode value to call /v1/postcodes/{postcode} and retrieve full addresses.