Trafiklab Trips
betaObs: Detta innehåll finns inte tillgängligt på svenska. Därför ser du engelska versionen. Om du tycker att denna sida borde översättas till svenska, kan du skriva till oss på support.trafiklab.se.
Om du vill se webbsidan på engelska, klicka här.
What does this API provide?
Trafiklab Trips provides a list of all departures and arrivals for a given trip. This way you can show the complete journey of a specific vehicle.
These APIs are licensed as CC-BY
This allows you to do whatever you want as long as you include a little “data from Trafiklab.se” attribution on screens and website widgets. Read more about this in the license text at the bottom of this page.
Data format
The data is formatted as JSON.
Updates
The scheduled data used for this API is updated when changes are made, at most once per day. Real-time data is updated continuously, but lists with departures and arrivals for a given time are cached for 60 seconds. This means that making new requests for the same trip within 60 seconds won’t return any updates.
Breaking changes
This API has the beta status. We are actively developing this API based on user feedback. Minor breaking changes may occur on short notice. New fields may be added without warning.
Operators covered by this dataset
The following table shows which operators are covered by this dataset.
| Operator | Static data | Real-time data | ||
|---|---|---|---|---|
| SL | ✔️ | ✔️ | ||
| UL | ✔️ | ✔️ | ||
| Sörmlandstrafiken | ✔️ | |||
| Östgötatrafiken | ✔️ | ✔️ | ||
| JLT | ✔️ | ✔️ | ||
| Kronoberg | ✔️ | ✔️ | ||
| KLT | ✔️ | ✔️ | ||
| Gotland | ✔️ | ✔️ | ||
| Blekingetrafiken | ✔️ | |||
| Skånetrafiken | ✔️ | ✔️ | ||
| Hallandstrafiken | ✔️ | |||
| Västtrafik | ✔️ | |||
| Värmlandstrafik | ✔️ | ✔️ | ||
| Örebro | ✔️ | ✔️ | ||
| Västmanland | ✔️ | ✔️ | ||
| Dalatrafik | ✔️ | ✔️ | ||
| X-trafik | ✔️ | ✔️ | ||
| Din Tur - Västernorrland | ✔️ | ✔️ | ||
| Jämtland | ✔️ | |||
| Västerbotten | ✔️ | |||
| Norrbotten | ✔️ | |||
| BT buss | ✔️ | |||
| Destination Gotland | ✔️ | |||
| Falcks Omnibus AB | ✔️ | |||
| Flixbus | ✔️ | |||
| Härjedalingen | ✔️ | |||
| Lennakatten | ✔️ | |||
| Luleå Lokaltrafik | ✔️ | |||
| Masexpressen | ✔️ | |||
| Mälartåg ersättningstrafik | ✔️ | |||
| Norrtåg ersättningsstrafik (VR Sverige) | ✔️ | |||
| Ressel Rederi | ✔️ | |||
| Roslagens sjötrafik | ✔️ | |||
| SJ | ✔️ | |||
| SJ Norge | ✔️ | |||
| Sjöstadstrafiken (Stockholm Stad) | ✔️ | |||
| Skellefteåbuss | ✔️ | |||
| Snälltåget | ✔️ | |||
| Strömma Turism & Sjöfart AB | ✔️ | |||
| TiB ersättningstrafik (VR Sverige) | ✔️ | |||
| TJF Smalspåret | ✔️ | |||
| Trosabussen | ✔️ | |||
| Tågab | ✔️ | |||
| Uddevalla Skärgårdsbåtar AB | ✔️ | |||
| VR | ✔️ | |||
| Vy Norge | ✔️ | |||
| Vy Tåg AB | ✔️ | |||
| Vy Värmlandstrafik | ✔️ | |||
| Y-Buss | ✔️ | |||
| Last updated: 2026-01-22 | ||||
Using Trafiklab Trips
Trafiklab Trips consists of one endpoint, to which you supply the trip_id and the start_date for the journey.
The start date is the planning date to which the trip belongs, and may differ from the date at which the vehicle
actually stops at its first stop.
Making a request
The trip_id and start_date can be obtained from
Trafiklab Stop Lookup,
GTFS Sweden 3 static data (trips.txt, calendar_dates.txt)
or
GTFS Sweden 3 Realtime.
Making an API call
Request parameters
This API makes use of path parameters. They are part of the URL path and must be in the correct order.
1https://realtime-api.trafiklab.se/v1/trips/{trip_id}/{start_date}?key={key}| Name | Type | Data type | Required | Description |
|---|---|---|---|---|
| trip_id | Path | String | Yes | The trip_id for the trip you want to look up. |
| start_date | Path | String | Yes | The scheduled date for this trip, to differ between different days on which this trip is ran. In YYYY-MM-DD format. For example, 2025-12-31. |
| key | Query | String | Yes | Your API key |
Example API call
This call will show all departures and arrivals for Skånetrafikens bus 3 (trip_id 121120000386193630) scheduled on November 11th, 2025.
1https://realtime-api.trafiklab.se/v1/trips/121120000386193630/2025-11-11?key=API_KEYResponse
The responses consist of four parts:
- The timestamp at which the response was created
- Information about the query (which trip was looked up, which start_date was requested)
- Information about the route on which the trip is run
- The actual departures/arrivals for this trip
Precise technical documentation is available in the form of an OpenAPI specification on the bottom of this page.
1{
2 "timestamp": "2026-01-20T15:17:55",
3 "query": {
4 "queryTime": "2026-01-20T00:00:00",
5 "query": "121120000372401393"
6 },
7 "agency": {
8 "id": "505000000000000012",
9 "name": "Skånetrafiken",
10 "operator": "Bergkvarabuss AB"
11 },
12 "route": {
13 "name": "Malmö - Skanör",
14 "designation": "15",
15 "transport_mode_code": 700,
16 "transport_mode": "BUS",
17 "direction": "SkåneExpressen Malmö C",
18 "origin": {
19 "id": "27782",
20 "name": "Skanör Haga"
21 },
22 "destination": {
23 "id": "3",
24 "name": "Malmö Centralstation"
25 }
26 },
27 "trip": {
28 "trip_id": "121120000372401393",
29 "start_date": "2026-01-20",
30 "technical_number": 84
31 },
32 "calls": [
33 {
34 "scheduledDeparture": "2026-01-20T14:29:00",
35 "realtimeDeparture": "2026-01-20T14:29:09",
36 "departureDelay": 9,
37 "departureCanceled": false,
38 "scheduledArrival": "2026-01-20T14:29:00",
39 "realtimeArrival": "2026-01-20T14:27:49",
40 "arrivalDelay": -71,
41 "arrivalCanceled": false,
42 "stop": {
43 "id": "27782",
44 "area_id": "740012583",
45 "name": "Skanör Haga",
46 "lat": 55.407469,
47 "lon": 12.865432
48 },
49 "scheduled_platform": {
50 "id": "9022050027782002",
51 "designation": "B"
52 },
53 "realtime_platform": {
54 "id": "9022050027782002",
55 "designation": "B"
56 },
57 "alerts": [],
58 "is_realtime": true
59 },
60 {
61 "scheduledDeparture": "2026-01-20T14:32:57",
62 "realtimeDeparture": "2026-01-20T14:33:08",
63 "departureDelay": 11,
64 "departureCanceled": false,
65 "scheduledArrival": "2026-01-20T14:32:57",
66 "realtimeArrival": "2026-01-20T14:32:32",
67 "arrivalDelay": -25,
68 "arrivalCanceled": false,
69 "stop": {
70 "id": "1231",
71 "area_id": "740001231",
72 "name": "Ljunghusen Storvägen",
73 "lat": 55.405538,
74 "lon": 12.920899
75 },
76 "scheduled_platform": {
77 "id": "9022050001231002",
78 "designation": "B"
79 },
80 "realtime_platform": {
81 "id": "9022050001231002",
82 "designation": "B"
83 },
84 "alerts": [],
85 "is_realtime": true
86 },
87 {
88 "scheduledDeparture": "2026-01-20T14:36:12",
89 "realtimeDeparture": "2026-01-20T14:35:33",
90 "departureDelay": -39,
91 "departureCanceled": false,
92 "scheduledArrival": "2026-01-20T14:36:12",
93 "realtimeArrival": "2026-01-20T14:35:33",
94 "arrivalDelay": -39,
95 "arrivalCanceled": false,
96 "stop": {
97 "id": "27779",
98 "area_id": "740012580",
99 "name": "Höllviken Höllvikstrand",
100 "lat": 55.413625,
101 "lon": 12.943024
102 },
103 "scheduled_platform": {
104 "id": "9022050027779002",
105 "designation": "B"
106 },
107 "realtime_platform": {
108 "id": "9022050027779002",
109 "designation": "B"
110 },
111 "alerts": [],
112 "is_realtime": true
113 },
114 {
115 "scheduledDeparture": "2026-01-20T14:38:00",
116 "realtimeDeparture": "2026-01-20T14:38:03",
117 "departureDelay": 3,
118 "departureCanceled": false,
119 "scheduledArrival": "2026-01-20T14:38:00",
120 "realtimeArrival": "2026-01-20T14:36:56",
121 "arrivalDelay": -64,
122 "arrivalCanceled": false,
123 "stop": {
124 "id": "60011",
125 "area_id": "740076441",
126 "name": "Höllviken Nyckelhålsparken",
127 "lat": 55.419085,
128 "lon": 12.950939
129 },
130 "scheduled_platform": {
131 "id": "9022050060011002",
132 "designation": "B"
133 },
134 "realtime_platform": {
135 "id": "9022050060011002",
136 "designation": "B"
137 },
138 "alerts": [],
139 "is_realtime": true
140 },
141 {
142 "scheduledDeparture": "2026-01-20T14:39:50",
143 "realtimeDeparture": "2026-01-20T14:40:13",
144 "departureDelay": 23,
145 "departureCanceled": false,
146 "scheduledArrival": "2026-01-20T14:39:50",
147 "realtimeArrival": "2026-01-20T14:39:37",
148 "arrivalDelay": -13,
149 "arrivalCanceled": false,
150 "stop": {
151 "id": "27777",
152 "area_id": "740012578",
153 "name": "Höllviken Östra Halörsvägen",
154 "lat": 55.423639,
155 "lon": 12.960485
156 },
157 "scheduled_platform": {
158 "id": "9022050027777003",
159 "designation": "C"
160 },
161 "realtime_platform": {
162 "id": "9022050027777003",
163 "designation": "C"
164 },
165 "alerts": [],
166 "is_realtime": true
167 },
168 {
169 "scheduledDeparture": "2026-01-20T14:48:00",
170 "realtimeDeparture": "2026-01-20T14:48:15",
171 "departureDelay": 15,
172 "departureCanceled": false,
173 "scheduledArrival": "2026-01-20T14:48:00",
174 "realtimeArrival": "2026-01-20T14:45:58",
175 "arrivalDelay": -122,
176 "arrivalCanceled": false,
177 "stop": {
178 "id": "27819",
179 "area_id": "740020262",
180 "name": "Vellinge ängar",
181 "lat": 55.472313,
182 "lon": 13.01021
183 },
184 "scheduled_platform": {
185 "id": "9022050027819002",
186 "designation": "B"
187 },
188 "realtime_platform": {
189 "id": "9022050027819002",
190 "designation": "B"
191 },
192 "alerts": [
193 {
194 "type": "CONSTRUCTION",
195 "title": "Trafikinformation: Hållplats Vellinge ängar",
196 "text": "Trafikinformation: Fr.o.m. 27/10 2025 kl. 7.00 är hållplats Vellinge ängar, läge D, stängd p.g.a. arbete med nybyggnation av flerbostadshus på Vallgatan. Linje 150 mot Klågerup och 181 mot Vellinge angör tillfällig hållplats på Norrevångsgatan."
197 }
198 ],
199 "is_realtime": true
200 },
201 {
202 "scheduledDeparture": "2026-01-20T14:59:18",
203 "realtimeDeparture": "2026-01-20T14:58:23",
204 "departureDelay": -55,
205 "departureCanceled": false,
206 "scheduledArrival": "2026-01-20T14:59:18",
207 "realtimeArrival": "2026-01-20T14:57:58",
208 "arrivalDelay": -80,
209 "arrivalCanceled": false,
210 "stop": {
211 "id": "27006",
212 "area_id": "740016287",
213 "name": "Malmö Mobilia Öster",
214 "lat": 55.581464,
215 "lon": 13.005878
216 },
217 "scheduled_platform": {
218 "id": "9022050027006002",
219 "designation": "B"
220 },
221 "realtime_platform": {
222 "id": "9022050027006002",
223 "designation": "B"
224 },
225 "alerts": [],
226 "is_realtime": true
227 },
228 {
229 "scheduledDeparture": "2026-01-20T15:04:00",
230 "realtimeDeparture": "2026-01-20T15:03:52",
231 "departureDelay": -8,
232 "departureCanceled": false,
233 "scheduledArrival": "2026-01-20T15:04:00",
234 "realtimeArrival": "2026-01-20T15:01:29",
235 "arrivalDelay": -151,
236 "arrivalCanceled": false,
237 "stop": {
238 "id": "26814",
239 "area_id": "740016782",
240 "name": "Malmö Södervärn",
241 "lat": 55.588614,
242 "lon": 13.006955
243 },
244 "scheduled_platform": {
245 "id": "9022050026814008",
246 "designation": "H"
247 },
248 "realtime_platform": {
249 "id": "9022050026814008",
250 "designation": "H"
251 },
252 "alerts": [],
253 "is_realtime": true
254 },
255 {
256 "scheduledDeparture": "2026-01-20T15:10:12",
257 "realtimeDeparture": "2026-01-20T15:10:47",
258 "departureDelay": 35,
259 "departureCanceled": false,
260 "scheduledArrival": "2026-01-20T15:10:12",
261 "realtimeArrival": "2026-01-20T15:10:47",
262 "arrivalDelay": 35,
263 "arrivalCanceled": false,
264 "stop": {
265 "id": "71690",
266 "area_id": "740015746",
267 "name": "Malmö Kungsgatan",
268 "lat": 55.600579,
269 "lon": 13.007166
270 },
271 "scheduled_platform": {
272 "id": "9022050071690003",
273 "designation": "C"
274 },
275 "realtime_platform": {
276 "id": "9022050071690003",
277 "designation": "C"
278 },
279 "alerts": [],
280 "is_realtime": true
281 },
282 {
283 "scheduledDeparture": "2026-01-20T15:11:10",
284 "realtimeDeparture": "2026-01-20T15:11:24",
285 "departureDelay": 14,
286 "departureCanceled": false,
287 "scheduledArrival": "2026-01-20T15:11:10",
288 "realtimeArrival": "2026-01-20T15:11:24",
289 "arrivalDelay": 14,
290 "arrivalCanceled": false,
291 "stop": {
292 "id": "26811",
293 "area_id": "740015745",
294 "name": "Malmö Studentgatan",
295 "lat": 55.602798,
296 "lon": 13.005198
297 },
298 "scheduled_platform": {
299 "id": "9022050026811002",
300 "designation": "B"
301 },
302 "realtime_platform": {
303 "id": "9022050026811002",
304 "designation": "B"
305 },
306 "alerts": [],
307 "is_realtime": true
308 },
309 {
310 "scheduledDeparture": "2026-01-20T15:17:00",
311 "realtimeDeparture": "2026-01-20T15:16:25",
312 "departureDelay": -35,
313 "departureCanceled": false,
314 "scheduledArrival": "2026-01-20T15:17:00",
315 "realtimeArrival": "2026-01-20T15:16:25",
316 "arrivalDelay": -35,
317 "arrivalCanceled": false,
318 "stop": {
319 "id": "3",
320 "area_id": "740000003",
321 "name": "Malmö Centralstation",
322 "lat": 55.608777,
323 "lon": 13.000216
324 },
325 "scheduled_platform": {
326 "id": "9022050000003009",
327 "designation": "I"
328 },
329 "realtime_platform": {
330 "id": "9022050000003009",
331 "designation": "I"
332 },
333 "alerts": [],
334 "is_realtime": true
335 }
336 ]
337}Response data fields
TripDetailResponse
| Name | Data type | Description |
|---|---|---|
| timestamp | String | List of departures or arrivals. |
| query.queryTime | String | The start_date for which departures/arrivals are requested. |
| query.query | String | The queried trip_id |
| agency.id | String | A unique id identifying this agency. Matches GTFS Sweden 3. |
| agency.name | String | The name of the agency responsible for this trip. |
| agency.operator | String | The name of the company running the trip, such as Nobina, Keolis, … . May be null when unknown. |
| route.name | String | The route name, if set by the operator. Used for lines which are known by their name instead of their number, such as Silverlinjen, Nockebybanan or Saltsjöbanan. |
| route.designation | String | The public facing designation for this route. Often this is the line number, but it may even contain characters (for example “42X”). |
| route.transport_mode | String | The transport mode for this route, one of
|
| route.transport_mode_code | Integer | The specific GTFS transport mode code for this route. See GTFS extended route types. |
| route.direction | String | The direction for this route, which is for example shown on the front of buses. This text may be different for the same route at different stops, for example “A via B” will often change to just “A” after stop B has been passed. |
| route.origin.id | String | The id of the first stop on this route. |
| route.origin.name | String | The name of the first stop on this route. |
| route.destination.id | String | The id of the last stop on this route. |
| route.destination.name | String | The name of the last stop on this route. |
| trip.trip_id | String | The trip id, which can be used in combination with start_date to uniquely identify a trip. Matches GTFS Sweden 3 and GTFS Sweden 3 realtime data. |
| trip.start_date | String | The date on which this trip was started. |
| trip.technical_number | Integer | The technical trip number of this trip. Uniquely identifies a trip in combination with start_date and agency.id. |
| calls | CallAtLocation[] | Departures and arrivals for the given route |
CallAtLocation
| Name | Data type | Description |
|---|---|---|
| scheduled | String | Departure time at this stop, formatted as YYYY-MM-DDTHH:mm:ss in the local timezone. |
| realtime | String | Realtime departure time at this stop, formatted as YYYY-MM-DDTHH:mm:ss in the local timezone. When no realtime data is available, the scheduled value is used. See also is_realtime. |
| delay | Integer | The delay, in seconds, for this departure/arrival. Can be negative in case the vehicle is early. Set to 0 when no realtime data is available, see also is_realtime. |
| canceled | String | True if this departure has been cancelled. This means that either the entire trip, or a part of the trip including this departure/arrival, has been cancelled. Note that a departure can be cancelled while the arrival at the same stop can still be serviced, or the arrival can be cancelled while the departure still is serviced. |
| scheduledArrival | String | Arrival time at this stop, formatted as YYYY-MM-DDTHH:mm:ss in the local timezone. |
| realtimeArrival | String | Realtime arrival time at this stop, formatted as YYYY-MM-DDTHH:mm:ss in the local timezone. When no realtime data is available, the scheduled value is used. See also is_realtime. |
| arrivalDelay | Integer | The delay, in seconds, for this arrival/arrival. Can be negative in case the vehicle is early. Set to 0 when no realtime data is available, see also is_realtime. |
| arrivalCanceled | String | True if this arrival has been cancelled. This means that either the entire trip, or a part of the trip including this arrival/arrival, has been cancelled. Note that a arrival can be cancelled while the arrival at the same stop can still be serviced, or the arrival can be cancelled while the arrival still is serviced. |
| stop | Stop | Information about the stop where the departure/arrival takes place. Since a queried area can contain multiple stops, this field can be used to identify at which of the stops this departure/arrival takes place. |
| stop.id | String | The stop id. |
| stop.name | String | The stop name. |
| stop.lat | Float | The stop latitude. |
| stop.lon | Float | The top longitude. |
| scheduled_platform | Platform | Information about the scheduled platform. Null if no platform information is available. |
| scheduled_platform.id | String | The scheduled platform id. |
| scheduled_platform.name | String | The scheduled platform name. |
| realtime_platform | Platform | Information about the realtime platform. If no realtime data is available, the scheduled platform data is used, see also is_realtime. Null if no platform information is available. |
| realtime_platform.id | String | The realtime platform id. |
| realtime_platform.name | String | The realtime platform name. |
| alerts | Alert[] | Any messages for this stop, for example regarding roadworks, delays, changed routes etc. |
| is_realtime | Boolean | Indicates weather realtime data is available for this departure/arrival. When false, realtime fields have been filled with scheduled data for easier client-side implementations. |
License
These Trafiklab APIs are available under the CC-BY 4.0 license. You should mention the data is provided by Trafiklab.se, for example through the use of a little footnote text on public displays or website widgets. Contact us for exemptions if you’re implementing solutions for public transport operators, such as onboard displays.
You are free to:
- Share — copy and redistribute the material in any medium or format for any purpose, even commercially.
- Adapt — remix, transform, and build upon the material for any purpose, even commercially.
- The licensor cannot revoke these freedoms as long as you follow the license terms.
Under the following terms:
- Attribution — You must give appropriate credit , provide a link to the license, and indicate if changes were made . You may do so in any reasonable manner, but not in any way that suggests the licensor endorses you or your use.
- No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
Notices:
You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation .
No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.