Skip to content
OSINTtools.io

Realtime Trains API

Live and recorded running data for trains on Great Britain's rail network, including detailed timings and platforms.

Base URL
https://data.rtt.io
Sign-in
Bearer token
Free tier
Free tier
Pricing
Subscription
Format
REST
Endpoints
4

Compiled by OSINTtools.io editors from realtimetrains.github.io · updated Nov 29, 2026Work on this API? Claim it to keep these docs currentReport a mistake

Introduction

The Realtime Trains API returns live and scheduled information about train services in Great Britain: a location line-up (services calling at a station in a time window) and the full calling pattern of one service, with times, platforms and delay reasons. It is useful for reconstructing where a given train was and when.

The API is at https://data.rtt.io. Authentication is a Bearer token from the API portal (a free RTT account is needed). You hold either a long-life access token or a refresh token that you exchange for a short-life access token through /api/get_access_token. Do not put a token in a distributable application. Responses are always JSON, and an optional Version header or version query parameter pins the API version.

The portal says the free API is for personal, non-commercial use and that paid plans are available. Some functions (detailed mode, allocations) depend on your entitlements; /api/info shows yours. The older pull API is deprecated and is not described here.

Quick start

  1. Get a key

    Create an account with Realtime Trains and copy your bearer token (free tier). Where to get it

  2. Make your first request

    Network Rail location line-up: train services calling at a location in a time window.. Replace YOUR_API_KEY and run it in a terminal, or use Try it on the endpoint.

    curl 'https://data.rtt.io/gb-nr/location?code=CLPHMJN' \
      -H 'Authorization: Bearer YOUR_API_KEY'
  3. Read the response

    A 200 response looks like this, shortened.

    {
      "systemStatus": {
        "realtimeNetworkRail": "UP",
        "rttCore": "UP"
      },
      "query": {
        "location": {
          "namespace": "gb-nr",
          "description": "Example Junction",
          "shortCodes": [
            "EXJ"
          ],
          "longCodes": [
            "EXAMPLEJN"
          ]
        },
        "timeFrom": "2025-10-25T13:00:00Z",
        "timeTo": "2025-10-25T14:00:00Z"
      },
      "services": [
        {
          "scheduleMetadata": {
            "uniqueIdentity": "L00000:2025-10-25",
            "namespace": "gb-nr",
    …

Authentication

Send your token in the Authorization header as Bearer YOUR_TOKEN.

Needs an RTT unified login account.

Get a key from Realtime Trains

Try it on this page keeps your key in your browser; it is never sent to OSINTtools.io.

Rate limits and pricing

Limits apply per minute, hour, day and week; X-RateLimit-Limit-<dimension> and X-RateLimit-Remaining-<dimension> headers show them. Numbers are not stated in the docs.

Free tier. Pricing: subscription.

Errors

StatusMeaning
429Too many requests; a Retry-After header gives the seconds until you can retry

Train services

  • Passive: the target is not contacted

Returns services at one location with scheduled and realtime times, platform and reasons. The default window is 60 minutes from now; the maximum query duration is 23 hours 59 minutes. Time-window options may be limited by your token.

Query parameters

codestringrequired

Any short or long code of the location

Example: CLPHMJN
filterFromstring

Only trains previously calling at this location code

Example: WAT
filterTostring

Only trains subsequently calling at this location code

Example: WOK
timeFromstring

Start of the time window, ISO 8601; defaults to now

Example: 2025-10-25T13:00:00
timeTostring

End of the time window, ISO 8601; not usable with timeWindow

Example: 2025-10-25T14:30:00
timeWindowinteger

Window length in minutes; not usable with timeTo

Example: 120Default: 60
detailedboolean

Enable detailed mode when your entitlements allow it

Example: false
Response fields · 14Show

realtimeNetworkRailstring

Status of the Network Rail real-time ingress

descriptionstring

Long description of the location

shortCodes[]string

Short codes of the location

timeFromstring

Start of the window used

timeTostring

End of the window used

uniqueIdentitystring

Unique identifier of the service on that day

identitystring

Operating identity of the service

departureDatestring

Departure date from the planned origin

operatorobject

Train operator

arrivalobject

Arrival times at this location

departureobject

Departure times at this location

platformobject

Platform information

origin[]object

Origins of the service

destination[]object

Destinations of the service

curl 'https://data.rtt.io/gb-nr/location?code=CLPHMJN' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "systemStatus": {
    "realtimeNetworkRail": "UP",
    "rttCore": "UP"
  },
  "query": {
    "location": {
      "namespace": "gb-nr",
      "description": "Example Junction",
      "shortCodes": [
        "EXJ"
      ],
      "longCodes": [
        "EXAMPLEJN"
      ]
    },
    "timeFrom": "2025-10-25T13:00:00Z",
    "timeTo": "2025-10-25T14:00:00Z"
  },
  "services": [
    {
      "scheduleMetadata": {
        "uniqueIdentity": "L00000:2025-10-25",
        "namespace": "gb-nr",
        "identity": "L00000",
        "departureDate": "2025-10-25",
        "operator": {
          "code": "XX",
          "name": "Example Rail"
        }
      },
      "temporalData": {
        "arrival": {},
        "departure": {}
      },
      "origin": [],
      "destination": []
    }
  ]
}
  • Passive: the target is not contacted

Identify the service with uniqueIdentity, or with identity and departureDate. Returns schedule metadata, locations with times, origin, destination and reasons; allocation data depends on your entitlements.

Query parameters

uniqueIdentitystring

Unique identifier of the service, identity plus departure date. Required if identity and departureDate are not set.

Example: L01525:2025-10-26
identitystring

Identity of the service. Required if uniqueIdentity is not set.

Example: L01525
departureDatestring

Departure date of the service (YYYY-MM-DD). Required if uniqueIdentity is not set.

Example: 2025-10-26
detailedboolean

Enable detailed mode when your entitlements allow it

Example: false
Response fields · 11Show

uniqueIdentitystring

Unique identifier queried

uniqueIdentitystring

Unique identifier of the service on that day

identitystring

Operating identity

departureDatestring

Departure date from the planned origin

namestring

Train operator name

trainReportingIdentitystring

Reporting identity (headcode)

temporalDataobject

Times at each location

locationobject

The location

locationobject

Origin location

locationobject

Destination location

shortTextstring

Short description of a delay cause

curl 'https://data.rtt.io/gb-nr/service' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "systemStatus": {
    "realtimeNetworkRail": "UP",
    "rttCore": "UP"
  },
  "query": {
    "uniqueIdentity": "L00000:2025-10-26"
  },
  "service": {
    "scheduleMetadata": {
      "uniqueIdentity": "L00000:2025-10-26",
      "namespace": "gb-nr",
      "identity": "L00000",
      "departureDate": "2025-10-26",
      "operator": {
        "code": "XX",
        "name": "Example Rail"
      },
      "trainReportingIdentity": "2A00"
    },
    "locations": [],
    "origin": [],
    "destination": [],
    "reasons": []
  }
}

Reference data

  • Passive: the target is not contacted

Reference list of locations that can be used as a code in line-up queries.

Response fields · 3Show

namespacestring

Namespace of the location

descriptionstring

Long text description of the location

shortCodestring

Short code of the location

curl 'https://data.rtt.io/data/stops' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "stops": [
    {
      "namespace": "gb-nr",
      "description": "Example Junction",
      "shortCode": "EXJ"
    }
  ]
}

Account

  • Passive: the target is not contacted

Shows api_version and credentials: entitlements, history restriction in days and available namespaces.

Response fields · 5Show

api_versionstring

Current API version

historyRestrictionboolean

Whether history lookback is restricted for this key

historyRestrictToDaysinteger

Days of history allowed

namespaceRestrictionboolean

Whether the key is limited to certain namespaces

namespacesAvailable[]string

Namespaces available to the key

curl 'https://data.rtt.io/api/info' \
  -H 'Authorization: Bearer YOUR_API_KEY'
Replace YOUR_API_KEY with your key
Response
{
  "api_version": "2026-01-18",
  "credentials": {
    "entitlements": [],
    "historyRestriction": true,
    "historyRestrictToDays": 14,
    "namespaceRestriction": true,
    "namespacesAvailable": [
      "gb-nr"
    ]
  }
}