Addresses

Smart address autocomplete that strips leading numbers, searches streets, and prepends the number back. There is no dedicated /v1/address endpoint — this is a client-side SDK feature built on top of the streets endpoint.

Try it

Endpoint

GETSDK only (client-side)
Base URL: https://autocomplete.namedone.com

SDK Usage

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

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 addresses endpoint
7curl "https://autocomplete.namedone.comSDK only (client-side)?token=<jwt>"

Response Format

JSON
{
"results": [
{
"id": "street-0",
"text": "12 Oak Lane",
"subtitle": "London, SW14",
"type": "street"
"data": {
"postcodeDistrict": <string>,
"populatedPlace": <string>,
"lat": <number>,
"lng": <number>
}
}
],
"query": "12 oak"
}

Data Fields

FieldTypeDescription
postcodeDistrictstringPostcode outward code
populatedPlacestringNearest populated place
latnumberWGS84 latitude
lngnumberWGS84 longitude

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}.
sortByProximityarraySort results by proximity to coordinates. Client-side only.
postcodestringPostcode district for filtered search. Client-side only.

Examples

Query: 12 oak

{
"results": [
{
"id": "street-0",
"text": "12 Oak Lane",
"subtitle": "London, SW14",
"type": "street"
},
{
"id": "street-1",
"text": "12 Oak Road",
"subtitle": "Manchester, M1",
"type": "street"
},
{
"id": "street-2",
"text": "12 Oak Avenue",
"subtitle": "Birmingham, B1",
"type": "street"
}
],
"query": "12 oak"
}

Notes

  • The SDK's addresses() method strips the leading number (e.g. "12" from "12 Oak Lane"), searches streets for "oak lane", then prepends "12" back onto each result.
  • Supports flat letters like "3A" — the number prefix "3A" is captured and prepended.
  • When opts.postcode is provided, uses postcode-filtered street search for more relevant results.
  • This is a client-side feature — there is no /v1/address endpoint on the server.