Quickstart
Make your first request in a minute.
Subscribe on RapidAPI1. Get access
Subscribe to the Places API on RapidAPI and use the code snippets on its API page: they include everything your requests need. The examples here show only the paths and parameters, with this base URL:
export BASE_URL="https://places-api-cities-states-regions-countries.p.rapidapi.com"2. Autocomplete a place
curl "$BASE_URL/places/v1/autocomplete?q=san%20fr&limit=5"{
"success": true,
"data": {
"query": "san fr",
"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"
}
]
}
}3. Fill a country and state selector
curl "$BASE_URL/places/v1/countries"
curl "$BASE_URL/places/v1/countries/US/states"{ "success": true, "data": { "country_code": "US", "states": [{ "name": "Alabama" }, { "name": "Alaska" }] } }The response above is shortened. See Autocomplete and Countries and states.