Autocomplete formal names by prefix. Returns title + name combinations like "Mr Jones", "Sir Paul", and "Duke of Edinburgh" from a curated list of titles, popular surnames, and famous people. The SDK's formalNames() method enhances this endpoint by automatically switching to the first-name, last-name, or towns endpoints once a title is complete — enabling patterns like "Mr John Smith" (title + first + last) and "Duke of Edinburgh" (title + of + place) that aren't available from the raw API alone.
/v1/formal-name/<query>https://autocomplete.namedone.com1import { createClient } from "@namedone/autocomplete"23const nd = createClient("nd_...")4const { results } = await nd.formalNames("m")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 formal names endpoint7curl "https://autocomplete.namedone.com/v1/formal-name/m?token=<jwt>"{ "results": [ { "id": "formal-name-0", "text": "Marquess of Bath", "type": "formal-name" } ], "query": "m"}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}. |
| pattern | string | "auto" | Restrict formal name patterns: "auto" (all), "title-last", "title-first", or "title-first-last". |
Query: m
{ "results": [ { "id": "formal-name-0", "text": "Marquess of Bath", "type": "formal-name" }, { "id": "formal-name-1", "text": "Marquess of Salisbury", "type": "formal-name" }, { "id": "formal-name-2", "text": "Mr Adams", "type": "formal-name" }, { "id": "formal-name-3", "text": "Mrs Anderson", "type": "formal-name" }, { "id": "formal-name-4", "text": "Miss Allen", "type": "formal-name" } ], "query": "m"}Query: mr j
{ "results": [ { "id": "formal-name-0", "text": "Mr Jones", "type": "formal-name" }, { "id": "formal-name-1", "text": "Mr Johnson", "type": "formal-name" }, { "id": "formal-name-2", "text": "Mr Jackson", "type": "formal-name" }, { "id": "formal-name-3", "text": "Mr Jenkins", "type": "formal-name" }, { "id": "formal-name-4", "text": "Mr Jordan", "type": "formal-name" } ], "query": "mr j"}Query: sir p
{ "results": [ { "id": "formal-name-0", "text": "Sir Paul McCartney", "type": "formal-name" }, { "id": "formal-name-1", "text": "Sir Patrick Stewart", "type": "formal-name" }, { "id": "formal-name-2", "text": "Sir Peter", "type": "formal-name" } ], "query": "sir p"}Query: duke of e
{ "results": [ { "id": "formal-name-0", "text": "Duke of Edinburgh", "type": "formal-name" }, { "id": "formal-name-1", "text": "Duke of Exeter", "type": "formal-name" } ], "query": "duke of e"}