This endpoint provides data about UK Railway stations. It provides reference data about a specific railway station, which can be broken down into smaller chunks of data, depending on what's required.

Some endpoints within this one also provide real-time information like notifications and departure boards.

Please make certain you have read the Conditions of use before using this API.

This endpoint is broken down to the main details shown on this page using the base URL http://api.area51.onl/rail/1/station/:crs

You can then filter the data down by appending the portion you are interested in to the end of the URL. For example:

station/:crs/feature
GeoJSON Feature for a station
station/:crs/location
Details about the station
station/:crs/operator
Information about the operator managing a station

Some endpoints contain real-time data and are not included at this level. These are:

station/:crs/boards
Live departure boards
station/:crs/messages
Live messages about disruption at a station

Station details

This is the main node querying data about a station. Using it's 3Alpha/CRS code you can get general detail about that station. For example:

$ curl -s http://api.area51.onl/rail/1/station/MDE | jq '.' 
{
  "location": {
    "name": "Maidstone East",
    "crs": "MDE",
    "stanox": 89403,
    "nalco": 511500,
    "nlccheck": "Q",
    "caps": 32,
    "tiplocs": [
      "MSTONEE"
    ],
    "osgb": [
      {
        "tiploc": "MSTONEE",
        "easting": 575949,
        "northing": 156206
      }
    ],
    "wgs84": [
      {
        "tiploc": "MSTONEE",
        "longitude": 0.520249,
        "latitude": 51.2776
      }
    ]
  },
  "operator": {
    "code": "SE",
    "name": "Southeastern",
    "url": "http://www.nationalrail.co.uk/tocs_maps/tocs/SE.aspx"
  }
}

The response is broken down into multiple keys:

location
Data about the location of this station. The fields are described in the location endpoint.
operator
Information about the operator. The fields are described in the operator endpoint.