List Cities by Country
List cities within a country (ISO 3166-1 alpha-2 country_code). Optionally narrow to a single city by city_id.
Query Parameters
- Type: stringcountry
_code min length:2max length:2enumrequiredISO 3166-1 alpha-2 country code (2 letters, e.g. 'US', 'BR', 'GB').
values- A
D - A
E - A
F - A
G - A
L
- Type: integercity
_id min:0max:2147483647Chartmetric city ID; narrows the result set to a single city.
Responses
- application/json
Request Example for get/api/cities
curl 'https://api.chartmetric.com/api/cities?country_code=AD&city_id=0' \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN'
{
"obj": [
{
"city_id": 11778,
"city_name": "Culpeper",
"latitude": 38.4705,
"longitude": -78.0001,
"population": 19986,
"province": null,
"locality": "Culpeper",
"country": "United States",
"image_url": null,
"iso3": "USA"
}
]
}