Skip to content

Get Cities​

GET
/api/v1/public/shared/cities

Lists cities with pagination. The country filter is optional; without it cities of all countries are returned, and when countryId and countryCode are both given, cities matching both are returned. No token required.

Parameters​

Header Parameters

Accept-Language

Language of country and unit of measure names and validation error messages. English when it starts with en (e.g. en, en-US), Turkish otherwise. Success messages are always in Turkish.

Typestring
Examples
"tr"
"en"
Default"tr"

Query Parameters

page

Page number

Typeinteger
Minimum1
Default1
perPage

Records per page. To get the whole list, use 200 and iterate over meta.pageCount pages.

Typeinteger
Minimum1
Maximum200
Default50
sortBy

Sort field

Typestring
Valid values
"name""id"
Default"name"
sortOrder

Sort direction (case-insensitive)

Typestring
Valid values
"asc""desc"
Default"asc"
countryCode

Country code (exact match, case-insensitive)

Typestring
Example"TR"
Min Length1
Max Length8
countryId

Country ID, See

Typeinteger
Example234
Minimum1
ids

Comma-separated city IDs (at most 200)

Typestring
Example"98273,98247"
name

Cities whose name contains this value. Ignored when nameExact or namePrefix is given

Typestring
Example"ADA"
Min Length1
Max Length255
nameExact

City name (exact match). When given, namePrefix and name are ignored

Typestring
Min Length1
Max Length64
namePrefix

Beginning of the city name. When given, name is ignored

Typestring
Min Length1
Max Length64

Responses​

Cities listed

application/json
JSON
{
"success": true,
"message": "Şehirler listelendi",
"items": [
{
"id": 98273,
"name": "ADANA"
}
],
"meta": {
"page": 1,
"perPage": 50,
"total": 233,
"pageCount": 5
}
}

Playground​

Headers
Variables
Key
Value

Samples​

cURL
JavaScript
PHP
Python