Data connectors

Statistics Sweden (SCB)

Statistics Sweden (SCB) publishes thousands of statistical tables through its public PxWeb API. CsvExplorer can query any of these tables directly — no account or API key needed.

About the PxWeb API v2

SCB uses the open-source PxWeb API v2 to expose its statistical database. The API returns data in the JSON-stat2 format, which CsvExplorer parses automatically into a flat table of rows and columns. The same API is used by Statistics Finland, Statistics Norway, and several other national statistical offices.

1 — Find a table in the SCB database

1

Open the SCB statistical database

Go to the SCB statistical database explorer:

https://www.statistikdatabasen.scb.se/

You can browse by subject area or use the search box to find tables by keyword (in Swedish or English).

Tip: The database is available in both Swedish and English. Switch language using the flag icon at the top of the page. The API URLs contain a language code: sv for Swedish, en for English.
2

Open a table and select variables

Click on a table name to open it. You will see a variable selection screen where you can choose:

  • Which categories to include for each dimension (e.g. specific regions or age groups).
  • Which time periods to include.

Select the variables you want, then click Visa tabell (Show table) or Show table.

Note: Selecting too many combinations can result in a very large dataset. Start with a focused selection to keep the response fast.

2 — Get the JSON-stat2 API URL

3

Open the API query view

Once the table is shown, look for a View API query link or button (the exact label may vary). This opens a panel showing the underlying API call.

Alternatively, you can construct the URL manually. The SCB PxWeb API v2 data endpoint follows this pattern:

https://api.scb.se/OV0104/v2/doris/en/ssd/{TABLE_PATH}/data?outputFormat=json-stat2

For example, to fetch the population by region and year table:

https://api.scb.se/OV0104/v2/doris/en/ssd/BE/BE0101/BE0101A/BefolkningNy/data?outputFormat=json-stat2
4

Verify the URL returns JSON-stat2

Open the URL in your browser. You should see a JSON response that starts with something like:

{"version":"2.0","class":"dataset","id":[...],"size":[...],"dimension":{...},"value":[...]}

Copy the URL — you will paste it into CsvExplorer in the next step.

Tip: Make sure the URL contains outputFormat=json-stat2. Other output formats are not supported by CsvExplorer.

3 — Load the data in CsvExplorer

5

Add a PxWebApi v2 source

Open CsvExplorer and go to the Explorer.

  1. In the Source panel on the left, click Add source.
  2. Select PxWebApi v2 as the source type.
  3. Paste the JSON-stat2 URL you copied in step 4 into the URL field.
  4. Click Fetch URL.

CsvExplorer will fetch and parse the response. Each dimension in the dataset becomes a string column, and the measured value becomes a numeric Value column.

Note: The PxWeb API is public and does not require authentication. However, some very large tables may time out — reduce the variable selection on the SCB website and use a more focused URL if you see an error.
6

Build and save a dashboard

  1. Use the Charts panel to add visualisations.
  2. Save your work with the Save dashboard button. Enable Public dashboard to share a live view with anyone — no sign-in required for viewers.
Tip: The SCB API returns the same data for a given URL every time (data is updated periodically by SCB). When viewers open your public dashboard, CsvExplorer re-fetches the URL so they always see the latest figures.

Other PxWeb API providers

The PxWebApi v2 source type works with any statistical office that uses the PxWeb platform and exposes the outputFormat=json-stat2 endpoint. Examples include:

Statistics Finland

https://statfin.stat.fi/PxWeb/api/v1/en/

Statistics Norway (SSB)

https://data.ssb.no/api/v0/en/

Statistics Denmark

https://api.statbank.dk/v1/

Statistics Iceland

https://px.hagstofa.is/pxen/api/v1/en/

Ready to explore statistics from SCB?

Open Explorer →