English | Deutsch
A Node wrapper for the Wiener Linien public transport API
yarn add wili || npm install wili
You will need a valid API key to access Wiener Linien's real-time data. Sign up here!
Use ES6 imports or require()
to include the module:
// ECMAScript Import
import WienerLinien from 'wili';
// CommonJS Require
const WienerLinien = require('wili');
Example usage in script:
import WienerLinien from 'wili';
// The API key can be omitted when
// process.env.WIENER_LINIEN_API_KEY is set
const wl = new WienerLinien(API_KEY);
const options = {
relatedLine: ['U2', 'U4', 'U6']
};
// Promise API
wl.trafficInfoList(options)
.then( data => {
console.log(data.trafficInfos);
})
.catch( error => {
console.error(error);
});
// async/await
(async () => {
try {
let data = await wl.trafficInfoList(options);
console.log(data.trafficInfos);
} catch (output) {
console.error(error);
}
})();
Usage: monitor(rbl, [options])
Returns real-time data for a station, including train information such as identifier or accessibility features.
Type: String
, Integer
, Array
RBL number (Rechnergestütztes Betriebsleitsystem - computer-aided operations control system), can be found this website
Type: String
, Array
Disruption type (stoerungkurz
, stoerunglang
, or aufzugsinfo
)
Usage: newsList(options)
Returns news, elevator maintenance and other information
Type: String
, Integer
, Array
Train or bus number, e.g. U1, S7, 59A (case-insensitive)
Type: String
, Integer
, Array
Station ID
Type: String
, Array
Information category, e.g news
or aufzugsservice
Usage: trafficInfoList([options])
Returns interruption of operations and elevator outage
Type: String
, Integer
, Array
Train or bus number, e.g. U1, S7, 59A (case-insensitive)
Type: String
, Integer
, Array
Station ID
Type: String
, Array
Disruption type (stoerungkurz
, stoerunglang
, or aufzugsinfo
)
This work is licensed under The MIT License
You are welcome to support this project using Flattr or Bitcoin 17CXJuPsmhuTzFV2k4RKYwpEHVjskJktRd