123637
omssb
2013-06-14T14:46:00.000Z
en

How to use Statistics Norway’s API

About 125 complete data sets have been created in the API beta version. The data sets are available in Norwegian and English.

Read here what formats are available and how the URLs are set up.

Structure of URLs

The URL structure for the API is http://data.ssb.no/api/ version/ dataset /ID.type ?lang= lang, where

• Version is the current beta version, which is v0

• ID is a four-digit number that identifies the data set

• Type is either «json» or «csv»

• Lang (Language) is either «no» or «en»

Examples of URLs

• http://data.ssb.no/api/v0/dataset/1120

• http://data.ssb.no/api/v0/dataset/1120.json?lang=no

• http://data.ssb.no/api/v0/dataset/1120.csv?lang=en

We do not have URLs that enable access to only parts of a data set.

CSV format

A comma is used as a separator in the English data sets, and a decimal point is used as a decimal separator. The Norwegian interface uses semicolon separated CSV with comma as decimal separator.

JSON format

We use the format JSON-stat, which has been specially developed for use in the data sets. JSON-stat uses a hierarchical structure showing the main elements; data set, dimension, value and status. A complete library is available for processing JSON-stat on Github .

Key words describing the data sets

The key words, also known as tags, describe the content of a data set.

In a data set, a tag is used to show the table number in StatBank from which the data set has been retrieved, e.g. StatBank table 08801. A different tag shows the abbreviated name of the statistics, such as bpi (housing price index), which can be viewed at ssb.no/bpi.

The term “time series” is used to describe a data set containing long time series.

The terms “municipality”, “county”, “district”, ”basic statistical unit” and ”region” are used for data sets containing data at a regional level.

Contact us

If you have any questions about the API or the data sets, please e-mail us at: statistikkbanken@ssb.no .

For questions relating to the actual statistics and variables, please see ”Contact persons” in the right column of the relevant statistics. You can also find definitions of variables under “About the statistics” for the relevant statistics.

The ”Information” tab in the StatBank table offers additional details, and some StatBank tables also have links to classifications etc.