Sweden Road Incidents & Train Delays – Trafikverket
Pricing
$1.00 / 1,000 disruption records
Sweden Road Incidents & Train Delays – Trafikverket
Get live road incidents, roadworks, ferry changes, rail disruptions and delayed or cancelled trains in Sweden from Trafikverket's open data API (CC0). Filter by county, municipality or station. JSON, CSV or Excel for logistics, fleets, news and apps. Bring your own free key. $1 per 1,000 rows.
Pricing
$1.00 / 1,000 disruption records
Rating
0.0
(0)
Developer
Madeform
Maintained by CommunityActor stats
0
Bookmarked
1
Total users
0
Monthly active users
8 hours ago
Last modified
Categories
Share
Trafikverket Disruptions – Sweden road incidents, roadworks and train delays
Trafikverket Disruptions collects current road incidents, roadworks, rail operative events and delayed or cancelled trains in Sweden from the official open API of Trafikverket (the Swedish Transport Administration) and saves them as one clean, uniform row per disruption. It is made for logistics and fleet teams, commuter tools, news desks and apps, with optional filters for county, municipality or station. The easiest way to try it: paste your own free Trafikverket API key and click Start. Users on Apify's free plan get up to 200 disruptions per run.
Why teams use it
- Road and rail in one uniform table: road incidents, roadworks, ferry changes and restrictions, rail operative events, and cancelled or delayed trains at a station, all with the same columns.
- Official open data: straight from Trafikverket's API, published under CC0. No scraping of web pages, no proxies.
- Filters that match how you work: county, municipality, station and a time window up to 7 days back or ahead.
- Simple pricing: $1.00 per 1,000 rows, nothing to pay when a run finds nothing. The Trafikverket key is free.
- Clear errors: a wrong key, a used-up quota or a Trafikverket outage gives a plain message, never an empty "success".
Use cases
- Logistics and fleet planning: a morning list of roadworks, incidents and ferry changes in the counties where your vehicles drive.
- Commuter and station dashboards: cancelled and delayed trains at a station, refreshed on a schedule.
- News desks and alerts: new major disruptions to Slack, e-mail or Teams through Make, Zapier or n8n.
- Apps and maps: road deviations with coordinates for your own map or routing tool.
- Analysis: collect disruptions over time to see which roads, counties or lines are affected most.
- AI agents: let an assistant answer "is anything blocking my route today?" (see "Use it with AI agents" below).
Example: a morning list of roadworks and incidents in your county
A transport team in Västra Götaland wants a list every morning of roadworks, road incidents and ferry changes that can affect the day's routes. They set type to road, countyNo to 14, hoursAhead to 24, schedule the Actor for early morning and send the rows to a spreadsheet or another tool through an integration. A second team runs rail with stationSignature Cst and includeTrainAnnouncements to see cancelled and delayed trains at Stockholm Central.
You need your own free API key
Trafikverket's API needs an API key in every request (the limit is 100 calls per second per key, and Trafikverket contacts users who exceed the limits). This Actor's rule is that each user brings their own free key.
- Register at data.trafikverket.se/get-started with your e-mail address and accept the licence. A key is created for you.
- Paste the key in the input field Trafikverket API key (
trafikverketApiKey). The field is required and stored as a secret.
The key is your own and is never shared between users. Without a key the run stops with a clear error and a link to the registration. If you run the code locally (outside the Apify platform) you can set the environment variable TRAFIKVERKET_API_KEY instead; it is ignored on the platform.
If a run fails, the run status in Apify Console shows why and what to do: missing key, key rejected by Trafikverket (HTTP 401), key denied (HTTP 403), request quota reached (HTTP 429), Trafikverket temporarily unavailable, or no connection. The message never contains your key or Trafikverket's raw response.
How to use Trafikverket Disruptions
- Get your free key at data.trafikverket.se/get-started and paste it in Trafikverket API key.
- Choose
type:road,railorboth, and optionally a county, a municipality text or a station signature. - Set the time window (
hoursBack,hoursAhead) andmaxResults, then click Start. - Open the Output tab to view the rows as a table, or download them as JSON, CSV or Excel, or read them through the Apify API.
- Optional: create a schedule so the Actor runs every morning (see below).
What you get
recordType | Source (Trafikverket object) | One row is |
|---|---|---|
road-deviation | Road.TrafficInfo / Situation 1.6 | one deviation (incident, roadwork, restriction) |
rail-operative-event | ols.open / OperativeEvent 1.0 | one operative event with traffic impact on the railway |
train-announcement | rail.trafficinfo / TrainAnnouncement 2.0 | one cancelled or delayed departure/arrival at your station |
Note: Trafikverket retired the TrainMessage dataset on 9 September 2025 and replaced it with OperativeEvent and RailwayEvent in the ols.open namespace (announcement). This Actor uses OperativeEvent for rail disruptions.
Input
| Field | Description |
|---|---|
type | rail, road or both (default). |
countyNo | Optional list of counties (official numbers, e.g. 1 Stockholm, 14 Västra Götaland, 25 Norrbotten). Empty means all of Sweden. |
municipality | Optional text. Trafikverket has no municipality field, so this is a case-insensitive text match against the (sanitised) location, title and description of each row, for example Sundsvall. Rows that never name the municipality are not returned. |
stationSignature | Optional station signature, e.g. Cst. Rail events are kept when their affected section includes the station. |
includeTrainAnnouncements | Default false. Needs stationSignature; adds cancelled and delayed departures and arrivals at that station. |
hoursBack / hoursAhead | Time window, default 0 and 24 hours (maximum 168). |
maxResults | 1–10,000, default 200. Free plan: at most 200 per run. With both, road rows are saved first, so use a higher value or run rail separately if you need rail rows too. |
trafikverketApiKey | Your Trafikverket key (secret, required). |
Road deviations that Trafikverket marks as suspended (inactive) and deleted objects are skipped.
Example output
These rows come from real test runs on 28 October 2026 (road run 7bFikBIb4usQXPZgJ, rail and train run J08Ta0xQ5BBNMkPYE with station Cst). Values are exactly as Trafikverket published them at that time. The table shows the most important columns.
| recordType | id | category | title | severity | startTime | endTime | countyNo | roadNumber / location | delayMinutes | canceled |
|---|---|---|---|---|---|---|---|---|---|---|
| road-deviation | SE_STA_TRISSID_1_1160220 | Färjor | Isöleden | Mycket stor påverkan | 2026-10-29T06:00:00Z | 2026-10-29T19:30:00Z | 23 | Väg 623 | null | null |
| road-deviation | SE_STA_TRISSID_1_6736542 | Vägarbete | null | Liten påverkan | 2025-02-02T23:00:00Z | 2026-11-19T15:00:00Z | 25 | E45 | null | null |
| rail-operative-event | O261027-023 | Banarbete/transport (Vid överskriden tid eller annat oförutsett) | Banarbete Södertälje syd–Gnesta | green | 2026-10-27T08:26:38.003Z | null | 1, 2 | Cst – Ksc | null | null |
| train-announcement | 1500adde-1c5d-5c23-08df-29aad2244acd | arrival | Delayed 52 min arrival: train 591 at Cst | null | null | null | – | Cst | 52 | false |
| train-announcement | 1500adde-1c5d-5c23-08df-29aabc79e5a1 | arrival | Cancelled arrival: train 166 at Cst | null | null | null | – | Cst | null | true |
One row of each main type as JSON:
{"recordType": "road-deviation","id": "SE_STA_TRISSID_1_1160220","category": "Färjor","messageType": "Färja","title": "Isöleden","description": "Färjan är inställd torsdagen den 29/10 kl 20:00 till 20:30 på grund av bunkring.","severity": "Mycket stor påverkan","startTime": "2026-10-29T06:00:00Z","endTime": "2026-10-29T19:30:00Z","countyNo": [23],"roadNumber": "Väg 623","location": "Väg 623 mellan Isön och Norderön Ö, i båda riktningar.","fromStation": null,"toStation": null,"trainIdent": null,"advertisedTime": null,"estimatedTime": null,"canceled": null,"delayMinutes": null,"operator": null,"latitude": 63.1376661364807,"longitude": 14.3936920273737,"lastModified": "2026-10-26T14:49:56.345Z","sourceUrl": "http://www.trafikverket.se/isoleden","source": "Trafikverket – Swedish Transport Administration, open API (CC0), https://data.trafikverket.se","retrievedAt": "2026-10-28T08:45:57.066Z"}
{"recordType": "rail-operative-event","id": "O261027-023","category": "Banarbete/transport (Vid överskriden tid eller annat oförutsett)","messageType": "16","title": "Banarbete Södertälje syd–Gnesta","description": "Från 6 november kl. 22:00 till 8 november kl. 13:55 påverkas tågtrafiken av ett banarbete mellan Södertälje syd och Gnesta. Snabbtågen mellan Stockholm–Malmö/Göteborg/Karlstad går ändrad väg via Eskilstuna eller Västerås. Mälartåg ersätts med buss mellan Gnesta/Vagnhärad och Södertälje syd. SL Pendeltåg ersätts med buss mellan Södertälje centrum och Gnesta. Räkna med längre restid än normalt. För mer information om din resa hänvisas du till ditt tågbolag.","severity": "green","startTime": "2026-10-27T08:26:38.003Z","endTime": null,"countyNo": [1,2],"roadNumber": null,"location": "Cst – Ksc","fromStation": "Cst","toStation": "Ksc","trainIdent": null,"advertisedTime": null,"estimatedTime": null,"canceled": null,"delayMinutes": null,"operator": null,"latitude": 59.12855761082926,"longitude": 17.60817527347914,"lastModified": "2026-10-27T10:00:36.212Z","sourceUrl": null,"source": "Trafikverket – Swedish Transport Administration, open API (CC0), https://data.trafikverket.se","retrievedAt": "2026-10-28T08:43:57.117Z"}
{"recordType": "train-announcement","id": "1500adde-1c5d-f923-08df-29aa4224da1a","category": "arrival","messageType": "ANA055","title": "Delayed 3 min arrival: train 925 at Cst","description": "Spårändrat","severity": null,"startTime": null,"endTime": null,"countyNo": [],"roadNumber": null,"location": "Cst","fromStation": "U","toStation": "Arb","trainIdent": "925","advertisedTime": "2026-10-28T08:46:00Z","estimatedTime": "2026-10-28T08:49:00Z","canceled": false,"delayMinutes": 3,"operator": "TDEV","latitude": null,"longitude": null,"lastModified": "2026-10-28T08:43:52.812Z","sourceUrl": null,"source": "Trafikverket – Swedish Transport Administration, open API (CC0), https://data.trafikverket.se","retrievedAt": "2026-10-28T08:43:57.117Z"}
examples/sample-output.json has a few more rows.
Fields (all rows, null when missing): recordType, id, category, messageType, title, description (max 500 characters), severity, startTime, endTime, countyNo (array), roadNumber, location, fromStation, toStation, trainIdent, advertisedTime, estimatedTime, canceled, delayMinutes, operator, latitude, longitude, lastModified, sourceUrl, source, retrievedAt.
Times are ISO 8601. Trafikverket's API sends times with a zone offset, and these are converted to UTC (Z). A time sent without a zone is read as Swedish local time and keeps the Europe/Stockholm offset (+01:00 or +02:00).
How much does it cost to get Swedish traffic disruptions?
The Actor uses pay per event pricing: $1.00 per 1,000 disruptions ($0.001 per saved row). One saved row equals one billed event, and a run that finds nothing costs nothing.
Example: a run that saves 1,000 disruptions costs $1.00. A run with the default maximum of 200 rows costs $0.20.
| Typical setup | Rows saved | Cost |
|---|---|---|
| One test run with the default input | up to 200 | up to $0.20 |
| A morning run for one county that saves 50 rows, every day | about 1,500 a month | about $1.50 a month |
| A station check that saves 20 trains, every hour | about 14,400 a month | about $14.40 a month |
| One run of 10,000 rows | 10,000 | $10.00 |
The rows per run in these examples are assumptions; the real number depends on traffic that day. You pay only for the rows that are saved, and you can cap the cost of any run with Maximum cost per run in the run options.
Free plan: users on Apify's free plan get at most 200 disruptions per run. For plans and platform credits, see Apify pricing. The Trafikverket API key is free and not part of the Actor price.
Schedule it and connect it
- Schedule: run the Actor every morning or every few hours with Apify schedules.
- API: start runs and read the dataset through the Apify API.
- Integrations: send new rows to other tools through Apify integrations, for example Make, Zapier, n8n or Slack.
- Google Sheets: use the Actor Google Sheets Import & Export to write the dataset to a spreadsheet.
- Export: download the dataset as JSON, CSV or Excel.
Use it from your code: cURL, Python and JavaScript
You can start Trafikverket Disruptions and read the results through the Apify API. Get your API token in Apify Console under Settings → API & Integrations and set it as the environment variable APIFY_TOKEN. Put your own Trafikverket key in the environment variable TRAFIKVERKET_API_KEY too, so it never ends up in your code. The snippets below were run against this Actor on 28 October 2026.
cURL: start a run, wait for it and get the rows in one request. The synchronous endpoint waits up to 5 minutes, so use it for small and medium runs.
curl -X POST "https://api.apify.com/v2/acts/madeform~trafikverket-disruptions/run-sync-get-dataset-items" \-H "Authorization: Bearer $APIFY_TOKEN" \-H "Content-Type: application/json" \-d '{"type":"road","countyNo":["1"],"maxResults":20,"trafikverketApiKey":"'"$TRAFIKVERKET_API_KEY"'"}'
Python (pip install apify-client, tested with version 3.4):
import osfrom apify_client import ApifyClientclient = ApifyClient(os.environ["APIFY_TOKEN"])run = client.actor("madeform/trafikverket-disruptions").call(run_input={"type": "rail","stationSignature": "Cst","includeTrainAnnouncements": True,"maxResults": 50,"trafikverketApiKey": os.environ["TRAFIKVERKET_API_KEY"],})for item in client.dataset(run.default_dataset_id).iterate_items():print(item["recordType"], item["title"], item["location"], item["delayMinutes"])
With apify-client 1.x or 2.x, call() returns a dict: use run["defaultDatasetId"] instead of run.default_dataset_id.
JavaScript / TypeScript (npm install apify-client, tested with version 2.25):
import { ApifyClient } from 'apify-client';const client = new ApifyClient({ token: process.env.APIFY_TOKEN });const run = await client.actor('madeform/trafikverket-disruptions').call({type: 'road',countyNo: ['14'],maxResults: 50,trafikverketApiKey: process.env.TRAFIKVERKET_API_KEY,});const { items } = await client.dataset(run.defaultDatasetId).listItems();for (const item of items) console.log(item.recordType, item.category, item.location, item.startTime);
The API tab on this Actor's page has more examples and the full OpenAPI definition.
Use it with AI agents (MCP)
Trafikverket Disruptions also works as a tool for AI assistants and agents through the Apify MCP server. Add this server URL to Claude, Cursor, VS Code or any other MCP client, and sign in with your Apify account when asked:
https://mcp.apify.com?tools=madeform/trafikverket-disruptions
Then ask in plain language, for example: "Are there any roadworks or incidents on the E4 in Stockholm county right now? List them with location, severity and end time." The agent fills in the input (type, countyNo, municipality, stationSignature, hoursAhead, maxResults), runs the Actor and reads the rows. Agent runs are billed exactly like normal runs, one event per saved row. The Actor needs your own Trafikverket key in trafikverketApiKey; an agent can only pass it on if you give it to the agent, so treat it like any other secret.
FAQ
Is it legal to use Trafikverket data?
Trafikverket publishes the information in its open API for traffic information under Creative Commons CC0, which requires no attribution. See "Data source and licence" below. You are responsible for how you use the output.
How up to date is the data?
Every run fetches the data live from Trafikverket's API. The Actor keeps no archive of its own, and you can look back at most 168 hours with hoursBack. Each row has lastModified (from Trafikverket) and retrievedAt (when the Actor fetched it).
What is covered, and what are the limits?
Road deviations (incidents, roadworks, ferries and other restrictions), rail operative events with traffic impact, and, for one station at a time, cancelled or delayed train announcements. With type set to both, road rows are saved first, so a low maxResults can leave out rail rows. Road deviations that Trafikverket marks as suspended are skipped. There is no historical archive beyond hoursBack of 168 hours.
Why do I need my own API key?
Trafikverket's API requires a key in every request and limits calls per key (100 per second). Each user brings their own free key, which is stored as a secret and never shared. Register at data.trafikverket.se/get-started.
Does the data contain personal data?
Public traffic information rarely does. The Actor requests only a fixed list of fields and removes e-mail addresses, telephone numbers and personal identity numbers from free text. The scrubbing is pattern based and can miss unusual wording. See "Minimised personal data" below.
Can I filter by municipality or station?
Yes. municipality is a text match, because Trafikverket has no municipality field. stationSignature limits rail events to those whose affected section includes the station and, with includeTrainAnnouncements, adds cancelled and delayed trains at that station.
Can I connect it to Google Sheets, Make or Zapier?
Yes. See "Schedule it and connect it" above. You can also use the Apify API.
What happens on the free plan?
You get up to 200 disruptions per run. Paid usage costs $1.00 per 1,000 disruptions.
Is this an official Trafikverket service?
No. It is an independent tool that reads Trafikverket's open API with your own key and turns the answers into uniform rows. The data is Trafikverket's, published under CC0.
Can I get new disruptions in Slack or by e-mail?
Yes. Schedule the Actor and connect the run to Slack, e-mail, Make, Zapier or n8n through Apify integrations.
Can I use it from my own code or an AI agent?
Yes. See "Use it from your code" and "Use it with AI agents (MCP)" above.
Minimised personal data
- The Actor asks the API only for a fixed whitelist of fields. Creator, images, journey references and other fields are never requested.
- Free text (
title,description,location) is scrubbed of e-mail addresses (including obfuscated forms), telephone numbers and Nordic personal identity numbers, and of names after words such as "contact person" or "kontaktperson". Removed parts are replaced by[removed]. The text scrubbing is pattern based and can miss unusual wording.
Notices in public traffic information rarely hold personal data, but you remain the controller for your use of the output. Check your legal basis and retention period.
Data storage: Apify stores datasets in AWS us-east-1 (USA) under Apify's Data Processing Addendum with Standard Contractual Clauses (SCC); see Apify's shared responsibility model. If you need to keep the data in the EU, export it and delete the dataset after the run.
Data source and licence
Source: Trafikverket – Swedish Transport Administration, open API for traffic information, data.trafikverket.se. The information is licensed under Creative Commons CC0 ("The information contained in the Swedish Transport Administration's open API for traffic information is licensed under Creative Commons CC0"). CC0 requires no attribution; the Actor states the source in every row (source) as good practice. Each row's retrievedAt gives the retrieval time.
Each user runs the Actor with their own free key. That is this Actor's rule, not a literal requirement in Trafikverket's terms. Trafikverket's documentation says that each request carries the user's unique key, that the limit is 100 calls per second per key, and that Trafikverket monitors the traffic of each service and contacts users who exceed the limits.
Free text is shortened to 500 characters and scrubbed as described above, so it can differ from the original.
This Actor is an independent tool. It is not affiliated with, endorsed by or operated by Trafikverket or the Swedish Transport Administration.
More from Madeform
- TED Europe Tenders – public tenders from all 30 EU/EEA countries, same fields and filters, $3.00 per 1,000 tenders.
- TED Nordic Tenders – tenders from Sweden, Norway, Denmark, Finland and Iceland only, with Sweden as the default, $3.00 per 1,000 tenders.