Cities API Reference
2 routes under /v1/cities. Base URL https://api.apifor.dev, authenticated with x-api-key, one credit per request. Coverage and licence are on the Cities page.
GET
/v1/citiesList cities with filters and paging.
| Parameter | In | Type | Rules |
|---|---|---|---|
| page | query | integer | min 1 · default 1 |
| limit | query | integer | 1 to 200 · default 50 |
| country | query | string | ISO 3166-1 alpha-2 |
| q | query | string | 2 to 100 chars |
curl 'https://api.apifor.dev/v1/cities' \
-G -d country=IR -d limit=1 \
-H 'x-api-key: YOUR_API_KEY'{
"success": true,
"data": [
{
"geonameid": 285,
"name": "Boneh-ye ‘Alvān",
"asciiname": "Boneh-ye 'Alvan",
"lat": 32.11171,
"lng": 48.45877,
"feature_code": "PPL",
"country_code": "IR",
"admin1_code": "15",
"admin1_name": "Khuzestan",
"admin2_code": null,
"population": 6860,
"elevation": 0,
"dem": 54,
"timezone": "Asia/Tehran",
"modified_at": "2026-05-19"
}
]
}200Successful response. Pagination is explicit; no silent truncation.400Invalid query parameters404Record not found500Dataset unavailable
GET
/v1/cities/{id}Find cities by identifier.
| Parameter | In | Type | Rules |
|---|---|---|---|
| id * | path | string | None |
curl 'https://api.apifor.dev/v1/cities/{id}' \
-H 'x-api-key: YOUR_API_KEY'{
"success": true,
"data": {
"geonameid": 285,
"name": "Boneh-ye ‘Alvān",
"asciiname": "Boneh-ye 'Alvan",
"lat": 32.11171,
"lng": 48.45877,
"feature_code": "PPL",
"country_code": "IR",
"admin1_code": "15",
"admin1_name": "Khuzestan",
"admin2_code": null,
"population": 6860,
"elevation": 0,
"dem": 54,
"timezone": "Asia/Tehran",
"modified_at": "2026-05-19"
}
}200Successful response. Pagination is explicit; no silent truncation.400Invalid query parameters404Record not found500Dataset unavailable