# Swedish Official Statistics Lookup (SCB) (`fabriken2026/swedish-statistics-lookup`) Actor

Swedish official statistics from SCB: inflation (CPI), unemployment, GDP, population, salaries, house prices. Every answer cites the exact source table.

- **URL**: https://apify.com/fabriken2026/swedish-statistics-lookup.md
- **Developed by:** [David](https://apify.com/fabriken2026) (community)
- **Categories:** AI, Automation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$2.00 / 1,000 successful statistics lookups

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/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js/docs.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python/docs.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## Swedish Official Statistics Lookup (SCB)

**Verified official source - never hallucinated.** Every number this
Actor returns is fetched live from **Statistics Sweden (SCB)**, Sweden's
national statistics office, and is delivered together with the exact
official table it came from - so your agent, dashboard or report can cite
its source.

### Why this Actor?

LLMs confidently make up Swedish statistics - last month's inflation, a
municipality's population, the average salary for an occupation. Generic
AI web search is little better: it quotes whichever blog post ranks
first, often outdated or misread. The real numbers live in SCB's official
database, which updates monthly and is unknown territory for a model's
training data. This Actor answers a **curated menu of the most-asked
questions** by querying SCB's official open API directly.

### Features

- **Get the current inflation rate in Sweden** (CPI and CPIF, 12-month
  change) - the number as SCB publishes it, not as a model remembers it.
- **Look up Sweden's unemployment rate** - seasonally adjusted and
  unadjusted, from the official Labour Force Survey (LFS).
- **Get Swedish GDP growth figures** from the national accounts.
- **Look up the population of any Swedish municipality or county** -
  down to 4-digit municipality codes (e.g. `0180` = Stockholm).
- **Find the average salary for an occupation in Sweden** by 4-digit
  SSYK 2012 occupation code.
- **Check Swedish house prices and the real estate price index**, plus
  births, deaths, migration and new dwellings.
- **Every answer cites the exact SCB table** - table id, table name and
  last-updated timestamp included in every result.
- **No AI in the loop, injection-safe** - question ids and parameter
  codes are validated against strict patterns; no free text ever reaches
  the source.

### Use cases

- **AI agents and chatbots that quote real numbers:** ground answers
  about the Swedish economy in cited official statistics instead of
  hallucinations - at $0.002 per verified answer.
- **Reports and client deliverables:** pull inflation, salaries or
  population with a source line auditors and clients can check.
- **Dashboards that stay fresh:** schedule lookups for the mornings SCB
  publishes and keep KPIs current automatically.
- **Market sizing and site selection:** population and housing figures
  per municipality, straight from the source.
- **Index-linked business logic:** fetch the latest CPI series input for
  rent or contract calculations (verify against the cited table for
  legally binding uses).

### Input

```json
{
    "question": "inflation",
    "period": "latest",
    "region": "0180",
    "occupationCode": "2512"
}
````

`question` is required (pick from the menu in the input form). `period`
is optional: `latest` (default) or an exact period matching the
question's frequency (`2025`, `2026M05`, `2026K1`). `region` (for
population/housing questions) takes `00` = whole country, a 2-digit
county code or a 4-digit municipality code (`0180` = Stockholm).
`occupationCode` (for salary questions) takes a 4-digit SSYK 2012 code.

### Output (dataset item)

```json
{
    "ok": true,
    "question": "inflation",
    "description": "Inflationstakten enligt KPI (förändring senaste 12 månaderna)",
    "unit": "procent",
    "values": [{"label": "Årsförändring", "value": 0.8, "period": "2026M05"}],
    "period": "2026M05",
    "tableId": "TAB6596",
    "tableName": "Konsumentprisindex (KPI), totalt, 2020=100. Månad",
    "source": "SCB - Statistics Sweden (api.scb.se, PxWebApi 2)",
    "license": "CC0 1.0",
    "sourceUpdated": "2026-06-11T06:00:00Z"
}
```

Some questions return several values (e.g. salary for men and women, or
seasonally adjusted plus unadjusted unemployment) - one entry per value,
clearly labelled.

### Pricing (pay-per-event)

| Event | Price | When |
|---|---|---|
| `statistics-lookup` | $0.002 | Per successful lookup |

Unknown questions and invalid parameters are free. 1,000 verified
statistics cost $2 - cheaper than one hallucinated number in a client
report. No subscription, no minimum.

**Tip:** combine with Apify Schedules to keep a dashboard or agent
memory fresh (e.g. re-fetch inflation and unemployment on the mornings
SCB publishes).

### FAQ

**What is the current inflation rate in Sweden?**
Ask this Actor with `{"question": "inflation"}` and you get the latest
official 12-month CPI change, with period and source table - not a
guess.

**Which questions can it answer?**
21 curated questions against 10 verified SCB tables: CPI/CPIF inflation,
unemployment and employment (LFS), GDP, population down to municipality
level, births/deaths/migration, salaries by occupation (SSYK), the real
estate price index, house prices and new dwellings. It is deliberately
not a general SCB browser - predictable answers, predictable cost.
Missing a question you need? Request it.

**Is SCB data free to use commercially?**
Yes - SCB publishes under CC0 1.0 (public domain), which the Actor
passes through in every result. You pay $0.002 for the packaging:
validated queries, stable JSON and a cited source.

**Can numbers change after publication?**
SCB revises some series (e.g. labour force survey, national accounts).
A number can therefore change at the source after first publication -
each result carries `sourceUpdated` so you can see the vintage.

**Can my AI agent use this?**
Yes - that is the core use case. Compact, flat JSON with a citation,
callable via the Apify API or MCP, cheap enough to call on every user
question.

**What happens for small regions or rare occupations?**
SCB suppresses detail for small groups; the Actor then returns a clear
"no data" answer instead of a made-up number - and you are not charged.

### Permissions & security

This Actor runs with Apify's **limited permissions** model: it reads its
own input, writes to its own default dataset and calls SCB's open API
over HTTPS - nothing else. No API key is needed anywhere, and it requests
no access to your other Actors, storages or account data.

### Data source & license

Data comes from **Statistics Sweden (SCB)**, Sweden's national
statistics office, via its open PxWebApi 2. The data license is
**CC0 1.0 (public domain)** - free reuse, including commercial. SCB is
credited as the source in every result. This Actor is independent and
not affiliated with or endorsed by Statistics Sweden.

### Terms of use

- **Business use only.** This Actor is intended exclusively for use in
  the course of business (B2B). By using it you confirm you are acting
  as a business, not a consumer.
- **As is.** The service and all data are provided "as is", without
  warranties of any kind - no guarantee of accuracy, completeness,
  timeliness or availability. Statistics are exactly what SCB publishes
  at lookup time and may be revised by SCB afterwards.
- **Liability cap.** Total aggregate liability for all claims in any
  12-month period is limited to the amount you paid for the service in
  that period. No liability for indirect or consequential damages, lost
  profits, lost business opportunities or lost data. Nothing in these
  terms limits liability that cannot lawfully be limited.
- **Fair use.** No bulk re-selling of raw data, no circumventing rate
  limits, no use that violates SCB's terms. The Actor makes one source
  call per lookup and must not be used to mass-download SCB's database.
- **Privacy.** All statistics are aggregated (sums, averages, index
  numbers for groups) - no personal data is processed, requested or
  returned.

### Versioning & support

Versions are locked - the Actor never silently changes behaviour under
you. Changes are released as new versions with a changelog entry.

Part of the **Swedish Data Tools** family: company lookup, company
financials, new company registrations, public procurement search and
official statistics - all built on official Swedish and EU data sources.

#### Changelog

- **0.1** - initial release: 21 curated questions against 10 verified
  SCB tables (CPI/CPIF, LFS, GDP, population, salaries, housing),
  pay-per-lookup pricing.

# Actor input Schema

## `question` (type: `string`):

Which curated statistic to look up. Each question maps to one verified SCB table.

## `period` (type: `string`):

Optional. <code>latest</code> (default) or an exact period matching the question's frequency: year <code>2025</code>, month <code>2026M05</code>, quarter <code>2026K1</code>.

## `region` (type: `string`):

Optional, for region questions: <code>00</code> whole country (default), 2-digit county code (<code>01</code> Stockholm county) or 4-digit municipality code (<code>0180</code> Stockholm). The house price index uses its own codes: <code>0010</code> Greater Stockholm, <code>0020</code> Greater Gothenburg, <code>0030</code> Greater Malmö, <code>RIKS1</code>-<code>RIKS8</code>.

## `occupationCode` (type: `string`):

Optional, for salary questions: 4-digit SSYK 2012 code, e.g. <code>2512</code> software developers. Default <code>0000</code> = all occupations.

## Actor input object example

```json
{
  "question": "inflation"
}
```

# 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 = {
    "question": "inflation"
};

// Run the Actor and wait for it to finish
const run = await client.actor("fabriken2026/swedish-statistics-lookup").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 = { "question": "inflation" }

# Run the Actor and wait for it to finish
run = client.actor("fabriken2026/swedish-statistics-lookup").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{
  "question": "inflation"
}' |
apify call fabriken2026/swedish-statistics-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=fabriken2026/swedish-statistics-lookup",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "Swedish Official Statistics Lookup (SCB)",
        "description": "Swedish official statistics from SCB: inflation (CPI), unemployment, GDP, population, salaries, house prices. Every answer cites the exact source table.",
        "version": "0.1",
        "x-build-id": "7jHuHJMzAydsJE4Ss"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/fabriken2026~swedish-statistics-lookup/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-fabriken2026-swedish-statistics-lookup",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/fabriken2026~swedish-statistics-lookup/runs": {
            "post": {
                "operationId": "runs-sync-fabriken2026-swedish-statistics-lookup",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/fabriken2026~swedish-statistics-lookup/run-sync": {
            "post": {
                "operationId": "run-sync-fabriken2026-swedish-statistics-lookup",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "required": [
                    "question"
                ],
                "properties": {
                    "question": {
                        "title": "Question",
                        "enum": [
                            "kpi",
                            "inflation",
                            "kpif",
                            "inflation_kpif",
                            "arbetsloshet",
                            "sysselsattningsgrad",
                            "antal_arbetslosa",
                            "bnp_tillvaxt",
                            "bnp_niva",
                            "befolkning",
                            "befolkning_kon",
                            "fodda",
                            "doda",
                            "invandring",
                            "utvandring",
                            "medellon",
                            "medianlon",
                            "lon_kon",
                            "bostadsprisindex",
                            "smahuspris",
                            "nybyggda_lagenheter"
                        ],
                        "type": "string",
                        "description": "Which curated statistic to look up. Each question maps to one verified SCB table."
                    },
                    "period": {
                        "title": "Period",
                        "type": "string",
                        "description": "Optional. <code>latest</code> (default) or an exact period matching the question's frequency: year <code>2025</code>, month <code>2026M05</code>, quarter <code>2026K1</code>."
                    },
                    "region": {
                        "title": "Region code",
                        "type": "string",
                        "description": "Optional, for region questions: <code>00</code> whole country (default), 2-digit county code (<code>01</code> Stockholm county) or 4-digit municipality code (<code>0180</code> Stockholm). The house price index uses its own codes: <code>0010</code> Greater Stockholm, <code>0020</code> Greater Gothenburg, <code>0030</code> Greater Malmö, <code>RIKS1</code>-<code>RIKS8</code>."
                    },
                    "occupationCode": {
                        "title": "Occupation code (SSYK 2012)",
                        "type": "string",
                        "description": "Optional, for salary questions: 4-digit SSYK 2012 code, e.g. <code>2512</code> software developers. Default <code>0000</code> = all occupations."
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
