Cities
Filter and list cities by country, population or type.
GET
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
country | string | Optional | Filter by ISO2 country code |
min_population | integer | Optional | Minimum population filter |
type | string | Optional | Filter by place type (city, town, village) |
limit | integer | Optional | Maximum results (default: 10, max: 100) |
Request Example
curl "https://api.localityapi.com/v1/cities?country=AE&limit=5" \
-H "X-API-Key: lapi_your_key"Response
json
{
"results": [
{
"name": "Dubai",
"country": "AE",
"admin1": "Dubai",
"lat": 25.2048,
"lng": 55.2708,
"population": 3790000
},
{
"name": "Abu Dhabi",
"country": "AE",
"admin1": "Abu Dhabi",
"lat": 24.4539,
"lng": 54.3773,
"population": 1420000
}
],
"count": 2,
"query_ms": 12
}Response Fields
resultsarrayArray of citiesresults[].namestringCity nameresults[].countrystringISO2 country coderesults[].admin1stringPrimary admin regionresults[].latnumberLatituderesults[].lngnumberLongituderesults[].populationintegerPopulation countcountintegerTotal number of resultsquery_msintegerQuery execution time in milliseconds