Skip to content

Get Counties​

GET
/api/v1/public/shared/counties

Lists counties with pagination. The city filter is optional; without it all counties 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"
cityId

City ID, See

Typeinteger
Example98273
Minimum1
ids

Comma-separated county IDs (at most 200)

Typestring
Example"43,196"
search

Counties whose ID equals this value or whose name contains it. Ignored when nameExact or namePrefix is given

Typestring
Example"CEY"
Min Length1
Max Length255
nameExact

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

Typestring
Min Length1
Max Length64
namePrefix

Beginning of the county name. When given, search is ignored

Typestring
Min Length1
Max Length64

Responses​

Counties listed

application/json
JSON
{
"success": true,
"message": "İlçeler listelendi",
"items": [
{
"id": 43,
"name": "ALADAG"
}
],
"meta": {
"page": 1,
"perPage": 50,
"total": 233,
"pageCount": 5
}
}

Playground​

Headers
Variables
Key
Value

Samples​

cURL
JavaScript
PHP
Python