# Norway SSB Public Statistics Scraper (`parseforge/norway-ssb-statistics-scraper`) Actor

Scrapes any public dataset from Statistics Norway's Statbank by table ID and returns each row as a flat record with official codes, labels, values, and time period. Supports English and Norwegian output.

- **URL**: https://apify.com/parseforge/norway-ssb-statistics-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Business, Education, Automation
- **Stats:** 2 total users, 1 monthly users, 86.7% runs succeeded, 0 bookmarks
- **User rating**: 5.00 out of 5 stars

## Pricing

from $1.63 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — 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

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Norway SSB Public Statistics Scraper

**Scrape any public dataset from Statistics Norway (SSB) by table ID, up to a million rows per run.** Every row returns the official values, labels, and time periods exactly as published. No API key required. Export to CSV, JSON, Excel, or XML.

Statistics Norway's API returns rich public data on population, economy, labour, and health, but building a PxWeb query by hand is slow and the API rejects requests that ask for too many values at once. This Actor reads any table you specify, handles the pagination and value limits, and returns a clean flat dataset. You only need the table ID from the SSB Statbank.

| Who uses it | What they scrape Statistics Norway (SSB) for |
|---|---|
| Economists and policy analysts | Pull the latest quarterly GDP or employment figures into a model. |
| Journalists and data reporters | Get municipality-level population changes for a regional story. |
| Academic researchers | Collect multi-year health or education statistics for a longitudinal study. |
| Business intelligence teams | Feed consumer price index or retail trade data into a market dashboard. |

### What it does

This Actor collects a public dataset from Statistics Norway by its table ID and returns each row as a flat record with the official codes, labels, values, and time period.

- 🗂️ **Table ID driven:** provide a Statbank table number like 07459 and the Actor fetches it.
- 🌐 **Bilingual output:** request labels and metadata in English or Norwegian (Bokmål).
- 📊 **Smart defaults:** leave the query empty and the Actor returns the newest period with the top values per dimension, avoiding 'Too many values' rejections.
- 🔧 **Custom PxWeb query:** pass a raw JSON query array for full control over which regions, periods, and categories to include.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Statistics Norway (SSB) data

**📈 Monitor economic indicators.**

An economist runs the Actor weekly with table 09190 (CPI) to update an inflation dashboard with the latest monthly index values.

**🗺️ Compare municipalities.**

A journalist fetches table 07459 with a custom query selecting all municipalities and the newest year to map population changes across Norway.

**📚 Build a research dataset.**

A PhD student collects ten years of education attainment data from table 08921 by looping over year periods in the query JSON.

**📊 Feed a business report.**

A BI analyst pulls retail sales turnover from table 07973 each quarter and loads the CSV export into a company-wide Power BI report.

### Why choose this scraper

|  | What you get |
|---|---|
| **Official source** | Data comes directly from Statistics Norway's public API, the same source used by government and research. |
| **No query wrangling** | A minimal default query is built for you so the API accepts the request on the first try. |
| **Full control** | Power users can pass a complete PxWeb query to slice by exact regions, years, and categories. |
| **Flat output** | Every row is a single record with codes, labels, and the value, ready for analysis. |

### How it compares

