Home

Awesome

oebb-hafas

Client for the Austrian Railways (ÖBB) HAFAS API. It acts as a consistent and straightforward interface on top of a verbose API.

This project is actually a thin wrapper around hafas-client. Its docs document the API in general.

npm version license chat on gitter

Installing

npm install oebb-hafas

API

Check the docs for hafas-client as well as the ÖBB-specific customisations.

Getting Started

const hafas = require('oebb-hafas')('your-user-agent')

As an example, we will search for a route from Wien Westbahnhof to Salzburg Hbf. To get the station ids, use locations(query, [opt]).

client.journeys('1291501', '8100002')
.then((journeys) => console.log(journeys[0]))
.catch(console.error)

Similar Projects

Contributing

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