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: Supporter, Professional, and Business plans. Returns 403 on Community, Starter, 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.

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:
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 Supporter plan or higher.

Authorizations

X-CSCAPI-KEY
string
header
required

API key for authentication. Get your free key at app.countrystatecity.in.

Query Parameters

q
string
required

Search query — 2 to 100 characters. Case-insensitive.

Required string length: 2 - 100
Example:

"Mumbay"

type
enum<string>
default:city

Entity type to search

Available options:
city,
state,
country
Example:

"city"

country
string

ISO 3166-1 alpha-2 country code to narrow the search (e.g., IN). Invalid when type=country — supplying both returns a 400.

Required string length: 2
Pattern: ^[A-Za-z]{2}$
Example:

"IN"

state
string

State/province ISO code to narrow a city search further (e.g., MH). State codes are not globally unique, so this requires country to also be set and is valid only when type=city.

Required string length: 1 - 20
Example:

"MH"

limit
integer
default:10

Maximum number of results to return (1–50)

Required range: 1 <= x <= 50
Example:

10

locale
string

Adds localized_name and matched_locale, and starts label with the localized name. The English name and id stay unchanged. Supporter+ plans only.

Required string length: 2 - 7
Pattern: ^[a-zA-Z]{2}(-[a-zA-Z]{2,4})?$
Example:

"ja"

include_translations
boolean
default:false

When true, includes the full translation JSON string. Supporter+ plans only.

Example:

true

Response

List of matching results ranked by relevance

type
enum<string>
required

Entity type of the matched result

Available options:
country,
state,
city
Example:

"city"

label
string
required

Ready-to-display label. When locale is supplied on a Supporter+ plan, the first place name is localized. Parent state and country names remain English.

Example:

"ムンバイ, Maharashtra, India"

id
integer<int64>
required

Entity ID (city, state, or country)

Example:

57606

name
string
required

English name of the matched entity

Example:

"Mumbai"

match_score
number
required

Relevance score (0–1, rounded to 2 decimals). Higher is a closer match.

Example:

0.95

matched_field
enum<string>
required

Which field the match was found against.

Available options:
name,
native,
translation
Example:

"translation"

translations
string | null

JSON string of translations. Supporter+ plans only, and only when include_translations=true is passed.

localized_name
string | null

Localized display name selected by locale. The English name remains unchanged. Supporter+ plans only.

Example:

"ムンバイ"

matched_locale
string | null

Translation or fallback used for localized_name: the exact locale, base language, native, or en. Supporter+ plans only.

Example:

"ja"

iso2
string | null

ISO 3166-1 alpha-2 code (type=country) or state ISO code (type=state). Not present on type=city results.

Example:

"IN"

iso3
string | null

ISO 3166-1 alpha-3 code. Only present for type=country; not present otherwise.

Example:

"IND"

state_code
string | null

Parent state ISO code. Always present for type=city; null otherwise.

Example:

"MH"

country_code
string | null

Parent country ISO2 code. Always present for type=city and type=state; null for type=country.

Example:

"IN"