CarStat.dev
Connect key
GET/locationsDictionaries

Locations, regions, districts and populated places

Regions, districts and populated places, filterable by country and parent.

  • feature_class=A&feature_code=ADM1 gives regions, ADM2 districts, and feature_class=P towns and villages.
  • An unknown country or filter combination returns an empty list, not 404.
  • Pages with after_id, like /countries.

Query parameters

10
querystring≤ 200 chars

Optional literal name-prefix search. Countries also search native names, ISO codes and stored translations. Blank text disables this filter.

ids[]integer[]≥ 1 · ≤ 100 items

Batch lookup. Repeat ids[]=2001&ids[]=3001; not a comma-separated string. Unknown IDs are omitted. Intersects other filters.

per_pageinteger1–1,000 · default 100

Maximum returned records. Empty, noninteger or out-of-range values return 422.

after_idinteger≥ 1

Exclusive ID cursor. Omit initially; then use meta.next_after_id with unchanged filters. Not a page number. Empty or nonpositive values return 422.

country_idinteger≥ 1

Internal country ID from /countries. Optional; omit to enumerate all countries.

admin1integer≥ 1

First-level administrative location ID, not a country ID or source code.

admin2integer≥ 1

Second-level administrative location ID.

feature_classstring

Case-insensitive source class: A for administrative areas, P for populated places (not only cities). Unknown well-formed values return an empty list.

feature_codestring

Case-insensitive source code: ADM1 for regions, ADM2 for districts. Unknown well-formed values return an empty list.

langstring

Response locale. Option translations are also limited by the account languages. The page selects its current language automatically.

Returns · Location objects in data, with the same meta as /countries.
GET/locations
curl -g "https://api.lotarius.com/locations?api_key=$CARS_API_KEY" \
  -H "Accept: application/json"
ExamplesRecorded
{2 keys
"data": [1 item
0: {15 keys
"id": 1841610
"name": "Kyunggi-do"
"original_name": "Gyeonggi-do"
"ascii_name": null
"country_id": 208
"admin1": 1841610
"admin2": null
"population": 13413459
"admin3": null
"admin4": null
"admin5": null
"feature_class": "A"
"feature_code": "ADM1"
"latitude": 37.6
"longitude": 127.25
}
]
"meta": {3 keys}
}