Address lookup architecture

UK Address Lookup and Autocomplete Guide

Address lookup can reduce typing and improve consistency, but it should remain a convenience rather than a gatekeeper. A production-ready flow needs tolerant postcode input, editable results, manual entry and a recovery path when the provider is slow, unavailable or incomplete.

By · Published · Updated

UK Address Lookup and Autocomplete Guide visual guide cover

Choose the lookup pattern for the task

A postcode lookup asks for a postcode first and then returns candidate addresses. Type-ahead autocomplete suggests addresses as the user enters more text. Both can reduce keystrokes, but they have different cost, latency, privacy and accessibility characteristics. Use evidence from the service rather than assuming that one interaction is best for every audience.

The GOV.UK Design System address pattern says to consider postcode lookup and to give users a manual-entry option. If a service collects international addresses, a UK postcode-first flow also needs an obvious country choice or a route that does not apply UK-only rules.

PatternUseful whenImportant limitation
Postcode lookupThe user knows a UK postcode and needs to select a premisesA postcode can contain several addresses and the required one may be missing
Address autocompleteFast progressive suggestions are supported by an appropriate datasetEvery keystroke may create a provider request unless the client is designed carefully
Manual entryThe lookup fails, the address is new, unusual or outside the supported countryRequires clear fields and validation that tolerates genuine variation

Build a recoverable postcode lookup flow

  1. Accept upper or lower case and harmless spacing differences in the postcode.
  2. Normalise the value for the request without replacing the user's visible input unexpectedly.
  3. Show a clear loading state and prevent duplicate requests while the same lookup is pending.
  4. Present candidate addresses in a labelled control that works with keyboard and screen-reader navigation.
  5. Populate the form only after an explicit selection, then keep every returned field editable.
  6. Preserve the entered postcode and expose manual entry after an empty result, timeout or provider error.

Do not describe a syntax match as an address match. A postcode can have a valid shape without being present in the chosen dataset, and a returned address still does not prove the user's identity, residence or right to use it. The guide to validation versus address verification separates those decisions.

Keep manual entry visible and editable

Manual entry should be available before and after lookup, not hidden behind an error that users must trigger. It covers new builds, properties that are missing from the provider, unusual premises, people who do not know the postcode and addresses outside the supported dataset.

Use address lines that can hold real variation, a separate postcode, a clear town or city label and an optional county unless a documented integration requires a specific administrative concept. Preserve meaningful building and locality text instead of silently forcing the result into an incompatible schema. See the UK address format guide and post town, city and county guide for field design.

Design for accessibility and error recovery

Dynamic suggestions need an interaction model that communicates their label, count, active option and selection state without relying on visual position alone. Test the complete flow with a keyboard and screen reader, at narrow widths and at 200% zoom. Preserve focus predictably when results arrive and do not move focus merely because a background request completed.

  • Associate instructions and errors with the postcode or address input.
  • Use an error summary that links back to the affected field where the wider form needs one.
  • Keep typed values after validation errors and failed submissions.
  • Provide a meaningful empty-result message and a direct manual-entry action.
  • Allow a selected address to be corrected without starting the entire form again.
  • Test slow responses so status updates are announced without becoming repetitive.

Evaluate the provider and data contract

Document the provider, dataset, licence, geographic coverage, update frequency, address lifecycle and fields returned. Decide whether the service needs postal delivery data, geographic reference data, a UPRN, a geocoder result or only postcode syntax. Those sources answer different questions and should not be presented as interchangeable.

Treat provider calls as an external data transfer. Send only the fields needed for the lookup, use encrypted transport, keep credentials on the server where the provider's design allows it, restrict keys by origin or service, and avoid placing full addresses or raw suggestions in analytics and error logs. Set request timeouts and a circuit-breaking policy so an upstream outage cannot block manual submission.

Cache only when the provider's licence and freshness requirements permit it. A long-lived cache can retain corrected or withdrawn records, while no caching can create unnecessary cost and latency. Record the source and retrieval date when downstream decisions need provenance.

Use a focused QA matrix

ScenarioExpected result
Lower-case postcode without a spaceLookup runs after safe normalisation
Multiple premises for one postcodeEvery option is distinguishable and selectable by keyboard
No resultsThe value is preserved and manual entry is immediately available
Timeout, rate limit or server errorA recoverable message appears without losing the form
Selected address needs a correctionPopulated fields remain editable and submit correctly
International or unusual addressThe user can bypass the UK-only lookup
Provider payload changesSchema validation fails safely without exposing raw data

Add contract tests for provider responses and end-to-end tests for selection, manual-entry switching, validation and resubmission. The UK address form QA checklist covers additional layout, export, integration and data-safety cases.

Official references