ParseForge Scrapers

Statistics Sweden (SCB) Scraper

parseforge/statistik-sweden-scraper

BusinessDeveloper toolsAutomation

Scrapes official Swedish statistics from SCB. Browse subject areas, fetch table metadata, or query data points with dimension filters. Returns one row per dimension combination.

Run this scraper See the API call
Total users
2
Monthly active
0
Total runs
121
Bookmarked
0
Rating
Not rated yet
Last modified
12 days ago

Overview

ParseForge

Statistics Sweden (SCB) Scraper

Scrape official Swedish statistics from SCB, from population to labour market, in one flat table. Every data point comes with its dimensions, period, and values, ready for CSV, JSON, Excel, or XML. No API key, no registration, no rate limits.

SCB's public API is built for developers, not for analysts. You need to know the table IDs, dimension codes, and JSON-stat query format before you can pull a single number. This Actor reads the SCB tree directly, so you can browse subject areas, inspect a table's variables, or fetch actual data points with simple filters, and get one row per dimension combination in a fixed schema.

Who uses it What they scrape Statistics Sweden (SCB) for
Market researchers Pull population, income, or housing statistics by region and period for reports.
Data journalists Get official Swedish statistics to fact-check stories or build interactive charts.
Economists Collect labour market, GDP, or price index data for analysis and forecasting.
Public sector analysts Compare municipal or regional statistics for policy evaluation.
Students and academics Download SCB datasets for research papers and theses without manual exports.

What it does

This Actor collects data from Statistics Sweden (SCB) in three modes: browse the subject tree, fetch table metadata, or query actual data points, and returns each result as a flat row.

  • 🌳 Browse tree: list subject areas, sub-areas, and tables at any path, from root to leaf.
  • 📋 Table metadata: fetch a single table's variable list, including dimensions and value labels.
  • 📊 Data mode: POST a JSON-stat query and return actual data points, one row per dimension combination.
  • 🌐 Language support: get table titles and value labels in English or Swedish.
  • 🔍 Dimension filters: include only the regions, ages, sexes, or other dimensions you need.
  • No API key: the Actor handles the SCB API calls and pagination for you.

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

What you can do with Statistics Sweden (SCB) data

📈 Track population changes.

A market researcher pulls population by municipality and age group to see where a new store should open.

📰 Fact-check a news story.

A journalist fetches unemployment rates by region and sex to verify a claim about the labour market.

🏠 Analyse housing prices.

An economist collects real estate price index data over time to model market trends.

🎓 Research for a thesis.

A student downloads income distribution data by county for a paper on inequality.

Why choose this scraper

What you get
Official source Data comes directly from Statistics Sweden, the national statistical office.
No coding You don't need to learn the SCB API or JSON-stat format.
Flexible output Get one row per dimension combination, ready for pivot tables or databases.
Scalable Collect up to 1,000,000 datasets per run.

How it compares

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

Statistics Sweden (SCB) Scraper Build it in-house By hand
Setup Run it now, zero config Days of engineering None, but hours per pull
When Statistics Sweden (SCB) 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 tree path, a table ID, and dimension filters. Filters run as the query is built, so only the data points you need reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

{
  "mode": "browse",
  "maxItems": 10
}

A larger pull:

{
  "mode": "browse",
  "maxItems": 200
}

Pricing

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

Results collected Approximate cost
100 results $3.51
1,000 results $35.10
10,000 results $351.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 to collect up to 1,000,000 results per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the Statistics Sweden (SCB) Scraper.
  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 (run-sync-get-dataset-items) or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

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

claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/statistik-sweden-scraper"

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

Troubleshooting

Why am I getting no results?

Check your table ID and dimension filters. Use browse mode to confirm the table exists and table mode to see valid dimension values. Also ensure maxItems is high enough.

Why do I get an error about invalid table ID?

The table ID must be the full path under the root, including all slashes. For example, BE/BE0101/BE0101A/BefolkningNy. Copy it exactly from browse mode.

Why are some dimension values missing from my results?

