Digitraffic
Status
magnifying glass

Railway traffic

Timetables, delays, locations and composition of trains operating in Finland

The purpose of this service is to share data of trains operating in Finland. The service is operated by Fintraffic. The data is sourced from the following applications used in traffic controlling and capacity management:

LIIKE REAALI LOKI

Using the data from this service, it is possible to answer the following questions:

  • Is my train on schedule?
  • What is the location of my train at the moment?
  • Which train can I use to travel from A to B on date C?
  • Which trains are departing and arriving next from a specific station?
  • What kind of wagons and locotomovites does my train consist of?
  • What kind of services does a train provide?
  • Was my train on schedule for example two months ago?

English version of the documentation page contains only GraphQL and Swagger (in a short form). You might get more information using Google Translate with the Finnish documentation

Index

  1. GraphQL
  2. Swagger
  3. GTFS

GraphQL

Resources:

  • GraphiQL, online tool for testing and developing GraphQL-queries
  • Schema, contains available Queries, Types etc.

Examples

All trains from the operator “vr” and their latest locations with speed over 30 km/h Try

{
  currentlyRunningTrains(where: {operator: {shortCode: {equals: "vr"}}}) {
    trainNumber
    departureDate
    trainLocations(where: {speed: {greaterThan: 30}}, orderBy: {timestamp: DESCENDING}, take: 1) {
      speed
      timestamp
      location
    }
  }
}

All trains from a specific departure date, with operator “vr” and “commuter line” not equal to “Z”, ordered by train number Try

{
  trainsByDepartureDate(
    departureDate: "2020-10-05", 
    where: {and: [ {operator: {shortCode: {equals: "vr"}}}, {commuterLineid: {unequals: "Z"}}]}, 
    orderBy: {trainNumber: DESCENDING}) 
  {
    trainNumber
    departureDate
    commuterLineid
    operator {
      shortCode
    }
  }
}

All running trains ordered by operator and train number Try

{
  currentlyRunningTrains(orderBy: [{operator:{shortCode:ASCENDING}},{trainNumber:ASCENDING}]) {
    operator {
      shortCode
    }
    trainNumber
  }
}

Trains that pass through “YLÖ” Try

{
  trainsByDepartureDate(departureDate: "2020-10-06", 
    where: {timeTableRows:{contains:{station:{shortCode:{equals:"YLÖ"}}}}}
    ) {
    trainNumber
    departureDate
    timeTableRows {
      station {
        name
        uicCode
      }
    }
  }
}

Swagger

Swagger documentation.

GTFS

.zip files are generated daily around 5:00. Packages include all current and future trains

Data is licensed under Creative Commons Nimeä 4.0

bug_reportDid you find an error? Help us improve this page.