Digitraffic (Fintraffic) Train Tracking API

Returns detailed information about train's location

GitHub OpenAPI

Operations 6

GET /api/v1/train-tracking Returns train running messages newer than {version} #
GET /api/v1/train-tracking/{departure_date}/{train_number} Returns train running messages for single train #
GET /api/v1/train-tracking/station/{station}/{departure_date} Returns train running messages for trains that have passed {station} on… #
GET /api/v1/train-tracking/station/{station}/{departure_date}/{track_section} Returns train running messages for trains that have passed {station}… #
GET /api/v1/train-tracking/station/{station}/latest/{track_section} Returns train running messages for trains that have passed {station}… #
GET /api/v1/train-tracking/latest/{train_number} Returns latest train running messages for single train #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/digitraffic-fi:digitraffic-fi-train-tracking-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

digitraffic-fi-train-tracking-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: rata.digitraffic.fi Train Tracking API
  version: '1.0'
  description: 'OpenAPI document


    Digitraffic is a service operated by Fintraffic, offering real time traffic information. Currently the service covers *road, marine and rail* traffic. More information can be found at the Digitraffic website


    The service has a public Google-group rail.digitraffic.fi for communication between developers, service administrators and Fintraffic. The discussion in the forum is mostly in Finnish, but you''re welcome to communicate in English too.


    ### General notes of the API

    * Many Digitraffic APIs use the GeoJSON format. The definition of GeoJSON can be found at https://tools.ietf.org/html/rfc7946.

    * For dates and times, the ISO 8601 format is used with "Zulu" zero offset from UTC unless otherwise specified (i.e., "yyyy-mm-ddThh:mm:ss[.mmm]Z"). E.g. 2019-11-01T06:30:00Z.'
  termsOfService: https://www.digitraffic.fi/en/terms-of-service/
  contact:
    name: Digitraffic / Fintraffic
    url: https://www.digitraffic.fi/
  license:
    name: Creative Commons 4.0 BY
    url: https://creativecommons.org/licenses/by/4.0/
servers:
- url: https://rata.digitraffic.fi
tags:
- name: train-tracking
  description: Returns detailed information about train's location
paths:
  /api/v1/train-tracking:
    get:
      tags:
      - train-tracking
      summary: Returns train running messages newer than {version}
      operationId: getTrainTrackingByVersion
      parameters:
      - name: version
        in: query
        required: false
        schema:
          type: integer
          format: int64
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TrainRunningMessage'
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
          content: {}
  /api/v1/train-tracking/{departure_date}/{train_number}:
    get:
      tags:
      - train-tracking
      summary: Returns train running messages for single train
      operationId: getTrainTrackingByTrainNumberAndDepartureDate
      parameters:
      - name: train_number
        in: path
        required: true
        schema:
          type: string
      - name: departure_date
        in: path
        required: true
        schema:
          type: string
          format: date
      - name: version
        in: query
        required: false
        schema:
          type: integer
          format: int64
          default: 0
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TrainRunningMessage'
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
          content: {}
  /api/v1/train-tracking/station/{station}/{departure_date}:
    get:
      tags:
      - train-tracking
      summary: Returns train running messages for trains that have passed {station} on…
      operationId: getTrainTrackingByStationAndDepartureDate
      parameters:
      - name: station
        in: path
        required: true
        schema:
          type: string
      - name: departure_date
        in: path
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TrainRunningMessage'
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
          content: {}
  /api/v1/train-tracking/station/{station}/{departure_date}/{track_section}:
    get:
      tags:
      - train-tracking
      summary: Returns train running messages for trains that have passed {station}…
      operationId: getTrainTrackingByStationAndTrackSectionAndDate
      parameters:
      - name: station
        in: path
        required: true
        schema:
          type: string
      - name: track_section
        in: path
        required: true
        schema:
          type: string
      - name: departure_date
        in: path
        required: true
        schema:
          type: string
          format: date
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TrainRunningMessage'
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
          content: {}
  /api/v1/train-tracking/station/{station}/latest/{track_section}:
    get:
      tags:
      - train-tracking
      summary: Returns train running messages for trains that have passed {station}…
      operationId: getTrainTrackingByStationAndTrackSectionAndLimit
      parameters:
      - name: station
        in: path
        required: true
        schema:
          type: string
      - name: track_section
        in: path
        required: true
        schema:
          type: string
      - name: limit
        in: query
        required: false
        schema:
          type: integer
          format: int32
          default: 100
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TrainRunningMessage'
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
          content: {}
  /api/v1/train-tracking/latest/{train_number}:
    get:
      tags:
      - train-tracking
      summary: Returns latest train running messages for single train
      operationId: getTrainTrackingByTrainNumber
      parameters:
      - name: train_number
        in: path
        required: true
        schema:
          type: string
      - name: version
        in: query
        required: false
        schema:
          type: integer
          format: int64
          default: 0
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/TrainRunningMessage'
        '400':
          description: Bad Request
        '500':
          description: Internal Server Error
          content: {}
components:
  schemas:
    TrainRunningMessage:
      title: TrainRunningMessage
      required:
      - departureDate
      - trainNumber
      type: object
      properties:
        id:
          type: integer
          format: int64
        version:
          type: integer
          format: int64
        trainNumber:
          type: string
          description: Identifies the train inside a single departure date
          example: '1'
        departureDate:
          type: string
          description: Date of the train's first departure
          format: date
          example: '2017-12-01'
        timestamp:
          type: string
          description: Timestamp when the message was generated
          format: date-time
        trackSection:
          type: string
        nextTrackSection:
          type: string
        previousTrackSection:
          type: string
        station:
          type: string
        nextStation:
          type: string
        previousStation:
          type: string
        type:
          type: string
          description: OCCUPY = train entered TrackSection, RELEASE = train exited TrackSection
          enum:
          - OCCUPY
          - RELEASE
      description: TrainRunMessages are generated when a train either enters or exists a TrackSection