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
{
"data": "..."
}MCP integration
API endpoints
/healthConnector-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.
/train-stationsSvenske 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.
/train-departuresSanntidsavganger 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.
/road-conditionsVeglag. 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.
/situationsTrafikkhendelser. 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.