-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.raml
More file actions
executable file
·177 lines (171 loc) · 4.32 KB
/
api.raml
File metadata and controls
executable file
·177 lines (171 loc) · 4.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#%RAML 1.0
title: PxWebApi
version: v0
mediaType: application/json
protocols: [HTTP, HTTPS]
baseUri: https://data.ssb.no/api/{version}/{language}
baseUriParameters:
language:
enum: [en, no]
types:
# Database:
# properties:
# dbid: string
# text: string
# example:
# dbid: table
# text: prodno
MenuItem:
properties:
id: string
type:
enum: [l, t]
text: string
updated?: datetime-only
example:
id: al
type: l
text: "Labour market and earnings"
# TableMenuItem:
# type: MenuItem
# example:
# id: ArbledSessNY
# type: t
# text: "07458: Employment and unemployment, seasonally adjusted, by age. Resident population 1997K1 - 2018K3"
# updated: 2018-10-25T08:00:00
TableMetadata:
properties:
title: string
variables: Variable[]
Variable:
properties:
code: string
text: string
values: string[]
valueTexts: string[]
time?: boolean
elimination?: boolean
TableQuery:
properties:
query: Selection[]
response:
properties:
format:
enum: [json-stat, csv, xlsx]
Selection:
properties:
code: string
selection:
properties:
filter:
enum: [all, item]
values: string[]
resourceTypes:
Collection:
get:
responses:
200:
body:
type: <<item>>[]
#/:
# description: List availible databases
# type: { Collection: {item : Database} }
#
#/{dbid}:
# description: List main topics
# type: { Collection: {item : LevelMenuItem } }
#
# /{path}:
# description: List sub topcics (or datasets)
# type: { Collection: {item : LevelMenuItem } }
/table:
description: List main topics
type: { Collection: {item : MenuItem } }
/{path}:
description: List sub topcics (or datasets)
type: { Collection: {item : MenuItem } }
/table/{id}:
get:
description: Get description of dataset
responses:
200:
body:
#type: TableMetadata
properties:
title: string
variables: Variable[]
example: |
{
"title": "11151: Unemployed persons not registered as resident, by country background, age, contents and quarter",
"variables": [
{
"code": "Lanbakgrunn",
"text": "country background",
"values": [
"03",
"000",
"1",
"2",
"3",
"099"
],
"valueTexts": [
"Total",
"Norway",
"The Nordic countries else",
"Western Europe else",
"EU countries in Eastern Europe",
"Other countries"
],
"elimination": true
},
{
"code": "Alder",
"text": "age",
"values": [
"Ialt",
"15-29",
"30+"
],
"valueTexts": [
"Total",
"15-29 years",
"30 years or older"
],
"elimination": true
},
{
"code": "ContentsCode",
"text": "contents",
"values": [
"Personer"
],
"valueTexts": [
"Unemployd persons not registered as resident"
]
},
{
"code": "Tid",
"text": "quarter",
"values": [
"2018K1",
"2018K2",
"2018K3"
],
"valueTexts": [
"2018K1",
"2018K2",
"2018K3"
],
"time": true
}
]
}
post:
description: Submit query and output format
body:
application/json:
type: TableQuery
responses:
200:
description: Dataset in your selected output format