Skip to main content
GET
Find countries, states, or cities near a lat/lng coordinate. Results are ordered from nearest to farthest.
This is not address search. It does not:
  • Find a street address
  • Check whether a point is inside a country or state border
  • Return country/state map shapes
  • Calculate travel time or road distance
It measures straight-line distance to the stored coordinate for a city, state, or country.
Availability: Supporter, Professional, and Business plans. Other plans receive 403. Compare plans, or see Trying it without a paid plan below.

Response

Returns an array, nearest-first. Each item carries the standard fields for the entity at your plan’s data-access level, plus:
State and city results always include country_name (and, for cities, state_name), regardless of your plan’s data-access level β€” useful for display without a second lookup. This differs from Autocomplete, which instead always includes country_code/state_code on city results; nearby search doesn’t force those two.

Trying it without a paid plan

The interactive API documentation uses a shared Playground plan. It is only for trying the endpoint in the docs. For your own app, choose a Supporter plan or higher. The CLI also provides a csc nearby command for this endpoint.

Authorizations

X-CSCAPI-KEY
string
header
required

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

Query Parameters

lat
number
required

Latitude of the search origin

Required range: -90 <= x <= 90
Example:

19.076

lng
number
required

Longitude of the search origin

Required range: -180 <= x <= 180
Example:

72.878

type
enum<string>
default:city

Entity type to search

Available options:
city,
state,
country
Example:

"city"

kind
enum<string>

City classification filter. Valid only when type=city.

Available options:
settlement,
administrative,
section,
unknown
Example:

"settlement"

country
string

ISO 3166-1 alpha-2 country code. Invalid when type=country.

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

"IN"

state
string

State or province code for a city search. Requires country and is valid only when type=city.

Required string length: 1 - 20
Example:

"MH"

min_population
integer<int64>

Minimum population a result must have

Required range: 0 <= x <= 9007199254740991
Example:

100000

radius
number
default:25

Search radius in kilometers (1–500)

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

25

limit
integer
default:20

Maximum number of results (1–100)

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

20

locale
string

Adds localized_name and matched_locale using exact locale β†’ base language β†’ native name β†’ English name fallback. The English name, stable id, and distance 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

Matching results sorted from nearest to farthest

id
integer<int64>
required

Entity ID

Example:

57606

name
string
required

English place name

Example:

"Mumbai"

distance_km
number
required

Straight-line distance from the search origin in kilometers

Example:

3.42

type
string | null

Raw source type for a state or city. This is not the country/state/city query type. Available on the coordinates tier and above.

Example:

"city"

kind
enum<string>

Derived city classification. Present on city results for every plan.

Available options:
settlement,
administrative,
section,
unknown
Example:

"settlement"

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

Country ISO2 code for countries or state ISO code for states. Not present on city results.

Example:

"IN"

iso3
string | null

Country ISO3 code. Present only on country results.

Example:

"IND"

state_code
string | null

Parent state code for city results. Available on the coordinates tier and above.

Example:

"MH"

country_code
string | null

Parent country code. Always present on state results; available on city results on the coordinates tier and above.

Example:

"IN"

country_name
string

Parent country name. Present on state and city results for every plan.

Example:

"India"

state_name
string | null

Parent state name. Present on city results for every plan; null when there is no parent state.

Example:

"Maharashtra"