Autocomplete UK airports by prefix. Returns the airport code, coordinates, and locality.
/v1/airport/<query>https://autocomplete.namedone.com1import { createClient } from "@namedone/autocomplete"23const nd = createClient("nd_...")4const { results } = await nd.airports("london")1# Exchange your API key for a token2curl -X POST https://token.namedone.com/v1 \3 -H "Content-Type: application/json" \4 -d '{"apiKey":"nd_..."}'56# Query the airports endpoint7curl "https://autocomplete.namedone.com/v1/airport/london?token=<jwt>"{ "results": [ { "id": "airport-0", "text": "London Heathrow", "subtitle": "London", "type": "airport" "data": { "code": <string>, "lat": <number>, "lng": <number>, "locality": <string> } } ], "query": "london"}| Field | Type | Description |
|---|---|---|
| code | string | IATA/ICAO airport code |
| lat | number | WGS84 latitude |
| lng | number | WGS84 longitude |
| locality | string | Town or city |
Sent as query string parameters on the HTTP request to the API.
| Parameter | Type | Default | Description |
|---|---|---|---|
| token | string | — | JWT obtained from the token API. Required for authentication. |
Passed to the SDK methods (e.g. firstNames(query, opts)). These are processed client-side and never sent to the API.
| Option | Type | Default | Description |
|---|---|---|---|
| limit | number | 10 | Maximum number of results (1–50). Applied client-side by the SDK. |
| simple | boolean | false | Simplify response: deduplicate by text and strip to {text, type}. |
| sortByProximity | array | — | Sort results by proximity to coordinates. Client-side only. |
Query: london
{ "results": [ { "id": "airport-0", "text": "London Heathrow", "subtitle": "London", "type": "airport", "data": { "code": "LHR" } }, { "id": "airport-1", "text": "London Gatwick", "subtitle": "London", "type": "airport", "data": { "code": "LGW" } }, { "id": "airport-2", "text": "London Stansted", "subtitle": "London", "type": "airport", "data": { "code": "STN" } } ], "query": "london"}