{"openapi":"3.1.0","info":{"title":"TFINTA Realtime API","description":"REST API for Irish Rail Realtime data (stations, running trains, station boards, train movements).","version":"2.2.0"},"servers":[{"url":"/","description":"Current server"}],"paths":{"/health":{"get":{"tags":["health"],"summary":"Health check","description":"Liveness / readiness probe for Cloud Run.\n\nReturns:\n  dict[str, str]: status and version.","operationId":"health","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health"}}}}}}},"/stations":{"get":{"tags":["stations"],"summary":"List all Irish Rail stations","description":"Return every station known to Irish Rail Realtime.\n\nReturns:\n  dm.StationsResponse: all stations.\n\nRaises:\n  fastapi.HTTPException: upstream error (502).","operationId":"getStations","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationsResponse"}}}},"502":{"description":"Upstream Irish Rail API error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/running":{"get":{"tags":["trains"],"summary":"List currently running trains","description":"Return all trains currently operating on the network.\n\nReturns:\n  dm.RunningTrainsResponse: running trains.\n\nRaises:\n  fastapi.HTTPException: upstream error (502).","operationId":"getRunningTrains","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunningTrainsResponse"}}}},"502":{"description":"Upstream Irish Rail API error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/station/{station_code}":{"get":{"tags":["stations"],"summary":"Station departure/arrival board","description":"Trains due to serve the given station in the next ~90 minutes.\n\nReturns:\n  dm.StationBoardResponse: station board.\n\nRaises:\n  fastapi.HTTPException: upstream error (502).","operationId":"getStationBoard","parameters":[{"name":"station_code","in":"path","required":true,"schema":{"type":"string","description":"Either a 5-letter station code (e.g. ``LURGN``) or a search fragment that uniquely identifies a station (e.g. ``lurgan``).","examples":["LURGN","lurgan"],"title":"Station Code"},"description":"Either a 5-letter station code (e.g. ``LURGN``) or a search fragment that uniquely identifies a station (e.g. ``lurgan``)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StationBoardResponse"}}}},"502":{"description":"Upstream Irish Rail API error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/train/{train_code}":{"get":{"tags":["trains"],"summary":"Train movements / stops","description":"Return the ordered list of stops for a single train on a given day.\n\nReturns:\n  dm.TrainMovementsResponse: train movements.\n\nRaises:\n  fastapi.HTTPException: upstream error (502).","operationId":"getTrainMovements","parameters":[{"name":"train_code","in":"path","required":true,"schema":{"type":"string","description":"Train code, e.g. ``E108``.","examples":["E108"],"title":"Train Code"},"description":"Train code, e.g. ``E108``."},{"name":"day","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":21991231,"minimum":20000101},{"type":"null"}],"description":"Day in YYYYMMDD format.  Defaults to today (UTC).","examples":[20260201],"title":"Day"},"description":"Day in YYYYMMDD format.  Defaults to today (UTC)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainMovementsResponse"}}}},"502":{"description":"Upstream Irish Rail API error.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"DayRangeModel":{"properties":{"arrival":{"anyOf":[{"$ref":"#/components/schemas/DayTimeModel"},{"type":"null"}],"description":"Arrival time"},"departure":{"anyOf":[{"$ref":"#/components/schemas/DayTimeModel"},{"type":"null"}],"description":"Departure time"}},"type":"object","title":"DayRangeModel","description":"Arrival / departure pair."},"DayTimeModel":{"properties":{"seconds":{"type":"integer","title":"Seconds","description":"Seconds since midnight"},"hms":{"type":"string","title":"Hms","description":"Human-readable HH:MM:SS"}},"type":"object","required":["seconds","hms"],"title":"DayTimeModel","description":"Time during a day expressed as seconds since midnight *and* as ``HH:MM:SS``."},"ErrorResponse":{"properties":{"detail":{"type":"string","title":"Detail","description":"Human-readable error message."}},"type":"object","required":["detail"],"title":"ErrorResponse","description":"Standard error body returned by all non-2xx responses."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"PointModel":{"properties":{"latitude":{"type":"number","title":"Latitude","description":"Latitude in decimal degrees (WGS84)"},"longitude":{"type":"number","title":"Longitude","description":"Longitude in decimal degrees (WGS84)"}},"type":"object","required":["latitude","longitude"],"title":"PointModel","description":"A geographic point (WGS-84)."},"RunningTrainModel":{"properties":{"code":{"type":"string","title":"Code","description":"Train code, e.g. 22000 or DART10"},"status":{"type":"string","enum":["TERMINATED","NOT_YET_RUNNING","RUNNING"],"title":"Status","description":"Train status."},"day":{"type":"string","format":"date","title":"Day","description":"Day of this train."},"direction":{"type":"string","title":"Direction","description":"Direction of the train."},"message":{"type":"string","title":"Message","description":"Public message for the train."},"position":{"anyOf":[{"$ref":"#/components/schemas/PointModel"},{"type":"null"}],"description":"Geographical position of the train."}},"type":"object","required":["code","status","day","direction","message"],"title":"RunningTrainModel","description":"A currently running train."},"RunningTrainsResponse":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of running trains returned"},"trains":{"items":{"$ref":"#/components/schemas/RunningTrainModel"},"type":"array","title":"Trains","description":"List of running trains"}},"type":"object","required":["count","trains"],"title":"RunningTrainsResponse","description":"Response for the running-trains endpoint."},"StationBoardResponse":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of lines returned"},"lines":{"items":{"$ref":"#/components/schemas/StationLineModel"},"type":"array","title":"Lines","description":"List of station board lines"}},"type":"object","required":["count","lines"],"title":"StationBoardResponse","description":"Response for the station-board endpoint."},"StationLineModel":{"properties":{"train_code":{"type":"string","title":"Train Code","description":"Train code, e.g. 22000 or DART10"},"origin_code":{"type":"string","title":"Origin Code","description":"Origin station code."},"origin_name":{"type":"string","title":"Origin Name","description":"Origin station name."},"destination_code":{"type":"string","title":"Destination Code","description":"Destination station code."},"destination_name":{"type":"string","title":"Destination Name","description":"Destination station name."},"trip":{"anyOf":[{"$ref":"#/components/schemas/DayRangeModel"},{"type":"null"}],"description":"Trip information."},"direction":{"type":"string","title":"Direction","description":"Direction of the train."},"due_in":{"anyOf":[{"$ref":"#/components/schemas/DayTimeModel"},{"type":"null"}],"description":"Time until the train is due (in seconds inside DayTimeModel)."},"late":{"type":"integer","title":"Late","description":"Minutes the train is late."},"location_type":{"type":"string","enum":["STOP","ORIGIN","DESTINATION","TIMING_POINT","CREW_RELIEF_OR_CURRENT"],"title":"Location Type","description":"Type of this location in the journey."},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","description":"Current status of the train."},"train_type":{"type":"string","enum":["UNKNOWN","DMU","DART","ICR","LOCO"],"title":"Train Type","description":"Rolling stock type."},"last_location":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Location","description":"Last known location of the train."},"scheduled":{"anyOf":[{"$ref":"#/components/schemas/DayRangeModel"},{"type":"null"}],"description":"Scheduled times for the train."},"expected":{"anyOf":[{"$ref":"#/components/schemas/DayRangeModel"},{"type":"null"}],"description":"Expected times for the train."}},"type":"object","required":["train_code","origin_code","origin_name","destination_code","destination_name","direction","late","location_type","train_type"],"title":"StationLineModel","description":"A single line on a station departure/arrival board."},"StationModel":{"properties":{"id":{"type":"integer","title":"Id","description":"Unique station ID, e.g. 140 for Bray"},"code":{"type":"string","title":"Code","description":"5-letter uppercase code, e.g. LURGN"},"description":{"type":"string","title":"Description","description":"Station name, e.g. Bray"},"location":{"anyOf":[{"$ref":"#/components/schemas/PointModel"},{"type":"null"}],"description":"Geographical location of the station"},"alias":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Alias","description":"Alternative name or alias for the station"}},"type":"object","required":["id","code","description"],"title":"StationModel","description":"A rail station."},"StationsResponse":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of stations returned"},"stations":{"items":{"$ref":"#/components/schemas/StationModel"},"type":"array","title":"Stations","description":"List of stations"}},"type":"object","required":["count","stations"],"title":"StationsResponse","description":"Response for the stations endpoint."},"TrainMovementsResponse":{"properties":{"count":{"type":"integer","title":"Count","description":"Number of stops returned"},"stops":{"items":{"$ref":"#/components/schemas/TrainStopModel"},"type":"array","title":"Stops","description":"List of train stops"}},"type":"object","required":["count","stops"],"title":"TrainMovementsResponse","description":"Response for the train-movements endpoint."},"TrainStopModel":{"properties":{"station_code":{"type":"string","title":"Station Code","description":"Station code"},"station_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Station Name","description":"Station name"},"station_order":{"type":"integer","title":"Station Order","description":"Order of the station in the journey"},"location_type":{"type":"string","enum":["STOP","ORIGIN","DESTINATION","TIMING_POINT","CREW_RELIEF_OR_CURRENT"],"title":"Location Type","description":"Type of this location in the journey."},"stop_type":{"type":"string","enum":["UNKNOWN","CURRENT","NEXT"],"title":"Stop Type","description":"Whether this is the current/next stop."},"auto_arrival":{"type":"boolean","title":"Auto Arrival","description":"Whether the arrival is automatic"},"auto_depart":{"type":"boolean","title":"Auto Depart","description":"Whether the departure is automatic"},"scheduled":{"anyOf":[{"$ref":"#/components/schemas/DayRangeModel"},{"type":"null"}],"description":"Scheduled times for the train"},"expected":{"anyOf":[{"$ref":"#/components/schemas/DayRangeModel"},{"type":"null"}],"description":"Expected times for the train"},"actual":{"anyOf":[{"$ref":"#/components/schemas/DayRangeModel"},{"type":"null"}],"description":"Actual times for the train"}},"type":"object","required":["station_code","station_order","location_type","stop_type","auto_arrival","auto_depart"],"title":"TrainStopModel","description":"A single stop in a train's journey."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}