We use cookies for authentication and — with your consent — for analytics. Read more.

Skip to content
KETL Data
DataAppsMCPSign in
  1. Home
  2. Data catalogue
  3. Trafikverket open API
TransportStandardCC0

Trafikverket open API

Trafikverket's open API (POST XML query) provides real-time data for rail traffic (stations, departures, messages), road conditions (ice, snow) and traffic situations on road and rail. Requires a free API key. CC0.

—

Data volume

Real time

Updates

4

MCP tools

Example response — /api/connectors/trafikverket/train-stations
{
  "data": "..."
}

MCP integration

Available MCP tools
trafikverket_road_conditions
trafikverket_situations
trafikverket_train_departures
trafikverket_train_stations
Configuration for Claude Desktop / Cursor
{
  "mcpServers": {
    "trafikverket": {
      "url": "https://data.ketl.no/mcp/trafikverket",
      "headers": {
        "Authorization": "Bearer $KETL_API_KEY"
      }
    }
  }
}

Analysis apps that use this source

Ready-made tools built on Trafikverket open API data. Use them directly in the browser, or wire the same data into your own analysis via the API below.

Trafikverket — Swedish transport in real time
Real-time data from Trafikverket's open API: railway stations, train departures, road conditions (ice/snow) and traffic incidents on road and rail. The Swedish counterpart to Bane NOR and Statens vegvesen.

API endpoints

GET
/health

Connector-helsestatus

Show curl example
# GET https://data.ketl.no/api/connectors/trafikverket/health
curl \
  -H "Accept: application/json" \
  "https://data.ketl.no/api/connectors/trafikverket/health"

Authenticated call — add one of these headers: x-api-key: ketl_… · Authorization: Bearer … — See the full reference in the documentation.

GET
/train-stations

Svenske togstasjoner

Show curl example
# GET https://data.ketl.no/api/connectors/trafikverket/train-stations
curl \
  -H "Accept: application/json" \
  "https://data.ketl.no/api/connectors/trafikverket/train-stations"

Authenticated call — add one of these headers: x-api-key: ketl_… · Authorization: Bearer … — See the full reference in the documentation.

GET
/train-departures

Sanntidsavganger for stasjon

station required
Trafikverkets `LocationSignature` for stasjonen. Utelatt ⇒ 400 missing_params. Signaturen hentes fra /train-stations (`locationSignature`); ruta er credential-gatet, så ingen verdi kan verifiseres gjennom KETL uten TRAFIKVERKET_API_KEY.
Show curl example
# GET https://data.ketl.no/api/connectors/trafikverket/train-departures
curl \
  -H "Accept: application/json" \
  "https://data.ketl.no/api/connectors/trafikverket/train-departures"

Authenticated call — add one of these headers: x-api-key: ketl_… · Authorization: Bearer … — See the full reference in the documentation.

GET
/road-conditions

Veglag. Uten `county` returneres hele landet.

county optional
Trafikverkets `County`-kode. Sendes urørt videre; ingen lokal validering. Kodene eies av Trafikverket (Datex II `County`); ruta er credential-gatet, så ingen verdi kan verifiseres gjennom KETL.
Show curl example
# GET https://data.ketl.no/api/connectors/trafikverket/road-conditions
curl \
  -H "Accept: application/json" \
  "https://data.ketl.no/api/connectors/trafikverket/road-conditions"

Authenticated call — add one of these headers: x-api-key: ketl_… · Authorization: Bearer … — See the full reference in the documentation.

GET
/situations

Trafikkhendelser. Uten `type` returneres alle meldingstyper.

type optional
Trafikverkets `MessageType`. Sendes urørt videre; ingen lokal validering. Mengden eies av Trafikverket (Situation.MessageType); ruta er credential-gatet, så ingen verdi kan verifiseres gjennom KETL.
Show curl example
# GET https://data.ketl.no/api/connectors/trafikverket/situations
curl \
  -H "Accept: application/json" \
  "https://data.ketl.no/api/connectors/trafikverket/situations"

Authenticated call — add one of these headers: x-api-key: ketl_… · Authorization: Bearer … — See the full reference in the documentation.

Access and pricing

Trafikverket open API is openly available — create an account to get started.

sverigetransporttogvegtrafikkveglagnordisk
KETL Data

Nordic open-data and compliance infrastructure. Source, rule and confidence on every answer.

Product links

  • Data
  • Apps
  • MCP
  • Contact

Legal links

  • AI transparency
  • Privacy
  • Terms
  • SLA
  • Cookies
  • Security

© 2026 KETL Data

build 8f3b7512