If you omit a dimension in dataFilters, the Actor includes all values for non-time dimensions but only the latest period for time dimensions. Specify the dimension explicitly to get all periods.

Why is the output in Swedish even though I set language to English?

Some SCB tables may not have English translations for all labels. The language setting controls the API request, but fallback to Swedish can occur for untranslated fields.

Why does the run take a long time?

Large queries with many dimension combinations can take time. Reduce the number of dimensions or values in dataFilters, or lower maxItems.

FAQ

Question Answer
What is Statistics Sweden (SCB)? Statistics Sweden (Statistiska centralbyrån, SCB) is the Swedish government agency responsible for official statistics. It publishes data on population, economy, labour market, education, and more.
Do I need an API key to use this Actor? No. The Actor uses SCB's public API, which does not require registration or an API key.
What is the difference between browse, table, and data modes? Browse mode lists the subject tree. Table mode returns metadata for one table, like its dimensions and value labels. Data mode returns the actual data points based on your filters.
How do I find the table ID? Use browse mode to navigate the tree. The table ID is the full path under the root, for example BE/BE0101/BE0101A/BefolkningNy.
Can I filter by region, age, or sex? Yes. In data mode, use the dataFilters input to specify dimension values. For example, {"Region":["00"], "Alder":["tot"], "Kon":["1","2"]}.
What happens if I omit a dimension in dataFilters? For non-time dimensions, all values are included. For time dimensions, only the latest period is included.
Can I get results in Swedish? Yes. Set the language input to "sv" for Swedish table titles and value labels.
What format is the output? The Actor returns a flat table, one row per dimension combination. You can export it to CSV, JSON, Excel, or XML from Apify.
Is there a limit on how much data I can collect? You can set maxItems up to 1,000,000 datasets per run. The SCB API itself has no rate limits for reasonable use.
Can I schedule this Actor to run regularly? Yes. Use Apify's scheduler to run it daily, weekly, or monthly and get fresh statistics automatically.

Related actors

Browse the full ParseForge collection 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 Sweden. 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.

Input

FieldTypeWhat it doesDefault
mode string (3 options) browse: list nodes (subject areas, sub-areas, tables). table: fetch a single table's variable list. data: POST a JSON-stat query and return the actual data points (one row per dimension combination). browse
path string Browse mode: path inside SCB tree. Empty = root subject areas. Examples: BE (Population), BE/BE0101 (Population statistics), AM (Labour market). not set
tableId string Used by table and data modes: full table path under the root, e.g. BE/BE0101/BE0101A/BefolkningNy or NR/NR0103/NR0103A/NR0103ENS2010T01A. BE/BE0101/BE0101A/BefolkningNy
dataFilters object Map of dimension code → list of values to include. Example: {"Region":["00"], "Alder":["tot"], "Kon":["1","2"]}. Omitted dimensions: all values for non-time dims, latest period only for time dims. {}
maxItems integer How many datasets to collect per run. 10
language string (2 options) Response language for table titles and value labels. en

Pricing

from $26.33 per 1,000 results

Charged forWhat it isPrice each
result Single result in the default dataset. $0.02633 to $0.0351

Tiered: the lower figure is the price on a higher Apify plan. Billing and the free credit live on Apify.

API

One POST returns the dataset directly. Same shape for every scraper in the library, so swapping the slug is the only change.

POST · run and get results
curl -X POST "https://api.apify.com/v2/acts/parseforge~statistik-sweden-scraper/run-sync-get-dataset-items?token=$APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "helloWorld": 123
  }'

Examples

Input that runs as-is.

input.json
{
  "helloWorld": 123
}

Reviews

No reviews yet. Be the first.

Issues

We build and maintain this scraper, so a problem with it comes to us. Report it on the Apify listing and the thread stays attached to the scraper where the next person can find it: open an issue.

Broken and urgent, or you would rather not post in public? Write to parseforge@protonmail.com and it reaches the people who wrote it.

Related scrapers

Run Statistics Sweden (SCB) Scraper on Apify All scrapers