# Nordic Statistics: Sweden, Norway, Denmark, Finland (SCB, SSB) (`nightwave-owner/nordic-statistics`) Actor

Returns official statistics (population, prices, labour market and any other table) from Statistics Sweden (SCB), Statistics Norway (SSB), Statistics Denmark and Statistics Finland, one row per value with region, measure and period. Find tables by keyword or id. Supports onlyNew for scheduled runs.

- **URL**: https://apify.com/nightwave-owner/nordic-statistics.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 data points

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

## Nordic Statistics: Sweden, Norway, Denmark, Finland (SCB, SSB)

Official statistics from the four Nordic statistics agencies through their open APIs: Statistics Sweden (SCB), Statistics Norway (SSB), Statistics Denmark (Danmarks Statistik, StatBank) and Statistics Finland (Tilastokeskus, StatFin). Any table in their databases: population, prices, wages, labour market, housing, energy, trade, business and more. Every value comes back as one row in the same long format, whichever agency it comes from.

- Find a table by keyword (`searchText`) or give its id (`tableId`). The run log lists other matching tables with their ids.
- Choose values by code or by label: `"Region": ["Stockholm", "Göteborg"]` works as well as `["0180", "1480"]`.
- Sensible defaults: the latest period, every region, the first measure and the total for other variables. A run with empty input returns population per municipality in Sweden.
- `onlyNew` turns the actor into a monitor: a scheduled run returns only values published since the last run.
- Labels in English, Swedish, Norwegian, Danish or Finnish.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `agency` | string | `scb` | `scb` (Sweden), `ssb` (Norway), `dst` (Denmark) or `statfin` (Finland). |
| `tableId` | string | | The agency's table id, for example `TAB628`, `07459`, `FOLK1A` or `vaerak/11ra`. |
| `searchText` | string | | Keywords to find a table, used when `tableId` is empty. |
| `selection` | object | see below | Variable -> values. Codes or labels, `"*"` for all, `"top(3)"` for the latest three periods, `"from(2020)"` for every period from 2020. |
| `language` | string | `en` | `en`, `sv`, `no`, `da` or `fi`. Falls back to English if the agency does not publish in that language. |
| `onlyNew` | boolean | `false` | Return only values that earlier runs with the same input did not deliver. |
| `maxResults` | integer | `50` | Maximum number of data points (rows). 1 to 100 000. |

Without `tableId` and `searchText` the actor uses a population-by-region table: `TAB628` (SCB), `07459` (SSB), `FOLK1A` (Statistics Denmark) or `vaerak/11ra` (Statistics Finland).

#### Selection defaults

Every statistics table is a cube of variables (region, sex, age, measure, time and so on). For each variable you do not set in `selection`:

- **Time:** the latest period.
- **Region:** all regions (country, counties or regions and municipalities, as the table has them).
- **Measure** (`ContentsCode`, `Tiedot`, `Indhold`): the first measure in the table.
- **Other variables:** left out, so the agency returns the total. When a variable cannot be left out, its first value is used and the log says so.

Variables are matched by code (`Tid`, `Region`, `Kon`) or label (`year`, `region`, `sex`). `time` and `region` always find the table's time and region variables.

#### Table ids

