2024-10-04
4.4.1 Example of retrivals in format csv
First line contains variable name and content.
Plain text and values on following lines.
4.4.2 Example of retrivals in format csv2 The table is pivoted such that all variables are in the heading. All variabels are placed on the first line and further every value is placed on its own line.
4.4.3 Example of retrivals in format csv This format display variable name and codes instead of description and text. Changed header on the last colum to show ID for the table instead of text.
2024-10-04 4.5 Table response The table response is divided into a metadata and a data part. The metadata part consists of a columns collection that lists the different dimensions and measures of the data cube. It also has a comments collection that specifies comments to a specific value. The data part of the response stores the measures of the data cube. 4.5.1 Metadata part The column description consists of five properties: Code. This is the identifier. Text. A textual display name for the column. Type. The type of column. This has three possible values. o d - a dimension. This is the default value. If it has not been set, it is assumed to be a dimension. o t - this is the time dimension o c - this is a measure column Unit. If it is a “c” column, the unit can be specified telling what unit the measures are specified in. This property should be ignored if it is not a “c” column Comment. This is an optional comment for the column/dimension.
2024-10-04
4.5.2
Data part
The data part is given in the form of key and values. The key specifies the
dimensions and the values are the different measures for the dimensions. The
order of how the different values are specified in the key should be the same
order as they are specified in the columns array. There is also an optional
comments array for each key-values pair that specifies a comment for a
measure. The index of the comment corresponds to the same index of the
measure in the values array.
"columns":[{"code":"region", "text":"Region"},
{"code":"ageG5", "text":"Age",
"comment":"Citizens under the age of 6 are not…"},
{"code":"period", "text":"Time", "type":"t"},
{"code":"x", "text":"Population", "type":"c", "unit":"amount"}],
"comments":[{"variable":"period", "value":"2005",
"comment":"Preliminary firgues"}]
"data":[{"key":["02","0-7","2003"], "values":[100]},
{"key":["02","0-7","2004"], "values":[101]},
{"key":["02","0-7","2005"], "values":[102]},
{"key":["02","8-14","2003"], "values":[103]},
{"key":["02","8-14","2004"], "values":[104]},
{"key":["02","8-14","2005"], "values":[105]},
{"key":["02","15-23","2003"], "values":[106]},
{"key":["02","15-23","2004"], "values":[107]},
{"key":["02","15-23","2005"], "values":[108]},
{"key":["02","24-33","2003"], "values":[109]},
{"key":["02","24-33","2004"], "values":[110]},
{"key":["02","24-33","2005"], "values":[111]},
{"key":["02","34-54","2003"], "values":[112]},
{"key":["02","34-54","2004"], "values":[113]},
{"key":["02","34-54","2005"], "values":[114]},
{"key":["02","55+","2003"], "values":[115]},
{"key":["02","55+","2004"], "values":[116]},
{"key":["02","55+","2005"], "values":[117]},
{"key":["06","0-7","2003"], "values":[118]},
{"key":["06","0-7","2004"], "values":[119]},
{"key":["06","0-7","2005""], "values":[120]},
{"key":["06","8-14","2003"], "values":[121]},
{"key":["06","8-14","2004"], "values":[122]},
{"key":["06","8-14","2005"], "values":[123]},
{"key":["06","15-23",2003"], "values":[124]},
{"key":["06","15-23",2004"], "values":[125]},
{"key":["06","15-23",2005"], "values":[126]},
{"key":["06","24-33",2003"], "values":[127]},
{"key":["06","24-33",2004"], "values":[128]},
{"key":["06","24-33",2005"], "values":[129]},
{"key":["06","34-54",2003"], "values":[130]},
{"key":["06","34-54",2004"], "values":[131]},
{"key":["06","34-54",2005"], "values":[132]},
{"key":["06","55+","2003"], "values":[133]},
{"key":["06","55+","2004"], "values":[134], "comment":["Imputated"]},
{"key":["06","55+","2005"], "values":[135]}],
}
Datum Version 15 av 15
2024-10-14 Version
Beteckning 1 (tex Dnr)
Beteckning
5 Limitations The usage of the API can be limited or not. The limitation is based on the caller IP-address. The way it works is that the caller can make 10 requests during a time window of 10 seconds (these values can be configured later). The time period 10 seconds is a sliding time window. If the caller tries to make more requests than allowed, the API will return a HTTP 429 Too Many Requests response.
6 Logging The log4net framework is used for the usage logging. The API uses the api- usage logger to log the data retrievals. Information that is logged is the IP- address of the caller, the statistical table and the number of measures that were retrieved.