# Kolada: Sweden Municipalities KPIs and Municipal Statistics (`nightwave-owner/kolada-municipal-kpis`) Actor

Returns key figures (KPIs) for Sweden's 290 municipalities and 21 regions from Kolada (RKA): population, tax rates, schools, elderly care, costs and 5 000+ more, one row per area, year and gender. Search KPIs by keyword or id. Supports onlyNew for scheduled runs.

- **URL**: https://apify.com/nightwave-owner/kolada-municipal-kpis.md
- **Developed by:** [Viktor Wiberg](https://apify.com/nightwave-owner) (community)
- **Categories:** Developer tools, AI, Business
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.00 / 1,000 kpi values

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Kolada: Sweden Municipalities KPIs and Municipal Statistics

Key figures for Sweden's 290 municipalities (kommuner), 21 regions and the whole country from [Kolada](https://kolada.se), the open database run by RKA (Rådet för främjande av kommunala analyser). Kolada holds about 5 800 KPIs (nyckeltal) on population, tax rates, school results, elderly care, social services, costs, environment and more, collected from SCB, Skolverket, Socialstyrelsen and other agencies. This actor returns them as flat, comparable rows: one row per KPI, area, year and gender.

- Find KPIs by a word in the Swedish title (`kpiSearch`: "skattesats", "skola", "äldreomsorg") or give their ids (`kpiIds`). The run log lists other matching KPIs with their ids.
- Name areas the way you write them: `"Lund"`, `"Göteborg"`, `"Region Skåne"`, `"Sverige"` or Kolada ids such as `1281`.
- Sensible defaults: every municipality, the latest year with data, the total for both genders. A run with empty input returns population per municipality for the latest year.
- `onlyNew` turns the actor into a monitor: a scheduled run returns only values that are new or revised since the last run.
- Uses the official Kolada API v3. No API key and no scraping of web pages.

### Example from a real run

Input (run OglVl368zhZ0LatJ1, 5 October 2026):

```json
{
  "kpiIds": ["N00901", "N01951"],
  "municipalities": ["Stockholm", "Göteborg", "Malmö", "Lund", "Region Skåne"],
  "years": ["2024", "2025"],
  "gender": "all",
  "maxResults": 100
}
```

The run returned 38 rows: the municipal tax rate for the four municipalities in both years (Region Skåne has no municipal tax rate) and the population for all five areas, split by gender. The first tax rate rows for 2025 were Stockholm 18.22, Malmö 21.24, Lund 21.24 and Göteborg 21.12. One full row, unchanged:

```json
{
  "kpiId": "N01951",
  "kpiTitle": "Invånare totalt, antal",
  "kpiDescription": "Antal invånare totalt den 31/12. Källa: SCB.",
  "operatingArea": "Befolkning",
  "perspective": "Volymer",
  "municipalityId": "0012",
  "municipalityName": "Region Skåne",
  "municipalityType": "region",
  "year": 2025,
  "period": "2025",
  "gender": "female",
  "value": 719253,
  "status": null,
  "source": "Källa: Kolada (RKA), kolada.se",
  "license": "Kolada API terms: free of charge, no agreement needed, commercial use allowed. Credit the source as 'Källa: Kolada'; do not name Kolada as the source of your own processed figures (kolada.se/om-oss/api).",
  "retrievedAt": "2026-10-05T05:40:13.337Z"
}
```

With `{"kpiSearch": "skattesats"}` the actor chose `N00900` (Skattesats, totalt), `N00901` (Skattesats till kommun) and `N00902` (Skattesats till region), found 2026 as the latest year and returned the first 50 rows, starting with `"municipalityName": "Upplands Väsby", "year": 2026, "value": 31.75`. With empty input the first row was `"municipalityName": "Upplands Väsby", "year": 2025, "value": 50495` (population).

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `kpiIds` | array of strings | | Kolada KPI ids, for example `N01951` (population) or `N00901` (municipal tax rate). |
| `kpiSearch` | string | | A word in the Swedish KPI title. Used when `kpiIds` is empty. |
| `maxKpis` | integer | `3` | How many of the best matching KPIs to use with `kpiSearch`. 1 to 25. |
| `municipalities` | array of strings | all | Names or ids of municipalities, regions or `Sverige` (id `0000`). |
| `municipalityType` | string | `municipality` | When `municipalities` is empty: `municipality`, `region` (21 regions and the whole country) or `all`. |
| `years` | array of strings | latest | Years such as `["2024", "2025"]`. Empty means the latest year with data for each KPI. |
| `gender` | string | `total` | `total`, `female`, `male` or `all`. Only matters for KPIs that Kolada splits by gender. |
| `onlyNew` | boolean | `false` | Return only values that earlier runs with the same input did not deliver. |
| `maxResults` | integer | `50` | Maximum number of rows. 1 to 100 000. |

Without `kpiIds` and `kpiSearch` the actor uses `N01951` (Invånare totalt, antal: population on 31 December).

Search tips: KPI titles are in Swedish. Useful words are `skattesats` (tax rate), `invånare` (inhabitants), `grundskola`, `gymnasieskola`, `förskola`, `äldreomsorg`, `hemtjänst`, `ekonomiskt bistånd` (social assistance), `arbetslöshet` (unemployment), `nettokostnad` (net cost) and `avfall` (waste). Titles that start with the word rank first.

### Output

| Field | Description |
|---|---|
| `kpiId` | Kolada KPI id, for example `N00901` |
| `kpiTitle` | KPI title in Swedish, with the unit in brackets, for example `Skattesats till kommun (%)` |
| `kpiDescription` | Kolada's description of the KPI, including the original source |
| `operatingArea` | Kolada's subject area, for example `Befolkning` or `Kommunen, övergripande` |
| `perspective` | Kolada's perspective: `Resurser`, `Volymer`, `Kvalitet och resultat` or `Övrigt` |
| `municipalityId` | Kolada area id: four digits, `0000` is the whole country |
| `municipalityName` | Municipality or region name, for example `Lund` or `Region Skåne` |
| `municipalityType` | `municipality`, `region` or `country` |
| `year`, `period` | The year the value refers to, as a number and as text |
| `gender` | `total`, `female` or `male` |
| `value` | The number |
| `status` | Kolada's status code for the value when it has one, otherwise `null` |
| `source`, `license` | Source credit and the terms of use |
| `retrievedAt` | When the actor fetched the value (ISO 8601) |

Rows come KPI by KPI and newest year first, ordered by area id within a year. Empty and deleted values are left out and never charged. Kolada's municipality groups (ids starting with `G`) are not included.

### Use cases

- Compare municipalities on tax rates, costs, school results or care quality, for consultants, journalists and analysts.
- Load Kolada KPIs into a spreadsheet, BI tool or database without writing an API client.
- Background figures for a municipality in a tender, a market analysis or a site selection.
- Let an AI agent answer questions such as "which municipalities in Skåne have the highest municipal tax rate" through the Apify MCP server.
- Watch for new releases: Kolada publishes new figures throughout the year as each source agency publishes.

### Monitoring and scheduling

Set `onlyNew` to `true` to use the actor for recurring monitoring. The actor then remembers which values it has delivered for the same input, in a named key-value store in your Apify account (`nightwave-state-kolada-municipal-kpis`, one record per input). Each run returns and charges only values that earlier runs did not deliver. The value itself is part of what is remembered, so when Kolada revises a figure the new value is delivered again. The first run returns everything in the selection. A run without news finishes successfully with 0 rows. In our cloud test, the first run with the input below returned 4 rows and the second returned 0. A second run straight after the first, with `onlyNew` and the same input, returns 0 rows like that and is not charged.

`onlyNew` and `maxResults` are not part of the remembered input, so you can change them without starting over. Leave `years` empty to follow the latest year as new data arrives.

Example: a daily run at 07:00 that tells you when the municipal tax rate for Lund or Malmö changes.

```json
{
  "kpiIds": ["N00901"],
  "municipalities": ["Lund", "Malmö"],
  "years": ["2025", "2026"],
  "onlyNew": true
}
```

In Apify Console, open **Schedules**, create a schedule with the cron expression `0 7 * * *` and add this actor with the input above. The same schedule through the Apify API:

```sh
curl -X POST "https://api.apify.com/v2/schedules?token=<YOUR_TOKEN>" \
  -H "Content-Type: application/json" \
  -d '{"name": "daily-kolada", "cronExpression": "0 7 * * *", "timezone": "Europe/Stockholm", "isEnabled": true, "isExclusive": true,
       "actions": [{"type": "RUN_ACTOR", "actorId": "nightwave-owner~kolada-municipal-kpis",
                    "runInput": {"contentType": "application/json; charset=utf-8", "body": "<the input above as a JSON string>"}}]}'
```

### Limitations

- KPI titles, descriptions, subject areas and area names are in Swedish, as Kolada publishes them. Field names and the rest of the output are in English.
- The latest year differs between KPIs. Tax rates are set in advance, so 2026 is already there; most other figures are for 2025 or earlier. The run log says which year it chose for each KPI.
- Some KPIs exist only for municipalities, some only for regions. If a KPI has no values for the chosen areas, the log says so and the run continues with the next KPI.
- Kolada can revise or remove KPIs without notice. A removed id gives a clear message in the log.
- Unit-level data (single schools or care homes) is not included in this version.

### Data source and license

Data comes from the Kolada API v3 (`https://api.kolada.se/v3`), run by RKA, a non-profit association whose members are the Swedish state and Sveriges Kommuner och Regioner (SKR). The terms of use on [kolada.se/om-oss/api](https://kolada.se/om-oss/api/) say, in Swedish:

> Utnyttjande av data från Koladas API är avgiftsfritt och kräver inget avtal. Om du använder data från Kolada i en tjänst, ska källan anges ('Källa: Kolada'). Gör du egna bearbetningar på vår data, får inte Kolada anges som källa. Det är tillåtet att använda vår data för kommersiella ändamål.

In English: use of data from the Kolada API is free of charge and needs no agreement; if you use Kolada data in a service you must credit the source ("Källa: Kolada"); if you process the data yourself, you may not name Kolada as the source of the result; commercial use is allowed. The terms also say that the service is provided as is, that data may be revised without notice, and that a third-party service may not be presented as an official cooperation or partnership with RKA or Kolada.

This actor passes the values on unchanged and puts the credit in every row (`source`). It is made by Nightwave AB and is not affiliated with or endorsed by RKA or Kolada.

### Pricing

Pay per event: USD 0.001 per row (`data-point`), that is USD 1 per 1 000 values. A run with the default 50 rows costs USD 0.05. Empty values and municipality groups are never charged, and `onlyNew` runs charge only new values.

Rows are delivered only after they have been charged. If you set a maximum cost per run (maxTotalChargeUsd), the run stops there and its status message says how many rows were delivered.

### Contact

Nightwave AB, kontakt@nightwave.se. Report problems in the Issues tab of this actor.

### På svenska

Nyckeltal för Sveriges 290 kommuner, 21 regioner och riket från Kolada (RKA): befolkning, skattesatser, skola, äldreomsorg, socialtjänst, kostnader, miljö och omkring 5 800 andra nyckeltal. Varje värde blir en rad med nyckeltal, kommun eller region, år, kön och värde, så att kommuner går att jämföra direkt i Excel, BI-verktyg eller en databas.

- Sök nyckeltal med ett ord i titeln (`kpiSearch`, till exempel "skattesats", "grundskola" eller "äldreomsorg") eller ange id:n (`kpiIds`, till exempel `N01951` för invånare och `N00901` för skattesats till kommun). Körningsloggen visar andra träffar med id.
- Ange kommuner och regioner med namn ("Lund", "Region Skåne", "Sverige") eller Kolada-id. Tomt betyder alla kommuner, eller alla regioner med `municipalityType: "region"`.
- Utan år hämtas det senaste året med data för varje nyckeltal. Utan input hämtas folkmängden per kommun.
- Med `onlyNew: true` levereras bara värden som är nya eller reviderade sedan förra körningen med samma input. Det passar för schemalagda körningar (se "Monitoring and scheduling").
- Källa och villkor: Koladas API är avgiftsfritt, kräver inget avtal och får användas kommersiellt. Källan ska anges som "Källa: Kolada", och egna bearbetningar får inte anges med Kolada som källa. Källan följer med i varje rad. Nightwave AB har inget samarbete med RKA eller Kolada.
- Pris: 0,001 USD per rad (händelsen `data-point`), 1 USD per 1 000 värden. Tomma värden debiteras aldrig.
- Kontakt: kontakt@nightwave.se

# Actor input Schema

## `kpiIds` (type: `array`):

Kolada KPI ids, for example N01951 (population), N00901 (municipal tax rate) or N20014 (net cost of elderly care per inhabitant). Leave empty and use kpiSearch to find KPIs by keyword. With neither, population (N01951) is used.

## `kpiSearch` (type: `string`):

A word in the Swedish KPI title, for example "skattesats" (tax rate), "skola" (school), "äldreomsorg" (elderly care) or "arbetslöshet" (unemployment). The best matches are used (see maxKpis) and the run log lists the others with their ids. Ignored when kpiIds is set.

## `maxKpis` (type: `integer`):

How many of the best matching KPIs to use when searching with kpiSearch, for example 3. 1 to 25, defaults to 3.

## `municipalities` (type: `array`):

Names or Kolada ids, for example "Lund", "Göteborg", "Region Skåne", "1281" or "Sverige" (the whole country, id 0000). Empty means every area of the chosen municipalityType.

## `municipalityType` (type: `string`):

Which areas to return when municipalities is empty: municipality (the 290 kommuner), region (the 21 regions and the whole country) or all. Also decides whether "Stockholm" means the municipality or the region.

## `years` (type: `array`):

Years to fetch, for example \["2023", "2024", "2025"]. Empty means the latest year with data for each KPI.

## `gender` (type: `string`):

For KPIs split by gender: total (default), female, male or all three. KPIs without a split always return the total.

## `onlyNew` (type: `boolean`):

For scheduled runs: return and charge only values that earlier runs with the same input have not returned, including values Kolada has revised, for example true for a monthly schedule. The first run returns everything in the selection. Defaults to false.

## `maxResults` (type: `integer`):

Maximum number of values (rows), for example 50. Each row is one billable event. 1 to 100 000, defaults to 50.

## Actor input object example

```json
{
  "kpiIds": [
    "N01951",
    "N00901"
  ],
  "kpiSearch": "skattesats",
  "maxKpis": 3,
  "municipalities": [
    "Stockholm",
    "Göteborg",
    "Malmö"
  ],
  "municipalityType": "region",
  "years": [
    "2024",
    "2025"
  ],
  "gender": "all",
  "onlyNew": true,
  "maxResults": 50
}
```

# Actor output Schema

## `results` (type: `string`):

All values returned by the run, one row per KPI, municipality or region, year and gender, as JSON. Open in Apify Console or download via the dataset API.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "kpiSearch": "skattesats",
    "maxKpis": 3,
    "municipalityType": "municipality",
    "gender": "total",
    "onlyNew": false,
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("nightwave-owner/kolada-municipal-kpis").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "kpiSearch": "skattesats",
    "maxKpis": 3,
    "municipalityType": "municipality",
    "gender": "total",
    "onlyNew": False,
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("nightwave-owner/kolada-municipal-kpis").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "kpiSearch": "skattesats",
  "maxKpis": 3,
  "municipalityType": "municipality",
  "gender": "total",
  "onlyNew": false,
  "maxResults": 50
}' |
apify call nightwave-owner/kolada-municipal-kpis --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,nightwave-owner/kolada-municipal-kpis"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/667KhUw4ILYrEoSHT/builds/pBAboy39GRv9zWXju/openapi.json
