All Projects → juliuste → oebb

juliuste / oebb

Licence: ISC License
Austrian Federal Railways (ÖBB) API client.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to oebb

korail
Client for the South Korean korail railway API.
Stars: ✭ 47 (+17.5%)
Mutual labels:  railway, public-transport
comboios
Comboios de Portugal (CP, Portugese Railways) API client.
Stars: ✭ 32 (-20%)
Mutual labels:  railway, public-transport
db-prices
Find journey prices using the DB Sparpreise API.
Stars: ✭ 82 (+105%)
Mutual labels:  railway, public-transport
interrail
Find european train stations and routes. Client for the European Interrail / EuRail API.
Stars: ✭ 24 (-40%)
Mutual labels:  railway, public-transport
osrd
Open Source Railway Designer
Stars: ✭ 54 (+35%)
Mutual labels:  railway
matsim-sbb-extensions
matsim swiss rail
Stars: ✭ 23 (-42.5%)
Mutual labels:  public-transport
tripkit
Swift library for querying data from public transport providers.
Stars: ✭ 50 (+25%)
Mutual labels:  public-transport
european-transport-operators
NOT UP-TO-DATE ANYMORE, UNMAINTAINED. CHECK european-transport-feeds INSTEAD. List of european long-distance transport operators, available API endpoints, GTFS feeds and client modules.
Stars: ✭ 47 (+17.5%)
Mutual labels:  public-transport
ideas
How to make public transport more comfortable, more accessible, more transparent?
Stars: ✭ 35 (-12.5%)
Mutual labels:  public-transport
otp-tutorial
Introductory tutorial (approx. 3 hours) covering the setup and querying of an OpenTripPlanner instance
Stars: ✭ 85 (+112.5%)
Mutual labels:  public-transport
retro-gtfs
Collect real-time transit data and process it into a retroactive GTFS 'schedule' which can be used for routing/analysis
Stars: ✭ 45 (+12.5%)
Mutual labels:  public-transport
grafikon
Timetables for model railway. Useful for meets with modules (like FREMO, Free-mo etc).
Stars: ✭ 19 (-52.5%)
Mutual labels:  railway
gtfs-utils
Utilities to process GTFS data sets.
Stars: ✭ 19 (-52.5%)
Mutual labels:  public-transport
dm tomatrixled
Display (real-time) public transport departures using Raspberry Pi and LED matrices
Stars: ✭ 17 (-57.5%)
Mutual labels:  public-transport
time-space-train-planner
An SVG-based tool to visualize public transport journeys retrieved from a HAFAS system
Stars: ✭ 28 (-30%)
Mutual labels:  public-transport
github client
Open source bot telegram menggunakan bahasa code dart
Stars: ✭ 24 (-40%)
Mutual labels:  railway
LuasataGlance
Android Wear and mobile app providing real-time tram stop information for Dublin's Luas light rail service.
Stars: ✭ 21 (-47.5%)
Mutual labels:  public-transport
kiel-live
This app allows you to view live updates of bus arrivals.
Stars: ✭ 20 (-50%)
Mutual labels:  public-transport
pt2matsim
Package to create a multi-modal MATSim network and schedule from public transit data (GTFS or HAFAS) and an OSM map of the area.
Stars: ✭ 29 (-27.5%)
Mutual labels:  public-transport
MMM-PublicTransportBerlin
MagicMirror module to display public transport in Berlin and Brandenburg with BVG Hafas data.
Stars: ✭ 37 (-7.5%)
Mutual labels:  public-transport

oebb

Client for the Austrian Federal Railways (ÖBB) API. Inofficial, using endpoints by ÖBB. Ask them for permission before using this module in production. Actually, there should be no need for projects like this since endpoints for state-owned public transportation operators should be open to the public. It's 2017, 2018, 2019, 2020. By the way: Even Deutsche Bahn gets this now, and you don't ever want to be less progressive than them, because that would hurt their pride 😄.

This module conforms to the FPTI-JS 0.3.2 standard for JavaScript public transportation modules.

npm version Build Status license fpti-js version

Installation

npm install oebb

Usage

const oebb = require('oebb')

The oebb module conforms to the FPTI-JS 0.3.2 standard for JavaScript public transportation modules and exposes the following methods:

Method Feature description FPTI-JS 0.3.2
stations.search(query, [opt]) Search stations by query. yes
journeys(origin, destination, [opt]) Journeys between stations yes

stations.search(query, [opt])

Search stations by query. See this method in the FPTI-JS 0.3.2 spec.

Supported Options

Attribute Description FPTI-spec Value type Default
results Max. number of results returned Number null

Example

oebb.stations.search('Wie', { results: 2 }).then()
[
		{
			type: 'station',
			id: '1190100',
			name: 'Wien',
			meta: true, // indicates that this is a "meta" station, actually representing a group of stations, corresponding to the city of vienna in this case
			location: {
				type: 'location',
				longitude: 16.372134,
				latitude: 48.208547
			}
		},
		{
			type: 'station',
			id: '1290401',
			name: 'Wien Hbf (U)',
			meta: false,
			location: {
				type: 'location',
				longitude: 16.375326,
				latitude: 48.185507
			}
		}
	]

journeys(origin, destination, [opt])

Find journeys between stations. See this method in the FPTI-JS 0.3.2 spec.

Supported Options

Attribute Description FPTI-spec Value type Default
when Journey date, synonym to departureAfter Date new Date()
departureAfter List journeys with a departure (first leg) after this date Date new Date()
results Max. number of results returned Number null
interval Results for how many minutes after when/departureAfter Number null
transfers Max. number of transfers Number null
prices Add price information to journeys (spawning an additional request internally) Boolean true

