Skip to main content
GET
Search cities, states, and countries for a type-ahead / autocomplete UI. Unlike Fuzzy Search — which ranks purely by trigram similarity — autocomplete uses a stricter, deterministic order built for a dropdown: exact matches first, then starts-with matches, then the closest remaining fuzzy matches, with population and then record ID breaking any ties. The same query always returns the same order. Each result also carries a ready-to-display label (e.g. "Mumbai, Maharashtra, India") so you don’t have to assemble one yourself.
Availability: Professional and Business plans. Returns 403 on Community, Starter, Supporter, and Legacy plans. Compare plans, or see Trying it without a paid plan below.
Matching checks the English name, native name, and stored translations. Translation matching starts at 3 characters. Responses are cached separately by query, filters, plan, locale, and translation output.

Authentication

string
required
Your API key for authentication

Query Parameters

string
required
The search text. 2–100 characters, matched case-insensitively against the English and native names.
string
default:"city"
What to search. One of city, state, or country.
string
Restrict results to a single country by ISO 3166-1 alpha-2 code, e.g. IN, US. Case-insensitive (auto-uppercased). Not valid with type=country — sending it returns 400.
string
Restrict city results to one state. This works only with type=city and requires country. Other combinations return 400 because state codes aren’t unique across countries.
integer
default:"10"
Maximum number of results to return. 1–50.
string
Add localized_name and matched_locale, and use the localized name in label. Example: ja or pt-BR. Professional and Business plans only. See Localized Place Names.
boolean
default:"false"
Include the full raw translations JSON string. Professional and Business plans only.

Response

Returns an array. Each item carries the standard fields for the entity (city, state, or country) at your plan’s data-access level, plus:
string
Which entity this result is: country, state, or city.
string
A ready-to-display string: just the name for a country, "State, Country" for a state, "City, State, Country" for a city. Missing parts (e.g. a city with no state on record) are omitted rather than left blank.
number
Trigram similarity of the best-matching name (English or native), from 0 to 1, rounded to 2 decimals.
string
Which name field matched: name, native, or translation.
string
The display name for locale, when requested and available on your plan.
string
The locale used for localized_name, including fallback values such as native or en.
City results always include country_code and state_code, regardless of your plan’s data-access level — even the basic-tier field set includes them here, since you can’t build a useful label or scope a follow-up request without them. (States already include country_code at every tier under the normal field rules, so no such exception is needed there.)

Ranking

Results are ordered deterministically — the same query always returns the same order:

Trying it without a paid plan

A separate Playground plan powers the interactive API documentation — a basic-tier field set on a shared rate limit sized for many concurrent visitors, not a per-visitor quota. It isn’t something you can sign up for directly; it is only for the docs playground. For your own integration, choose a Professional or Business plan.