# Realtime Trains API reference

> 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…

Source: https://osinttools.io/apis/realtime-trains/ (Markdown view of an OSINTtools.io page; append `.md` to any page URL for this format).

Compiled by OSINTtools.io editors from the vendor's docs, updated Nov 29, 2026. Listing: https://osinttools.io/tools/realtime-trains/

- Base URL: https://data.rtt.io
- Authentication: Bearer token in the `Authorization` header. Get a key: https://api-portal.rtt.io Needs an RTT unified login account.
- Free tier: yes
- Pricing: Subscription
- Rate limits: 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.
- Vendor docs: https://realtimetrains.github.io/api-specification

## Overview

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.

## Errors

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

## Train services

### Network Rail location line-up: train services calling at a location in a time window.

`GET /gb-nr/location`

- Footprint: 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.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `code` | query | string | yes | Any short or long code of the location Example: CLPHMJN |
| `filterFrom` | query | string | no | Only trains previously calling at this location code Example: WAT |
| `filterTo` | query | string | no | Only trains subsequently calling at this location code Example: WOK |
| `timeFrom` | query | string | no | Start of the time window, ISO 8601; defaults to now Example: 2025-10-25T13:00:00 |
| `timeTo` | query | string | no | End of the time window, ISO 8601; not usable with timeWindow Example: 2025-10-25T14:30:00 |
| `timeWindow` | query | integer | no | Window length in minutes; not usable with timeTo Example: 120 |
| `detailed` | query | boolean | no | Enable detailed mode when your entitlements allow it Example: false |

Response fields:

- `systemStatus.realtimeNetworkRail` (string): Status of the Network Rail real-time ingress
- `query.location.description` (string): Long description of the location
- `query.location.shortCodes[]` (string): Short codes of the location
- `query.timeFrom` (string): Start of the window used
- `query.timeTo` (string): End of the window used
- `services[].scheduleMetadata.uniqueIdentity` (string): Unique identifier of the service on that day
- `services[].scheduleMetadata.identity` (string): Operating identity of the service
- `services[].scheduleMetadata.departureDate` (string): Departure date from the planned origin
- `services[].scheduleMetadata.operator` (object): Train operator
- `services[].temporalData.arrival` (object): Arrival times at this location
- `services[].temporalData.departure` (object): Departure times at this location
- `services[].locationMetadata.platform` (object): Platform information
- `services[].origin[]` (object): Origins of the service
- `services[].destination[]` (object): Destinations of the service

```bash
curl 'https://data.rtt.io/gb-nr/location?code=CLPHMJN' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "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": []
    }
  ]
}
```

### Network Rail service query: the full calling pattern of one train service.

`GET /gb-nr/service`

- Footprint: 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.

| Parameter | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `uniqueIdentity` | query | string | no | Unique identifier of the service, identity plus departure date. Required if identity and departureDate are not set. Example: L01525:2025-10-26 |
| `identity` | query | string | no | Identity of the service. Required if uniqueIdentity is not set. Example: L01525 |
| `departureDate` | query | string | no | Departure date of the service (YYYY-MM-DD). Required if uniqueIdentity is not set. Example: 2025-10-26 |
| `detailed` | query | boolean | no | Enable detailed mode when your entitlements allow it Example: false |

Response fields:

- `query.uniqueIdentity` (string): Unique identifier queried
- `service.scheduleMetadata.uniqueIdentity` (string): Unique identifier of the service on that day
- `service.scheduleMetadata.identity` (string): Operating identity
- `service.scheduleMetadata.departureDate` (string): Departure date from the planned origin
- `service.scheduleMetadata.operator.name` (string): Train operator name
- `service.scheduleMetadata.trainReportingIdentity` (string): Reporting identity (headcode)
- `service.locations[].temporalData` (object): Times at each location
- `service.locations[].location` (object): The location
- `service.origin[].location` (object): Origin location
- `service.destination[].location` (object): Destination location
- `service.reasons[].shortText` (string): Short description of a delay cause

```bash
curl 'https://data.rtt.io/gb-nr/service' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "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

### List of stops with namespace, description and short code.

`GET /data/stops`

- Footprint: passive (the target is not contacted)

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

Response fields:

- `stops[].namespace` (string): Namespace of the location
- `stops[].description` (string): Long text description of the location
- `stops[].shortCode` (string): Short code of the location

```bash
curl 'https://data.rtt.io/data/stops' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "stops": [
    {
      "namespace": "gb-nr",
      "description": "Example Junction",
      "shortCode": "EXJ"
    }
  ]
}
```

## Account

### Current API version and the entitlements of the token in use.

`GET /api/info`

- Footprint: passive (the target is not contacted)

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

Response fields:

- `api_version` (string): Current API version
- `credentials.historyRestriction` (boolean): Whether history lookback is restricted for this key
- `credentials.historyRestrictToDays` (integer): Days of history allowed
- `credentials.namespaceRestriction` (boolean): Whether the key is limited to certain namespaces
- `credentials.namespacesAvailable[]` (string): Namespaces available to the key

```bash
curl 'https://data.rtt.io/api/info' \
  -H 'Authorization: Bearer YOUR_API_KEY'
```

Example response (200):

```json
{
  "api_version": "2026-01-18",
  "credentials": {
    "entitlements": [],
    "historyRestriction": true,
    "historyRestrictToDays": 14,
    "namespaceRestriction": true,
    "namespacesAvailable": [
      "gb-nr"
    ]
  }
}
```

---

Listings on OSINTtools.io are reviewed by editors and re-verified on a schedule; check pricing and availability on the vendor's site before relying on them, and use OSINT tools only with a lawful basis.
Site index for agents: https://osinttools.io/llms.txt · Full catalog: https://osinttools.io/llms-full.txt · MCP server (Streamable HTTP, no auth): https://osinttools.io/mcp/
