# Hepsiemlak Locations API Documentation

<p><strong>Hepsiemlak Locations API</strong> walks the location tree. Without a parameter it lists the cities with their slugs. With <code>city_id</code> it lists the counties of that city, with <code>county_id</code> the districts of that county, each with id and coordinates. The ids feed the price index route. For search slugs use the filters route.</p>

- **Documentation:** [https://scrappa.co/docs/hepsiemlak-api/hepsiemlak_locations](https://scrappa.co/docs/hepsiemlak-api/hepsiemlak_locations)
- **API group:** Hepsiemlak API
- **Endpoint:** `GET https://scrappa.co/api/hepsiemlak/locations`

## Authentication

Send your Scrappa API key in the `X-API-KEY` request header. Paid endpoints also support accountless x402 payments when called without an API key.

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `city_id` | integer | No | City id such as 34 for İstanbul. Lists its counties. |
| `county_id` | integer | No | County id such as 1421 for Kadıköy. Lists its districts. Do not combine with city_id. |

## Example response

```json
{
    "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

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A parameter is missing or outside its allowed values. This response is not billable. |
| 404 | Not Found | The city or county id does not exist. This response is not billable. |
| 503 | Upstream Unavailable | Hepsiemlak could not be reached or capacity is busy. Retry after a short pause. This response is not billable. |

## More Scrappa resources

- [API documentation](https://scrappa.co/docs)
- [Full LLM-readable API reference](https://scrappa.co/llms-full.txt)
- [OpenAPI specification](https://scrappa.co/docs/api.json)
- [Pricing](https://scrappa.co/pricing)
