---
title: "Statistics for one municipality"
method: GET
path: "/api/v1/kunta/{kuntaCode}/stats"
tags: ["Municipalities"]
---

# Statistics for one municipality

`GET /api/v1/kunta/{kuntaCode}/stats`

## Request

- Base URL: `https://suomiatlas.com`
- URL: `https://suomiatlas.com/api/v1/kunta/{kuntaCode}/stats`
- Auth: one of:
  - none
  - HTTP bearer

One municipality's population, crime, dwelling price medians and the list of postal code areas inside it.

**Free-tier limits, Pro-only — an Area Pass never helps here**, because a municipality aggregates all of its areas. Each one that actually applied is named in `locked` with `requires: pro`; a municipality with 3 or fewer published years, or no dwelling-price history, gets no entry for that field because nothing was withheld:

- `populationSeries` is cut to its **last 3 entries**.
- `housingPriceSeries` is **null** — not an empty array, and not an error — when it was withheld; a municipality without any such history returns an empty array to every tier. The latest-year medians in `housingPrices` stay free.

Example request: https://suomiatlas.com/api/v1/kunta/091/stats

## Path parameters

- `kuntaCode` string, required

## Response `200`

Municipality statistics, series possibly trimmed or withheld.

- KuntaStats
  - `kuntaCode` string, required
  - `name` string, required
  - `maakuntaName` string, nullable, required
  - `population` YearValue, required
    - `year` integer, required
    - `value` number, double, nullable, required
  - `populationSeries` YearValue[], required: **Only the last 3 entries without Pro**; reported in `locked` as `populationSeries` when the cut applied.
    - `year` integer, required
    - `value` number, double, nullable, required
  - `crime` CrimeStats, nullable, required: Crime is published per municipality, never per postal area, so this block describes the area's whole municipality.
    - `kuntaCode` string, required
    - `kuntaName` string, required
    - `year` integer, required
    - `maakuntaName` string, nullable, required
    - `metrics` CrimeMetric[], required
      - `code` string, required
      - `name` string, required
      - `unit` string, required
      - `value` number, double, nullable, required
      - `nationalPercentile` number, double, nullable, required
      - `maakuntaPercentile` number, double, nullable, required
      - `trend` TrendPoint[], required
        - `year` integer, required
        - `value` number, double, required
  - `housingPrices` HousingPriceMedian[], required: Latest-year medians per dwelling type. Free.
    - `code` string, required
    - `name` string, required
    - `year` integer, required
    - `medianEurPerM2` number, double, nullable, required
    - `areasCounted` integer, required: How many areas the median rests on. A low count is a thin market — say so rather than quoting the figure bare.
  - `housingPriceSeries` HousingPriceSeries[], nullable, required: **Null — not an empty array — when withheld from a non-Pro caller**, reported in `locked` as `housingPriceSeries`. A municipality with no dwelling-price history returns an empty array on every tier, so null means exactly "withheld". An Area Pass does not unlock it.
    - `code` string, required
    - `name` string, required
    - `series` YearValue[], required
      - `year` integer, required
      - `value` number, double, nullable, required
  - `postalCodes` AreaSummary[], required: The postal code areas inside this municipality.
    - `code` string, required: 5-digit postal code.
    - `name` string, required
  - `locked` LockedField[]: Absent — the key is missing, not an empty array — when nothing was withheld for this caller. May name: `populationSeries` and `housingPriceSeries` (both `requires: pro`).
    - `field` string, required: Path into this response, e.g. `entries`, `years`, `series.housing_*`, `pollutants[].data.series`, `composites[].components[].percentile`.
    - `requires` 'pro' | 'area-pass', required: `pro`: only a Pro subscription lifts it. `area-pass`: Pro, or an Area Pass for this exact postal code.
    - `reason` string, required: One sentence naming what is withheld. Always ends "The data exists — it is withheld, not missing."
    - `upgrade` string, uri, required

## Other responses

- `404`: No such place, or no data for it. Also what a non-numeric `year` produces, because query-parameter conversion fails before the operation runs.

---

[API](https://skmtc.dev/suomiatlas/apis/suomiatlas-read-api.md) · [All operations](https://skmtc.dev/suomiatlas/apis/suomiatlas-read-api/llms.txt) · [OpenAPI document](https://skmtc.dev/suomiatlas/apis/suomiatlas-read-api/revisions/b2627414938d?raw)
