Wards

Autocomplete UK electoral wards by prefix.

Try it

Endpoint

GET/v1/ward/<query>
Base URL: https://autocomplete.namedone.com

SDK Usage

wards()
1import { createClient } from "@namedone/autocomplete"
2
3const nd = createClient("nd_...")
4const { results } = await nd.wards("hig")

curl

1# Exchange your API key for a token
2curl -X POST https://token.namedone.com/v1 \
3 -H "Content-Type: application/json" \
4 -d '{"apiKey":"nd_..."}'
5
6# Query the wards endpoint
7curl "https://autocomplete.namedone.com/v1/ward/hig?token=<jwt>"

Response Format

JSON
{
"results": [
{
"id": "ward-0",
"text": "Highbury",
"type": "ward"
}
],
"query": "hig"
}

API Query Parameters

Sent as query string parameters on the HTTP request to the API.

ParameterTypeDefaultDescription
tokenstringJWT obtained from the token API. Required for authentication.

SDK Options

Passed to the SDK methods (e.g. firstNames(query, opts)). These are processed client-side and never sent to the API.

OptionTypeDefaultDescription
limitnumber10Maximum number of results (1–50). Applied client-side by the SDK.
simplebooleanfalseSimplify response: deduplicate by text and strip to {text, type}.

Examples

Query: hig

{
"results": [
{
"id": "ward-0",
"text": "Highbury",
"type": "ward"
},
{
"id": "ward-1",
"text": "Holloway",
"type": "ward"
},
{
"id": "ward-2",
"text": "Hackney",
"type": "ward"
}
],
"query": "hig"
}

Notes

  • Data is sourced from ONS administrative boundaries.
  • Source: Office for National Statistics, OGL v3.0.