No other Store actor targets Statistics Norway (SSB) the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Norway SSB Public Statistics Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Statistics Norway (SSB) changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor with a Statistics Norway table ID and an optional PxWeb query JSON. The language selector switches all labels and metadata between English and Norwegian. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "tableId": "07459",
  "maxItems": 10
}
```

A larger pull:

```json
{
  "tableId": "07459",
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0018 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.18 |
| 1,000 results | $1.80 |
| 10,000 results | $18.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Norway SSB Public Statistics Scraper](https://apify.com/parseforge/norway-ssb-statistics-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Statistics Norway (SSB) through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/norway-ssb-statistics-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**The run fails with 'Too many values selected'.**

Your custom query is requesting too many values across one or more dimensions. Reduce the number of selected values per dimension, or remove the query field entirely to use the Actor's safe default selection.

**I get an empty dataset.**

Check that the table ID is correct and that the table is still published on ssb.no. Also verify that your custom query, if provided, uses valid dimension codes and value codes for that specific table.

**The column names are codes I do not understand.**

Set the Language option to 'English' or 'Norwegian' to get human-readable labels. If you still see codes, those are the official SSB dimension codes, and the corresponding labels are included in separate columns in the output.

**I only got 10 rows but I need the full table.**

Free Apify accounts are limited to 10 rows for preview. Upgrade to a paid plan and increase the 'Maximum data rows' setting to collect the full dataset.

**The run is slow for a large table.**

SSB's API has rate limits and large tables with many dimensions take time to paginate through. Use a custom query to narrow the selection to only the regions, periods, and categories you need.

### FAQ

| Question | Answer |
|---|---|
| Where do I find the table ID? | Go to ssb.no/en/statbank, search for a topic, and open the table. The table ID is the number in the URL, for example 07459 in 'statbank/table/07459'. |
| Do I need an API key or login? | No. Statistics Norway's public API is open and this Actor reads it directly. No registration or authentication is required. |
| Why do I get 'Too many values selected'? | SSB's API rejects requests that ask for all values across all dimensions at once. Leave the query field empty to use the Actor's safe default, or build a custom query that selects a smaller subset of values per dimension. |
| How do I write a custom query? | The query field accepts a JSON array of PxWeb selection objects. Each object has a 'code' (dimension name) and a 'values' array of the codes you want. Use the SSB API documentation or inspect a working query from the Statbank site for the exact dimension codes. |
| Can I get the data in Norwegian? | Yes. Set the Language option to 'Norwegian' and all column labels, category names, and metadata will be returned in Bokmål. |
| What format is the output? | The Actor returns a flat table where each row is one observation with its dimension codes, labels, the time period, and the measurement value. You can export the dataset to CSV, JSON, Excel, or XML. |
| How many rows can I collect? | Free Apify accounts are limited to 10 rows for preview. Paid accounts can collect up to 1,000,000 rows per run, which covers most SSB tables in full. |
| Does this work for all SSB tables? | It works for any table published in the SSB Statbank that has an API endpoint. A small number of archived or special-format tables may not be available via the API. |
| Can I schedule this to run automatically? | Yes. Apify's scheduler lets you run the Actor daily, weekly, or monthly. Combine it with a webhook or an Apify integration to push new data into your storage or dashboard automatically. |

### Related actors

- [eurostat-scraper](https://apify.com/parseforge/eurostat-scraper?fpr=vmoqkp): Use this instead when you need statistics from the European Union's statistical office rather than Norway's national statistics.

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by Statistics Norway. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

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

Statistics Norway (SSB) table ID, for example 07459 (population by region).

## `maxItems` (type: `integer`):

Free users are limited to 10 rows (preview). Paid users can collect up to 1,000,000.

## `lang` (type: `string`):

Response language.

## `query` (type: `string`):

Optional. JSON array of PxWeb selection objects forwarded as the body's query field. Leave empty for a small default selection (newest period, top values per dimension); an all-values request is rejected by SSB with 'Too many values selected'.

## Actor input object example

```json
{
  "tableId": "07459",
  "maxItems": 10,
  "lang": "en"
}
```

# Actor output Schema

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

No description

# 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 = {
    "tableId": "07459",
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/norway-ssb-statistics-scraper").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 = {
    "tableId": "07459",
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("parseforge/norway-ssb-statistics-scraper").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 '{
  "tableId": "07459",
  "maxItems": 10
}' |
apify call parseforge/norway-ssb-statistics-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/norway-ssb-statistics-scraper"
        }
    }
}

```

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/5ucSY7jT49U2d2wb5/builds/kxqFOc1bijJs2qu8f/openapi.json
