Hepsiemlak Locations API walks the location tree. Without a parameter it lists the cities with their slugs. With city_id it lists the counties of that city, with county_id the districts of that county, each with id and coordinates. The ids feed the price index route. For search slugs use the filters route.
Run this endpoint
Endpoint
Parameters
Start with the required fields, then add optional filters only when your use case needs them.
Runnable path
This endpoint has no required query parameters.
2 optional filters available.
integer
Optional
City id such as 34 for İstanbul. Lists its counties.
1234567890
integer
Optional
County id such as 1421 for Kadıköy. Lists its districts. Do not combine with city_id.
1234567890
Response Schema
Example response fields are illustrative; inspect the JSON before integrating.
Example response fields
Scan these fields before integrating.
data
meta
success
{
"data": {
"level": "counties",
"city_id": 34,
"counties": [
{
"id": 1103,
"name": "Adalar",
"latitude": 40.8746566772461,
"longitude": 29.1295642852783
},
{
"id": 2048,
"name": "Arnavutk\u00f6y",
"latitude": 41.186393737793,
"longitude": 28.7388896942139
}
]
},
"meta": {
"billable": true,
"endpoint_family": "locations"
},
"success": true
}
Errors
Handle these documented responses before retrying or showing customer-facing failures.
Validation Error
A parameter is missing or outside its allowed values. This response is not billable.
{
"errors": {
"city_id": [
"The city_id field is invalid."
]
},
"message": "The request validation failed"
}Not Found
The city or county id does not exist. This response is not billable.
{
"meta": {
"billable": false,
"retryable": false,
"endpoint_family": "locations"
},
"error": {
"code": "NOT_FOUND",
"message": "The requested resource was not found."
},
"success": false
}Upstream Unavailable
Hepsiemlak could not be reached or capacity is busy. Retry after a short pause. This response is not billable.
{
"meta": {
"billable": false,
"retryable": true,
"endpoint_family": "locations"
},
"error": {
"code": "UPSTREAM_UNAVAILABLE",
"message": "Hepsiemlak could not be reached. Please retry shortly."
},
"success": false
}Generate Code with AI
Copy a ready-made prompt with all the endpoint details, parameters, and example responses. Paste it into ChatGPT, Claude, or any AI assistant to instantly generate working code.
Try It Live
Test this endpoint in our interactive playground with real data.