# Vuokraovi Districts API Documentation

Scrappa's `GET /api/vuokraovi/districts` lists the districts and subdistricts of one municipality, for example Helsinki.

## What you get

Each entry has `code`, `name` and, for a subdistrict, `parent_district_name`. Use the `code` as `location_code` with `location_type=DISTRICT` or `SUBDISTRICT` in the search. A municipality without districts returns an empty list.

- **Documentation:** [https://scrappa.co/docs/vuokraovi-api/vuokraovi_districts](https://scrappa.co/docs/vuokraovi-api/vuokraovi_districts)
- **API group:** Vuokraovi API
- **Endpoint:** `GET https://scrappa.co/api/vuokraovi/districts`

## 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 |
| --- | --- | --- | --- |
| `municipality_code` | string | Yes | Municipality code from location-autocomplete, for example FI_UUSIMAA_HELSINKI. |

## Example request

```bash
#!/bin/bash

curl -X GET \
    -H "x-api-key: YOUR_API_KEY_HERE" \
    "https://scrappa.co/api/vuokraovi/districts?municipality_code=FI_UUSIMAA_HELSINKI"
```

## Example response

```json
{
    "success": true,
    "municipality_code": "FI_UUSIMAA_HELSINKI",
    "total": 2,
    "districts": [
        {
            "code": "FI_UUSIMAA_HELSINKI_MALMI_ALAMALMI",
            "name": "Ala-Malmi",
            "parent_district_name": "Malmi"
        },
        {
            "code": "FI_UUSIMAA_HELSINKI_ALPPIHARJU",
            "name": "Alppiharju"
        }
    ],
    "meta": {
        "endpoint_family": "districts",
        "billable": true,
        "attempts": 1
    }
}
```

## Errors

| Status | Error | Description |
| --- | --- | --- |
| 422 | Validation Error | A query parameter is missing, unknown or unusable. Unknown parameters and unknown values are rejected, never ignored. Non-billable. |
| 503 | Upstream Unavailable | Vuokraovi could not be reached after retries, answered with an error or changed its format (`upstream_unavailable`, `upstream_blocked`, `parser_drift`). Retryable and never billed. Clients are never rate limited. |

## 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)
