UNPKG

19.8 kBJSONView Raw
1{"openapi":"3.0.0","servers":[{"description":"Production Server (uses live data)","url":"https://api.departureboard.io/api/v1.0"}],"info":{"contact":{"x-twitter":"departure_board"},"description":"The departureboard.io API is a high performance API, written in Golang, that provides two main functions. A REST API interface to the legacy National Rail SOAP API, giving developers the ability to pull live information on departures, arrivals, and services from National Rail, without having to use the legacy SOAP API, and a REST API interface for additional National Rail information, giving developers the ability to pull a range of information about the Rail Network, via a REST API interface. This is not an offering that National Rail currently provide, and is custom developed. Data is sourced from periodically updated XML documents, parsed, and provided for consumption via the departureboard.io API.","title":"departureboard.io","version":"1.0","x-apisguru-categories":["transport"],"x-logo":{"url":"https://twitter.com/departure_board/profile_image?size=original"},"x-origin":[{"converter":{"url":"https://github.com/lucybot/api-spec-converter","version":"2.7.31"},"format":"openapi","url":"https://api.departureboard.io/openapi.json","version":"3.0"}],"x-providerName":"departureboard.io"},"paths":{"/getArrivalsAndDeparturesByCRS/{CRS}":{"get":{"operationId":"getArrivalsAndDeparturesByCRS","parameters":[{"description":"The CRS (Computer Reservation System) for the Station you wish to get departure and arrival information for, e.g. KGX for London Kings Cross.","explode":false,"in":"path","name":"CRS","required":true,"schema":{"maxLength":3,"minLength":3,"type":"string"},"style":"simple"},{"description":"The National Rail OpenLDBWS API Key to use for looking up service information. You must register with National Rail to obtain this key.","explode":true,"in":"query","name":"apiKey","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The number of arriving and departing services to return. This is a maximum value, less may be returned if there is not a sufficient amount of services arriving to or departing from this station within the time window specified.","explode":true,"in":"query","name":"numServices","required":false,"schema":{"default":10,"type":"integer"},"style":"form"},{"description":"The time window in minutes to offset the arrival and departure information by. For example, a value of 20 will not show services arriving to or departing from the station within the next 20 minutes.","explode":true,"in":"query","name":"timeOffset","required":false,"schema":{"default":0,"maximum":119,"minimum":-239,"type":"integer"},"style":"form"},{"description":"The time window in minutes to offset the arrival and departure information by. For example, a value of 20 will not show services arriving to or departing from the selected station within the next 20 minutes.","explode":true,"in":"query","name":"timeWindow","required":false,"schema":{"default":120,"minimum":0,"type":"integer"},"style":"form"},{"description":"Should the response contain information on the calling points for each service? If set to false, calling points will not be returned.","explode":true,"in":"query","name":"serviceDetails","required":false,"schema":{"default":true,"type":"boolean"},"style":"form"},{"description":"The CRS (Computer Reservation System) code to filter the results by. When setting this you must also set the filterType parameter. For example, performing a lookup for PAD (London Paddington) and setting filterStation to RED (Reading) and filterType to from, will only show services arriving to London Paddington that stopped at Reading. Setting a filter for getArrivalsAndDeparturesByCRS is similar to performing a getArrivalsByCRS or getDeparturesByCRS lookup, with the appropriate filterStation parameter. However using the getArrivalsAndDeparturesByCRS endpoint shows more details for each of the returned services.","explode":true,"in":"query","name":"filterStation","required":false,"schema":{"type":"string"},"style":"form"},{"description":"Determines if the filterStation parameter should be applied for services arriving to, or leaving from the selected station. Required if filterStation is set.","explode":true,"in":"query","name":"filterType","required":false,"schema":{"type":"string"},"style":"form"}],"responses":{"200":{"description":"OK -- The API request was successful, and returned a response."},"400":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"401":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"405":{"description":"Method Not Allowed -- You tried to call the API endpoint with an invalid method."},"429":{"description":"Too Many Requests -- You have exceeded the rate limit. Get in touch to arrange an exception, or slow down."},"500":{"description":"Internal Server Error -- We had a problem with our server. Try again later."}},"summary":"getArrivalsAndDeparturesByCRS is used to get a list of services arriving to and departing from a UK train station by the CRS (Computer Reservation System) code. This will typically return a list of train services, but will also return any replacement bus or ferry services that are in place.","tags":["Departures & Arrivals"]}},"/getArrivalsByCRS/{CRS}":{"get":{"operationId":"getArrivalsByCRS","parameters":[{"description":"The CRS (Computer Reservation System) for the Station you wish to get arrival information for, e.g. KGX for London Kings Cross.","explode":false,"in":"path","name":"CRS","required":true,"schema":{"maxLength":3,"minLength":3,"type":"string"},"style":"simple"},{"description":"The National Rail OpenLDBWS API Key to use for looking up service information. You must register with National Rail to obtain this key.","explode":true,"in":"query","name":"apiKey","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The number of arriving train services to return. This is a maximum value, less may be returned if there is not a sufficient amount of services running to this station within the time window specified.","explode":true,"in":"query","name":"numServices","required":false,"schema":{"default":10,"type":"integer"},"style":"form"},{"description":"The time window in minutes to offset the arrival information by. For example, a value of 20 will not show services arriving within the next 20 minutes.","explode":true,"in":"query","name":"timeOffset","required":false,"schema":{"default":0,"maximum":119,"minimum":-239,"type":"integer"},"style":"form"},{"description":"The time window to show train services for in minutes. For example, a value of 60 will show services arriving to the station in the next 60 minutes.","explode":true,"in":"query","name":"timeWindow","required":false,"schema":{"default":120,"minimum":0,"type":"integer"},"style":"form"},{"description":"Should the response contain information on the calling points for each service? If set to false, calling points will not be returned.","explode":true,"in":"query","name":"serviceDetails","required":false,"schema":{"default":true,"type":"boolean"},"style":"form"},{"description":"The CRS (Computer Reservation System) code to filter the results by. For example, performing a lookup for PAD (London Paddington) and setting filterStation to RED (Reading), will only show services arriving to Paddington that stopped at Reading.","explode":true,"in":"query","name":"filterStation","required":false,"schema":{"type":"string"},"style":"form"}],"responses":{"200":{"description":"OK -- The API request was successful, and returned a response."},"400":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"401":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"405":{"description":"Method Not Allowed -- You tried to call the API endpoint with an invalid method."},"429":{"description":"Too Many Requests -- You have exceeded the rate limit. Get in touch to arrange an exception, or slow down."},"500":{"description":"Internal Server Error -- We had a problem with our server. Try again later."}},"summary":"getArrivalsByCRS is used to get a list of services arriving to a UK train station by the CRS (Computer Reservation System) code. This will typically return a list of train services, but will also return any replacement bus or ferry services that are in place.","tags":["Departures & Arrivals"]}},"/getDeparturesByCRS/{CRS}":{"get":{"operationId":"getDeparturesByCRS","parameters":[{"description":"The CRS (Computer Reservation System) for the station you wish to get departure information for, e.g. KGX for London Kings Cross.","explode":false,"in":"path","name":"CRS","required":true,"schema":{"maxLength":3,"minLength":3,"type":"string"},"style":"simple"},{"description":"The National Rail OpenLDBWS API Key to use for looking up service information. You must register with National Rail to obtain this key.","explode":true,"in":"query","name":"apiKey","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The number of departing services to return. This is a maximum value, less may be returned if there is not a sufficient amount of services running from the selected station within the time window specified.","explode":true,"in":"query","name":"numServices","required":false,"schema":{"default":10,"type":"integer"},"style":"form"},{"description":"The time window in minutes to offset the departure information by. For example, a value of 20 will not show services departing within the next 20 minutes.","explode":true,"in":"query","name":"timeOffset","required":false,"schema":{"default":0,"maximum":119,"minimum":-239,"type":"integer"},"style":"form"},{"description":"The time window to show services for in minutes. For example, a value of 60 will show services departing the station in the next 60 minutes.","explode":true,"in":"query","name":"timeWindow","required":false,"schema":{"default":120,"minimum":0,"type":"integer"},"style":"form"},{"description":"Should the response contain information on the calling points for each service? If set to false, calling points will not be returned.","explode":true,"in":"query","name":"serviceDetails","required":false,"schema":{"default":true,"type":"boolean"},"style":"form"},{"description":"The CRS (Computer Reservation System) code to filter the results by. For example, performing a lookup for PAD (London Paddington) and setting filterStation to RED (Reading), will only show services departing from Paddington that stop at Reading.","explode":true,"in":"query","name":"filterStation","required":false,"schema":{"type":"string"},"style":"form"}],"responses":{"200":{"description":"OK -- The API request was successful, and returned a response."},"400":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"401":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"405":{"description":"Method Not Allowed -- You tried to call the API endpoint with an invalid method."},"429":{"description":"Too Many Requests -- You have exceeded the rate limit. Get in touch to arrange an exception, or slow down."},"500":{"description":"Internal Server Error -- We had a problem with our server. Try again later."}},"summary":"getDeparturesByCRS is used to get a list of services departing from a UK train station by the CRS (Computer Reservation System) code. This will typically return a list of train services, but will also return any replacement bus or ferry services that are in place.","tags":["Departures & Arrivals"]}},"/getFastestDeparturesByCRS/{CRS}":{"get":{"operationId":"getFastestDeparturesByCRS","parameters":[{"description":"The CRS (Computer Reservation System) for the station you wish to get departure information for, e.g. KGX for London Kings Cross.","explode":false,"in":"path","name":"CRS","required":true,"schema":{"maxLength":3,"minLength":3,"type":"string"},"style":"simple"},{"description":"The National Rail OpenLDBWS API Key to use for looking up service information. You must register with National Rail to obtain this key.","explode":true,"in":"query","name":"apiKey","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The CRS (Computer Reservation System) codes to show the fastest departing services to. Up to 20 destination stations can be specified. These should be split by a comma, for example HAY,EAL,PAD.","explode":true,"in":"query","name":"filterList","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The time window in minutes to offset the departure information by. For example, a value of 20 will show the fastest services departing after 20 minutes.","explode":true,"in":"query","name":"timeOffset","required":false,"schema":{"default":0,"maximum":119,"minimum":-239,"type":"integer"},"style":"form"},{"description":"The time window to show train services for in minutes. For example, a value of 60 will show the fastest services departing the station in the next 60 minutes.","explode":true,"in":"query","name":"timeWindow","required":false,"schema":{"default":120,"minimum":0,"type":"integer"},"style":"form"},{"description":"Should the response contain information on the calling points for each service? If set to false, calling points will not be returned.","explode":true,"in":"query","name":"serviceDetails","required":false,"schema":{"default":true,"type":"boolean"},"style":"form"}],"responses":{"200":{"description":"OK -- The API request was successful, and returned a response."},"400":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"401":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"405":{"description":"Method Not Allowed -- You tried to call the API endpoint with an invalid method."},"429":{"description":"Too Many Requests -- You have exceeded the rate limit. Get in touch to arrange an exception, or slow down."},"500":{"description":"Internal Server Error -- We had a problem with our server. Try again later."}},"summary":"getFastestDeparturesByCRS is used to get the fastest next service running between two stations. Multiple destinations can be specified. This will typically return a single train service, but will also return a replacement bus or ferry service if in place.","tags":["Fastest and Next Departures"]}},"/getNextDeparturesByCRS/{CRS}":{"get":{"operationId":"getNextDeparturesByCRS","parameters":[{"description":"The CRS (Computer Reservation System) for the station you wish to get departure information for, e.g. KGX for London Kings Cross.","explode":false,"in":"path","name":"CRS","required":true,"schema":{"maxLength":3,"minLength":3,"type":"string"},"style":"simple"},{"description":"The National Rail OpenLDBWS API Key to use for looking up service information. You must register with National Rail to obtain this key.","explode":true,"in":"query","name":"apiKey","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The CRS (Computer Reservation System) codes to show departing services to. Up to 20 destination stations can be specified. These should be split by a comma, for example HAY,EAL,PAD.","explode":true,"in":"query","name":"filterList","required":true,"schema":{"type":"string"},"style":"form"},{"description":"The time window in minutes to offset the arrival and departure information by. For example, a value of 20 will not show services arriving to or departing from the station within the next 20 minutes.","explode":true,"in":"query","name":"timeOffset","required":false,"schema":{"default":0,"maximum":119,"minimum":-239,"type":"integer"},"style":"form"},{"description":"The time window in minutes to offset the arrival and departure information by. For example, a value of 20 will not show services arriving to or departing from the selected station within the next 20 minutes.","explode":true,"in":"query","name":"timeWindow","required":false,"schema":{"default":120,"minimum":0,"type":"integer"},"style":"form"},{"description":"Should the response contain information on the calling points for each service? If set to false, calling points will not be returned.","explode":true,"in":"query","name":"serviceDetails","required":false,"schema":{"default":true,"type":"boolean"},"style":"form"}],"responses":{"200":{"description":"OK -- The API request was successful, and returned a response."},"400":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"401":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"405":{"description":"Method Not Allowed -- You tried to call the API endpoint with an invalid method."},"429":{"description":"Too Many Requests -- You have exceeded the rate limit. Get in touch to arrange an exception, or slow down."},"500":{"description":"Internal Server Error -- We had a problem with our server. Try again later."}},"summary":"getNextDeparturesByCRS is used to get the next service running between two stations. Multiple destinations can be specified. This will typically return a single train service, but will also return a replacement bus or ferry service if in place. This will return the next departures for each of the filterList stations specified. It may not return the fastest next service. To get the fastest next service use the getFastestDeparturesByCRS endpoint.","tags":["Fastest and Next Departures"]}},"/getServiceDetailsByID/{serviceID}":{"get":{"operationId":"getServiceDetailsByID","parameters":[{"description":"The Service ID for the Train Service you wish to look up in the URL Safe format. For example \"qsec4O8LW7k8ITcOt_ir4Q--\".","explode":false,"in":"path","name":"serviceID","required":true,"schema":{"type":"string"},"style":"simple"},{"description":"The National Rail OpenLDBWS API Key to use for looking up service information. You must register with National Rail to obtain this key.","explode":true,"in":"query","name":"apiKey","required":true,"schema":{"type":"string"},"style":"form"}],"responses":{"200":{"description":"OK -- The API request was successful, and returned a response."},"400":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"401":{"description":"Bad Request -- Your request is invalid. See the error message for more information."},"405":{"description":"Method Not Allowed -- You tried to call the API endpoint with an invalid method."},"429":{"description":"Too Many Requests -- You have exceeded the rate limit. Get in touch to arrange an exception, or slow down."},"500":{"description":"Internal Server Error -- We had a problem with our server. Try again later."}},"summary":"getServiceDetailsByID is used to get information on a service, by the Service ID. This will typically return a train service, but will also return a bus and ferry services. The Service ID must be provided in the serviceIDUrlSafe format that is provided in the response for Arrival and Departure Boards. If required, these can be manually converted replacing: \"=\" with \"/\" and \"/\" with \"_\". For example, a National Rail Service ID of qsec4O8LW7k8ITcOt/ir4Q== becomes qsec4O8LW7k8ITcOt_ir4Q--. However, you should be using the value provided in the Arrival and Departure Board responses. A service ID is specific to a station, and can only be looked up for a short time after a train/bus/ferry arrives at, or departs from a station. This is a National Rail limitation.","tags":["Service Information"]}}},"components":{}}
\No newline at end of file