Example

const berlin = '8011160' // station id
const vienna = { // FPTF station
    type: 'station',
    id: '1190100',
    name: 'Wien'
    // …
}

oebb.journeys(berlin, vienna, { when: new Date('2019-11-02T05:00:00+02:00'), results: 1 }).then()
[
	{
		type: 'journey',
		id: 'fb829242f221c309fb7fecf4fe87a7e169c084b23274d3c1d1f1a1ce2aed040b',
		legs: [
			{
				origin: {
					type: 'station',
					id: '8098160',
					name: 'Berlin Hbf (tief)'
				},
				destination: {
					type: 'station',
					id: '8010205',
					name: 'Leipzig Hbf'
				},
				departure: '2019-11-02T04:28:00+01:00',
				departurePlatform: '2',
				arrival: '2019-11-02T05:42:00+01:00',
				arrivalPlatform: '12',
				hasRealtimeInformation: false,
				line: {
					type: 'line',
					id: 'ICE 501',
					name: 'ICE 501',
					number: '501',
					product: {
						name: 'ICE',
						shortName: 'ICE',
						longName: {
							de: 'Intercity Express',
							en: 'Intercity Express',
							it: 'Intercity express'
						}
					},
					mode: 'train',
					public: true,
					operator: {
						type: 'operator',
						id: 'oebb',
						name: 'Österreichische Bundesbahnen',
						url: 'https://www.oebb.at/'
					}
				},
				mode: 'train',
				public: true,
				operator: {
					type: 'operator',
					id: 'oebb',
					name: 'Österreichische Bundesbahnen',
					url: 'https://www.oebb.at/'
				}
			},
			{
				origin: {
					type: 'station',
					id: '8010205',
					name: 'Leipzig Hbf'
				},
				destination: {
					type: 'station',
					id: '5400014',
					name: 'Praha hl.n.'
				},
				departure: '2019-11-02T05:54:00+01:00',
				departurePlatform: '15',
				arrival: '2019-11-02T09:26:00+01:00',
				arrivalPlatform: null,
				hasRealtimeInformation: false,
				line: {
					type: 'line',
					id: 'EC 259',
					name: 'EC 259',
					number: '259',
					product: {
						name: 'EC',
						shortName: 'EC',
						longName: {
							de: 'Eurocity',
							en: 'Eurocity',
							it: 'eurocity'
						}
					},
					mode: 'train',
					public: true,
					operator: {
						type: 'operator',
						id: 'oebb',
						name: 'Österreichische Bundesbahnen',
						url: 'https://www.oebb.at/'
					}
				},
				mode: 'train',
				public: true,
				operator: {
					type: 'operator',
					id: 'oebb',
					name: 'Österreichische Bundesbahnen',
					url: 'https://www.oebb.at/'
				}
			},
			{
				origin: {
					type: 'station',
					id: '5400014',
					name: 'Praha hl.n.'
				},
				destination: {
					type: 'station',
					id: '5400202',
					name: 'Breclav'
				},
				departure: '2019-11-02T09:50:00+01:00',
				departurePlatform: null,
				arrival: '2019-11-02T12:52:00+01:00',
				arrivalPlatform: null,
				hasRealtimeInformation: false,
				line: {
					type: 'line',
					id: 'EC 277',
					name: 'EC 277',
					number: '277',
					product: {
						name: 'EC',
						shortName: 'EC',
						longName: {
							de: 'Eurocity',
							en: 'Eurocity',
							it: 'eurocity'
						}
					},
					mode: 'train',
					public: true,
					operator: {
						type: 'operator',
						id: 'oebb',
						name: 'Österreichische Bundesbahnen',
						url: 'https://www.oebb.at/'
					}
				},
				mode: 'train',
				public: true,
				operator: {
					type: 'operator',
					id: 'oebb',
					name: 'Österreichische Bundesbahnen',
					url: 'https://www.oebb.at/'
				}
			},
			{
				origin: {
					type: 'station',
					id: '5400202',
					name: 'Breclav'
				},
				destination: {
					type: 'station',
					id: '8103000',
					name: 'Wien Hbf'
				},
				departure: '2019-11-02T12:55:00+01:00',
				departurePlatform: null,
				arrival: '2019-11-02T13:49:00+01:00',
				arrivalPlatform: '7C-E',
				hasRealtimeInformation: false,
				line: {
					type: 'line',
					id: 'EC 103',
					name: 'EC 103',
					number: '103',
					product: {
						name: 'EC',
						shortName: 'EC',
						longName: {
							de: 'Eurocity',
							en: 'Eurocity',
							it: 'eurocity'
						}
					},
					mode: 'train',
					public: true,
					operator: {
						type: 'operator',
						id: 'oebb',
						name: 'Österreichische Bundesbahnen',
						url: 'https://www.oebb.at/'
					}
				},
				mode: 'train',
				public: true,
				operator: {
					type: 'operator',
					id: 'oebb',
					name: 'Österreichische Bundesbahnen',
					url: 'https://www.oebb.at/'
				}
			}
		],
		price: {
			currency: 'EUR',
			amount: 186.4,
			firstClass: false
		}
	}
]

See also

  • oebb-hafas - JavaScript client for the OEBB Hafas API. Has a broader set of methods to lookup timetable information, but doesn't contain prices
  • db-prices - DB (german railways) price information

Contributing

If you found a bug or want to propose a feature, feel free to visit the issues page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].