The Swedish NFI's statistics via API

Last changed: 31 May 2018

Companies, organisations and privat users have free access to the Swedish NFI's statistics via open data and can use them in the development of new products and services. This is made possible through access to our statistics database via an API.

API's (Application Programming Interface) can be adapted and used to build apps for smart phones or new webservices, including commercial ventures. Users have free access to out statistics database.

The aim of facilitating and increasing the use of digial data from government agencies is clearly stated in hte governments agenda.

Conditions of use for the Swedish NFI open data

No specific permisson is required when using statistics from the Swedish NFI. Use of our statistics is also free of charge.

You are however required to credit us as the source of data (Source: Swedish NFI, SLU).

You are not premitted to use the API to spread harmful code. It is also forbiden to present a service or product as an "offical partnership" or "in cooperation" with the Swedish NFI or SLU.

API for the statistics databse

This is how you access a specific table or part of a table from the Swedish NFI's statsitic database. You can also see examples of a simple API.

You can use the API without having to register.

Support

The Swedish NFI's API is based on Statistics Swedens PX-Web system. SCB has a useful documentation for using the API

Examples

Show the main menu for the statistics database:

http://skogsstatistik.slu.se/api/v1/en/

Show all sub-levels for the subject Area under All Land

http://skogsstatistik.slu.se/api/v1/en/OffStat/AllMark/Areal

Show meta data for a table:

http://skogsstatistik.slu.se/api/v1/en/OffStat/AllMark/Areal/AM_Areal_ägoslag_trad_tab.px

Get data for the standing volume  of Spruce for the county of Norrbotten for the speriod 1953-dat. Send a http POST-call to:

http://skogsstatistik.slu.se/api/v1/en/OffStat/ProduktivSkogsmark/Virkesförråd/PS_Virkesf_trädslag_diameter_tab.px

and use the following JSON-script:

{
"query": [
{
"code": "Län",
"selection": {
"filter": "item",
"values": [
"0"
]
}
},
{
"code": "Trädslag",
"selection": {
"filter": "item",
"values": [
"1"
]
}
},
{
"code": "Tabellinnehåll",
"selection": {
"filter": "item",
"values": [
"0"
]
}
},
{
"code": "Diameterklass (cm)",
"selection": {
"filter": "item",
"values": [
"8"
]
}
}
],
"response": {
"format": "px"
}
}

You can also get help with forming new queries. When you have created you table as you would like it in:

http://skogsstatistik.slu.se

then you can click on the tab "About table" and at the bottom of the page is a link "Make this table available in your application". Presented here is both the URL and the API you need to fetch this data.


Contact
Page editor: Riksskogstaxeringen@slu.se