British Rail Enthusiast

British Rail Enthusiast · Actions GPT

Realtime Trains API

This API provides real-time information on train services and locations. For the Great British Railway.

  • GET /trains/v1/json/search/{station}getStationInfo

    Returns information on train services for a specific station.

  • GET /trains/v1/json/search/{station}/to/{toStation}getStationToStationInfo

    Returns information on train services from one station to another.

  • GET /trains/v1/json/service/{serviceUid}/{year}/{month}/{day}getServiceInfo

    Returns detailed information on a specific train service.

Schéma original API
{
  "openapi": "3.0.1",
  "info": {
    "title": "Realtime Trains API",
    "version": "1.0",
    "description": "This API provides real-time information on train services and locations. For the Great British Railway."
  },
  "servers": [
    {
      "url": "https://api.gptpersonalize.com/"
    }
  ],
  "paths": {
    "/trains/v1/json/search/{station}": {
      "get": {
        "operationId": "getStationInfo",
        "description": "Returns information on train services for a specific station.",
        "parameters": [
          {
            "name": "station",
            "in": "path",
            "description": "CRS or TIPLOC code of the station.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Information on train services for the specified station."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/trains/v1/json/search/{station}/to/{toStation}": {
      "get": {
        "operationId": "getStationToStationInfo",
        "description": "Returns information on train services from one station to another.",
        "parameters": [
          {
            "name": "station",
            "in": "path",
            "description": "CRS or TIPLOC code of the origin station.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "toStation",
            "in": "path",
            "description": "CRS or TIPLOC code of the destination station.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Information on train services between the specified stations."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    },
    "/trains/v1/json/service/{serviceUid}/{year}/{month}/{day}": {
      "get": {
        "operationId": "getServiceInfo",
        "description": "Returns detailed information on a specific train service.",
        "parameters": [
          {
            "name": "serviceUid",
            "in": "path",
            "description": "Unique identifier for the train service.",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "year",
            "in": "path",
            "description": "Year of service date.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "month",
            "in": "path",
            "description": "Month of service date.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "day",
            "in": "path",
            "description": "Day of service date.",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Detailed information of the specified train service."
          }
        },
        "security": [
          {
            "ApiKeyAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "api_key": {
        "type": "apiKey",
        "name": "X-Api-Key",
        "in": "header"
      }
    },
    "schemas": {}
  }
}