At Statistics Sweden we use cookies so that our website will function well for you. By continuing your surfing on our website you agree to the use of cookies. What is a cookie?

API for the Statistical Database

Here you have access to any table or part of a table from the Statistical Database. You will also find examples of usage as well as frequently asked questions about the API (Application Programming Interface).

You can use the API without registering.

Guide

How to use the API (pdf)

Examples

Show all subject area in English in the Statistical Database:

Show all sub-levels for the subject area Population:

Show the metadata for the table:

Download Sweden's population for the years 2011 and 2012. Make an http POST request to:

and as data, the JSON request is used below

{  
"query": [
 {       
 "code": "ContentsCode",
  "selection": {        
    "filter": "item",         
    "values": [          
      "BE0101N1"         
    ]      
   }    
},    
{      
  "code": "Tid",
   "selection": {        
   "filter": "item",         
   "values": [           
   "2010",          
   "2011"         
   ]      
  }    
 }   
],  
"response": {    
  "format": "json"   
 }
}

You can now get help to formulate questions to the Statistical Database API. Make your data retrieval in the Statistical Database user interface. On the page that shows the table, click on the API link for this table. This will give you information about the URL and the query that you need to send to retrieve the same data with the API.

Last updated 2015-02-07 | Simple URL: http://www.scb.se/api_en

Statistics Service

+46 10 479 50 00

Opening hours

Weekdays
9:00–12:00, 13:00–16:30

Sweden | Box 24300, SE 104 51 Stockholm | SE 701 89 Örebro | +46 10 479 40 00