| Agency | Id format | Where to find ids |
|---|---|---|
| Statistics Sweden | `TAB628` | `searchText`, or the [Statistical Database](https://www.statistikdatabasen.scb.se/pxweb/en/ssd/). Older names such as `BefolkningNy` are looked up by search. |
| Statistics Norway | `07459` | `searchText`, or the number in a [StatBank](https://www.ssb.no/en/statbank) table title |
| Statistics Denmark | `FOLK1A` | `searchText`, or [StatBank Denmark](https://www.statbank.dk) |
| Statistics Finland | `vaerak/11ra` or `11ra` | `searchText`, or the code at the start of a [StatFin](https://pxdata.stat.fi/PxWeb/pxweb/en/StatFin/) table title |

Example input:

```json
{
  "agency": "dst",
  "searchText": "unemployment",
  "selection": { "time": ["top(3)"] },
  "maxResults": 50
}
```

### Output

| Field | Description |
|---|---|
| `agency` | `scb`, `ssb`, `dst` or `statfin` |
| `agencyName` | Statistics Sweden, Statistics Norway, Statistics Denmark or Statistics Finland |
| `tableId` | Table id at the agency |
| `tableTitle` | Table title |
| `region`, `regionCode` | Region label and code, `null` if the table has no region variable |
| `measure`, `measureCode` | What is measured (the table's contents variable) |
| `period` | `2025`, `2026-08` (monthly), `2026-Q3` (quarterly), `2026-W12` (weekly) |
| `periodCode` | The agency's own period code, for example `2026K3` or `2026M08` |
| `frequency` | `annual`, `quarterly`, `monthly`, `weekly`, `daily` or `other` |
| `value` | The number |
| `unit` | Unit as given by the agency, for example `number`, `Per cent`, `index point` |
| `status` | The agency's status symbol for the value (provisional, confidential), otherwise `null` |
| `dimensions` | Every variable of the row as label -> value label, for example `{"sex": "total"}` |
| `dimensionCodes` | Every variable of the row as code -> value code |
| `lastUpdated` | When the agency last updated the table (ISO 8601) |
| `source`, `license` | Source credit and license to use when you publish the data |
| `tableUrl` | Link to the table at the agency |

Rows come newest period first. Empty cells are left out and never charged.

Extract from a cloud run on 3 October 2026 with empty input (312 rows, population per region in Sweden for 2025):

```json
{
  "agency": "scb",
  "agencyName": "Statistics Sweden",
  "tableId": "TAB628",
  "tableTitle": "Population density per sq. km, population and land area by region and sex. Year 1991-2025",
  "region": "Stockholm county",
  "regionCode": "01",
  "measure": "Population",
  "measureCode": "BE0101U2",
  "period": "2025",
  "periodCode": "2025",
  "frequency": "annual",
  "value": 2486251,
  "unit": "number",
  "status": null,
  "dimensions": { "region": "Stockholm county", "sex": "total", "observations": "Population", "year": "2025" },
  "dimensionCodes": { "Region": "01", "Kon": "1+2", "ContentsCode": "BE0101U2", "Tid": "2025" },
  "lastUpdated": "2026-02-24T07:00:00Z",
  "source": "Source: Statistics Sweden",
  "license": "CC0 1.0 (Statistics Sweden)",
  "tableUrl": "https://statistikdatabasen.scb.se/api/v2/tables/TAB628/metadata?lang=en"
}
```

From `{"agency": "ssb"}` (Norway, population per county and municipality for 2026):

```json
{
  "agency": "ssb",
  "tableId": "07459",
  "tableTitle": "07459: Population, by sex and one-year age groups (M) 1986-2026",
  "region": "Østfold",
  "regionCode": "31",
  "measure": "Persons",
  "period": "2026",
  "value": 316448,
  "unit": "number",
  "license": "CC BY 4.0 (Statistics Norway), source must be acknowledged"
}
```

From the Danish example input above, the actor chose table `AUP01` and returned the unemployment rate per region for the latest three months; the first row is `"region": "All Denmark", "period": "2026-08", "value": 3.1, "unit": "Per cent"`.

### Example from a real run

Input:

```json
{
  "searchText": "population",
  "maxResults": 5
}
```

Output (first 3 of 5 rows, values unchanged):

```json
[
  {
    "agency": "scb",
    "agencyName": "Statistics Sweden",
    "tableId": "TAB6473",
    "tableTitle": "Population statistics by region and sex. Month 2025M01-2026M07",
    "region": "Sweden",
    "regionCode": "00",
    "measure": "Population",
    "measureCode": "000007SR",
    "period": "2026-07",
    "periodCode": "2026M07",
    "frequency": "monthly",
    "value": 10613531,
    "unit": "number",
    "status": null,
    "dimensions": {
      "region": "Sweden",
      "population changes": "population",
      "observations": "Population",
      "month": "2026M07"
    },
    "dimensionCodes": {
      "Region": "00",
      "Forandringar": "100",
      "ContentsCode": "000007SR",
      "Tid": "2026M07"
    },
    "lastUpdated": "2026-09-07T06:00:00Z",
    "source": "Source: Statistics Sweden",
    "license": "CC0 1.0 (Statistics Sweden)",
    "tableUrl": "https://statistikdatabasen.scb.se/api/v2/tables/TAB6473/metadata?lang=en"
  },
  {
    "agency": "scb",
    "agencyName": "Statistics Sweden",
    "tableId": "TAB6473",
    "tableTitle": "Population statistics by region and sex. Month 2025M01-2026M07",
    "region": "Stockholm county",
    "regionCode": "01",
    "measure": "Population",
    "measureCode": "000007SR",
    "period": "2026-07",
    "periodCode": "2026M07",
    "frequency": "monthly",
    "value": 2496136,
    "unit": "number",
    "status": null,
    "dimensions": {
      "region": "Stockholm county",
      "population changes": "population",
      "observations": "Population",
      "month": "2026M07"
    },
    "dimensionCodes": {
      "Region": "01",
      "Forandringar": "100",
      "ContentsCode": "000007SR",
      "Tid": "2026M07"
    },
    "lastUpdated": "2026-09-07T06:00:00Z",
    "source": "Source: Statistics Sweden",
    "license": "CC0 1.0 (Statistics Sweden)",
    "tableUrl": "https://statistikdatabasen.scb.se/api/v2/tables/TAB6473/metadata?lang=en"
  },
  {
    "agency": "scb",
    "agencyName": "Statistics Sweden",
    "tableId": "TAB6473",
    "tableTitle": "Population statistics by region and sex. Month 2025M01-2026M07",
    "region": "Upplands Väsby",
    "regionCode": "0114",
    "measure": "Population",
    "measureCode": "000007SR",
    "period": "2026-07",
    "periodCode": "2026M07",
    "frequency": "monthly",
    "value": 50829,
    "unit": "number",
    "status": null,
    "dimensions": {
      "region": "Upplands Väsby",
      "population changes": "population",
      "observations": "Population",
      "month": "2026M07"
    },
    "dimensionCodes": {
      "Region": "0114",
      "Forandringar": "100",
      "ContentsCode": "000007SR",
      "Tid": "2026M07"
    },
    "lastUpdated": "2026-09-07T06:00:00Z",
    "source": "Source: Statistics Sweden",
    "license": "CC0 1.0 (Statistics Sweden)",
    "tableUrl": "https://statistikdatabasen.scb.se/api/v2/tables/TAB6473/metadata?lang=en"
  }
]
```

Run M7rEaIzhH4ob294jR on 2026-10-04, 5 rows, 6 seconds.

### Use cases

- Municipality and regional data for market analysis, site selection and sales territories in the Nordics.
- Comparing Sweden, Norway, Denmark and Finland in one dataset: run the actor once per agency with the same output schema.
- Feeding official statistics to an AI agent through the Apify MCP server: search by keyword, small default results, stable field names.
- Watching for new releases: a scheduled run with `onlyNew` tells you when a new month or year has been published.

### 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-nordic-statistics`, one record per input). Each run returns and charges only values that earlier runs did not deliver. 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 value is identified by agency, table and the codes of all its variables. A revised value for a period you already have is not delivered again; run without `onlyNew` to get the current values. `onlyNew` and `maxResults` are not part of the remembered input, so you can change them without starting over.

Example: a daily run at 07:00 that tells you when Statistics Norway publishes new population figures for Oslo and the whole country. In Apify Console, open **Schedules**, create a schedule with the cron expression `0 7 * * *` and add this actor with the input below. Use `top(n)` for time so the window follows new releases.

```json
{
  "agency": "ssb",
  "tableId": "07459",
  "selection": { "Region": ["0", "0301"], "Tid": ["top(2)"] },
  "onlyNew": true
}
```

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-nordic-statistics", "cronExpression": "0 7 * * *", "timezone": "Europe/Stockholm", "isEnabled": true, "isExclusive": true,
       "actions": [{"type": "RUN_ACTOR", "actorId": "nightwave-owner~nordic-statistics",
                    "runInput": {"contentType": "application/json; charset=utf-8", "body": "<the input above as a JSON string>"}}]}'
```

### Good to know

- **One table per run.** Run the actor once per agency or table and append the datasets; the schema is the same.
- **Search takes the best match.** `searchText` ranks tables by how many of your words the title contains, then by the most recent update. Check `tableTitle` and the run log, and set `tableId` once you know the table you want.
- **Size limits.** The agencies cap how many cells one request may return (for example 150 000 at Statistics Sweden). Larger selections stop with a message asking for fewer values. `maxResults` limits the rows that are delivered and charged.
- **Rate limits are respected.** Statistics Sweden allows 30 calls per 10 seconds and Statistics Finland 40 per minute; a run makes 2-4 calls. Failed requests are retried three times.
- **Historical regions.** Some tables keep merged or abolished municipalities as rows; their values for recent years are 0 or empty. Empty cells are left out, zeros are kept because the agencies use them for real values too.
- **Statistics Sweden from 2025:** SCB adds a small controlled random uncertainty to new figures to protect individuals, so totals may differ slightly from the sum of their parts (see the table note at SCB).
- The actor fetches public statistics only, through the agencies' official APIs. No personal data, no login and no scraping of web pages.
- This is statistical data, not investment advice.

### Data sources and licenses

- **Statistics Sweden (SCB)**, PxWebApi 2.0 (`statistikdatabasen.scb.se/api/v2`). Open data under [CC0 1.0](https://creativecommons.org/publicdomain/zero/1.0/), as stated in the API configuration. Credit "Source: Statistics Sweden" is appreciated.
- **Statistics Norway (SSB)**, PxWebApi 2.0 (`data.ssb.no/api/pxwebapi/v2`). [CC BY 4.0](https://www.ssb.no/en/diverse/lisens): credit "Source: Statistics Norway" when you publish the data.
- **Statistics Denmark**, StatBank API (`api.statbank.dk/v1`). Free to use, also commercially, with source reference, which corresponds to CC BY 4.0 (see [Statistics Denmark source references](https://www.dst.dk/en/Statistik/brug-statistikken/kildeangivelse)). Credit "Source: Statistics Denmark".
- **Statistics Finland**, PxWeb API (`pxdata.stat.fi/PxWeb/api/v1`). [CC BY 4.0](https://stat.fi/en/about-us/get-to-know-statistics-finland/legislation/terms-of-use): credit "Source: Statistics Finland".

Each row carries `source` and `license`, so the credit travels with the data. This actor is not affiliated with any of the agencies.

### Pricing

Pay per event: you pay for each data point (row) in the dataset, event `data-point`. Empty cells are never charged, and with `onlyNew` you pay only for new rows. The price per data point is shown on the actor's Pricing tab in Apify Store. The empty-input example above is 312 data points with `maxResults` set to 400, or 50 with the default.

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

Built and maintained by Nightwave AB. Questions, bugs and feature requests: kontakt@nightwave.se

### På svenska

Actorn hämtar officiell statistik från SCB, Statistisk sentralbyrå i Norge (SSB), Danmarks Statistik och Statistikcentralen i Finland via deras öppna API:er. Alla tabeller i databaserna går att hämta, och varje värde blir en rad i samma format oavsett land.

Exempel från en verklig körning: input och de första raderna i outputen finns i avsnittet Example from a real run ovan (körning M7rEaIzhH4ob294jR, 2026-10-04, 5 rader, 6 sekunder).

- Välj myndighet med `agency` (`scb`, `ssb`, `dst` eller `statfin`) och tabell med `tableId`, eller sök med `searchText` (till exempel "konsumentprisindex" med `language: "sv"`).
- `selection` anger vilka värden du vill ha, med koder eller namn: `{"Region": ["Stockholm", "Göteborg"], "Tid": ["top(5)"]}`. Utan urval får du senaste perioden, alla regioner, första måttet och totalen för övriga variabler.
- Tom input ger folkmängd per kommun och län i Sverige för senaste året. `maxResults` är som standard 50.
- Med `onlyNew: true` levereras bara värden som tidigare körningar med samma input inte har levererat, till exempel en ny månad. Det passar för schemalagda körningar (se "Monitoring and scheduling").
- Licenser: SCB CC0, SSB, Danmarks Statistik och Statistikcentralen CC BY 4.0. Ange källan när du publicerar datan; den följer med i varje rad.
- Pris per datapunkt (rad) i datasetet, händelsen `data-point`. Tomma celler debiteras aldrig.
- Kontakt: kontakt@nightwave.se

# Actor input Schema

## `agency` (type: `string`):

Which national statistics agency to query: scb (Statistics Sweden), ssb (Statistics Norway), dst (Statistics Denmark) or statfin (Statistics Finland). Defaults to scb.

## `tableId` (type: `string`):

The agency's table id. Examples: TAB628 (SCB), 07459 (SSB), FOLK1A (Statistics Denmark), vaerak/11ra (Statistics Finland). Leave empty and use searchText to find a table. With neither, a population-by-region table is used.

## `searchText` (type: `string`):

Keywords to find a table when you do not know its id, for example "consumer price index" or "unemployment". The best match is used and the run log lists other matching table ids. Ignored when tableId is set.

## `selection` (type: `object`):

Which values to fetch, as variable -> list of values. Variables and values can be given by code or label. Use "\*" for all values, "top(3)" for the latest three periods and "from(2020)" for every period from 2020. Defaults: the latest period, every region, the first measure, and the total for other variables. Example: {"Region": \["0180", "1480"], "Tid": \["top(5)"]}.

## `language` (type: `string`):

Language of labels and titles: en (all agencies), sv (SCB, Statistics Finland), no (SSB), da (Statistics Denmark) or fi (Statistics Finland). Falls back to English when the agency does not publish in the chosen language.

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

For scheduled runs: return and charge only values that earlier runs with the same input have not returned, for example a newly published month. The first run returns everything in the selection.

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

Maximum number of data points. Each data point (one cell of the table) is one row and one billable event. Example: 50.

## Actor input object example

```json
{
  "agency": "scb",
  "tableId": "TAB628",
  "searchText": "consumer price index",
  "selection": {
    "Region": [
      "0180",
      "1480"
    ],
    "Tid": [
      "top(5)"
    ]
  },
  "language": "en",
  "onlyNew": false,
  "maxResults": 50
}
```

# Actor output Schema

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

All values returned by the run, one row per cell of the statistics table (region, measure, period and any other variable), 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 = {
    "agency": "scb",
    "maxResults": 50
};

// Run the Actor and wait for it to finish
const run = await client.actor("nightwave-owner/nordic-statistics").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 = {
    "agency": "scb",
    "maxResults": 50,
}

# Run the Actor and wait for it to finish
run = client.actor("nightwave-owner/nordic-statistics").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 '{
  "agency": "scb",
  "maxResults": 50
}' |
apify call nightwave-owner/nordic-statistics --silent --output-dataset

```

## MCP server setup

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

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/XP3OeHV5paIQVLDbM/builds/msSjw99BuMjThDczU/openapi.json
