Skip to Content
APIGeineAPIGeine

Autocomplete place names

Returns cities, states/regions and countries whose name starts with the search text, for autocomplete fields. Matching is a case-insensitive prefix match on the place name; accents are significant. Results are ordered by name (an exact match comes first), then countries before states before cities. Duplicate records of the same place are returned once. Optionally filter by `type` and `country_code`. Returns an empty list when nothing matches. Read-only.

Subscribe on RapidAPI
GET
/places/v1/autocomplete

Returns cities, states/regions and countries whose name starts with the search text, for autocomplete fields. Matching is a case-insensitive prefix match on the place name; accents are significant. Results are ordered by name (an exact match comes first), then countries before states before cities. Duplicate records of the same place are returned once. Optionally filter by type and country_code. Returns an empty list when nothing matches. Read-only.

Query Parameters

q*string

Search text, matched case-insensitively against the start of place names (prefix match). Surrounding whitespace is ignored. 1-100 characters. Accents are significant: sao does not match São.

Length1 <= length <= 100
type?string

Only return places of this type. Omit to search all types.

Value in"city""state""country"
country_code?string

Only return places in this country (two-letter code, case-insensitive).

Match^[A-Za-z]{2}$
limit?integer

Maximum number of suggestions, 1-50. Default 10.

Range1 <= value <= 50
Default10

Response Body

Matching places (possibly none).

application/json
  1. response
success*true
Value intrue
data*
Example Request
curl -X GET 'https://places-api-cities-states-regions-countries.p.rapidapi.com/places/v1/autocomplete?q=san'
Example Response
{  "success": true,  "data": {    "query": "san",    "results": [      {        "id": "city:111840",        "type": "city",        "name": "San Francisco",        "display_name": "San Francisco, California, United States",        "country_code": "US",        "country_name": "United States",        "state_name": "California",        "latitude": "37.77493000",        "longitude": "-122.41942000",        "timezone": "America/Los_Angeles",        "currency_code": "USD"      }    ]  }}