-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgtfsSwedenRealtime.yaml
343 lines (331 loc) · 13 KB
/
gtfsSwedenRealtime.yaml
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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
openapi: 3.0.1
info:
title: GTFS Sweden Realtime
description: 'This API provides realtime GTFS data of high quality for Swedish public transport operators, to be used in combination with the GTFS Sweden 3 feed. The data is provided by Samtrafiken. All endpoints support HEAD requests and conditional GET requests. You can use these to determine if a new file is available. This data must be matched with the GTFS Sweden static dataset.'
contact:
name: Trafiklab.se
url: https://support.trafiklab.se
license:
name: This documentation is licensed under a CC4.0-BY-SA license.
url: https://creativecommons.org/licenses/by-sa/4.0/
version: 1.0.0
externalDocs:
description: Read the complete Trafiklab docs
url: https://trafiklab.se
servers:
- url: https://opendata.samtrafiken.se/
tags:
- name: GTFS-RT
description: "Fetch GTFS-Realtime Sweden files for Swedish public transport operators. GTFS-Realtime Sweden is used together with static GTFS Sweden 3 files to provide realtime data, including even vehicle GPS positions for certain operators."
externalDocs:
description: Find out more
url: https://www.trafiklab.se/api/trafiklab-apis/gtfs-regional/
paths:
/gtfs-rt-sweden/{operator}/ServiceAlertsSweden.pb:
get:
tags:
- GTFS-RT
summary: 'Obtain the latest GTFS-RT ServiceAlerts for an operator.'
description: 'GTFS-RT ServiceAlerts feeds can be obtained through this endpoint. The interval between two file updates is at least 15 seconds.'
operationId: fetchServiceAlerts
parameters:
- $ref: '#/components/parameters/Operator-rt'
- $ref: '#/components/parameters/Accept-encoding'
- $ref: '#/components/parameters/If-Modified-Since'
- $ref: '#/components/parameters/If-None-Match'
responses:
200:
$ref: "#/components/responses/200-pb"
304:
$ref: "#/components/responses/304"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
429:
$ref: "#/components/responses/429"
security:
- api_key: []
/gtfs-rt-sweden/{operator}/TripUpdatesSweden.pb:
get:
tags:
- GTFS-RT
summary: 'Obtain the latest GTFS-RT TripUpdates for an operator.'
description: 'GTFS-RT TripUpdates feeds can be obtained through this endpoint. The interval between two file updates is at least 15 seconds.'
operationId: fetchTripUpdates
parameters:
- $ref: '#/components/parameters/Operator-rt'
- $ref: '#/components/parameters/Accept-encoding'
- $ref: '#/components/parameters/If-Modified-Since'
- $ref: '#/components/parameters/If-None-Match'
responses:
200:
$ref: "#/components/responses/200-pb"
304:
$ref: "#/components/responses/304"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
429:
$ref: "#/components/responses/429"
security:
- api_key: []
/gtfs-rt-sweden/{operator}/VehiclePositionsSweden.pb:
get:
tags:
- GTFS-RT
summary: 'Obtain the latest GTFS-RT VehiclePositions for an operator.'
description: 'GTFS-RT VehiclePositions feeds can be obtained through this endpoint. The interval between two file updates is at least 3 seconds.'
operationId: fetchVehiclePositions
parameters:
- $ref: '#/components/parameters/Operator-positions'
- $ref: '#/components/parameters/Accept-encoding'
- $ref: '#/components/parameters/If-Modified-Since'
- $ref: '#/components/parameters/If-None-Match'
responses:
200:
$ref: "#/components/responses/200-pb"
304:
$ref: "#/components/responses/304"
403:
$ref: "#/components/responses/403"
404:
$ref: "#/components/responses/404"
429:
$ref: "#/components/responses/429"
security:
- api_key: []
components:
parameters:
Operator-rt:
in: path
name: operator
required: true
schema:
type: string
enum:
- dt
- jlt
- krono
- orebro
- skane
- sl
- ul
- vastmanland
- varm
- xt
- otraf
description: The operator id.
examples:
sl:
value: sl
description: SL
ul:
value: ul
description: UL
otraf:
value: otraf
description: Östgötatrafiken
klt:
value: klt
description: Kalmar Länstrafik
skane:
value: skane
description: Skånetrafiken
dt:
value: dt
description: Dalatrafiken
varm:
value: varm
description: Värmlandstrafiken och Karlstadsbuss
xt:
value: xt
description: X-trafik
vastmanland:
value: vastmanland
description: Västmanland Länstrafik (VL)
Operator-positions:
in: path
name: operator
required: true
schema:
type: string
enum:
- ul
- otraf
- klt
- skane
- varm
- dt
- xt
- vastmanland
description: The operator id.
examples:
ul:
value: ul
description: UL
otraf:
value: otraf
description: Östgötatrafiken
klt:
value: klt
description: Kalmar Länstrafik
skane:
value: skane
description: Skånetrafiken
dt:
value: dt
description: Dalatrafiken
varm:
value: varm
description: Värmlandstrafiken och Karlstadsbuss
xt:
value: xt
description: X-trafik
vastmanland:
value: vastmanland
description: Västmanland Länstrafik (VL)
Accept-encoding:
name: Accept-encoding
in: header
description: "The Accept-Encoding request HTTP header advertises which content encoding, usually a compression algorithm, the client is able to understand.
Using content negotiation, the server selects one of the proposals, uses it and informs the client of its choice with the Content-Encoding response header.
*This API requires client-side GZIP support.*
Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-encoding"
schema:
type: string
example: 'br, gzip, deflate'
required: true
If-Modified-Since:
name: If-Modified-Since
in: header
schema:
$ref: '#/components/schemas/http-date'
required: false
description: "The If-Modified-Since request HTTP header makes the request conditional: the server will send back the requested resource, with a 200 status, only if it has been last modified after the given date.
If the request has not been modified since, the response will be a 304 without any body; the Last-Modified response header of a previous request will contain the date of last modification. Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Modified-Since"
If-None-Match:
name: If-None-Match
in: header
description: "The If-None-Match HTTP request header makes the request conditional. For GET and HEAD methods, the server will send back the requested resource, with a 200 status, only if it doesn't have an ETag matching the given ones.
When the condition fails for GET and HEAD methods, then the server must return HTTP status code 304 (Not Modified). Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-None-Match"
schema:
type: string
example: '"bfc13a64729c4290ef5b2c2730249c88ca92d82d"'
required: false
headers:
Cache-control:
description: "The cache-control contains a max-age field to define how long the content is considered fresh, in seconds, relative to the request time. New data will only become available after this interval has expired. Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/cache-control"
schema:
type: string
example: 'public, max-age=65844'
Content-encoding:
description: "The Content-Encoding entity header is used to compress the media-type. When present, its value indicates which encodings were applied to the entity-body. It lets the client know how to decode in order to obtain the media-type referenced by the Content-Type header. Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Encoding"
schema:
type: string
example: "gzip"
Date:
description: "The Date general HTTP header contains the date and time at which the message was originated. It gives information about an HTTP message, not about the contents of the message. Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Date"
schema:
$ref: '#/components/schemas/http-date'
example: 'Mon, 13 Jul 2020 10:07:12 GMT'
ETag:
description: "The etag header contains a fingerpring of the file contents. It can be used in combination with the If-None-Match request header to only fetch the file when it has changed. Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag"
schema:
type: string
example: '"046c1da6f11e08a6f32c22838787b950"'
Expires:
description: "The Expires header contains the date/time after which the response is considered stale. Invalid dates, like the value 0, represent a date in the past and mean that the resource is already expired. A stale resource can still be used, but a newer version might be available on the server. Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Expires"
schema:
$ref: '#/components/schemas/http-date'
example: 'Tue, 14 Jul 2020 04:24:36 GMT'
Last-modified:
description: "The Last-Modified response HTTP header contains the date and time at which the origin server believes the resource was last modified. It is used in combination with the if-modified-since request header to determine if the server has newer data compared to the client. Read more: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/last-modified"
schema:
$ref: '#/components/schemas/http-date'
example: 'Mon, 13 Jul 2020 04:24:36 GMT'
responses:
'200-pb':
description: The request succeeded.
headers:
Cache-control:
$ref: '#/components/headers/Cache-control'
Content-encoding:
$ref: '#/components/headers/Content-encoding'
Date:
$ref: '#/components/headers/Date'
ETag:
$ref: '#/components/headers/ETag'
Expires:
$ref: '#/components/headers/Expires'
Last-modified:
$ref: '#/components/headers/Last-modified'
content:
application/octet-stream:
schema:
type: string
format: binary
'304':
description: The data on the server has not been modified.
headers:
Cache-control:
$ref: '#/components/headers/Cache-control'
Content-encoding:
$ref: '#/components/headers/Content-encoding'
Date:
$ref: '#/components/headers/Date'
ETag:
$ref: '#/components/headers/ETag'
Expires:
$ref: '#/components/headers/Expires'
Last-modified:
$ref: '#/components/headers/Last-modified'
'403':
description: No API key was provided, or the provided API key is invalid.
headers:
Content-encoding:
$ref: '#/components/headers/Content-encoding'
Date:
$ref: '#/components/headers/Date'
content:
$ref: '#/components/schemas/json-error-details'
'404':
description: The requested file does not exist.
headers:
Content-encoding:
$ref: '#/components/headers/Content-encoding'
Date:
$ref: '#/components/headers/Date'
content:
$ref: '#/components/schemas/json-error-details'
'429':
description: The provided API key has exceeded its quota
headers:
Content-encoding:
$ref: '#/components/headers/Content-encoding'
Date:
$ref: '#/components/headers/Date'
content:
$ref: '#/components/schemas/json-error-details'
schemas:
http-date:
title: "HTTP Date, RFC2616"
type: string
format: '<day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT'
example: 'Mon, 13 Jul 2020 04:24:36 GMT'
description: "HTTP date, see RFC2616 section 3.3: https://tools.ietf.org/html/rfc2616"
json-error-details:
title: "JSON error message"
type: object
example: '{"errorMessage":"Key \"123456\" is invalid"}'
properties:
errorMessage:
type: string
description: The error message.
example: "Key \"123456\" is invalid"
securitySchemes:
api_key:
type: apiKey
name: key
in: query