An alternative JSON API for Berlin's public transportation authority based on bvg-grabber by @MarkusH.
/scheduled
returns scheduled departure times and accepts the following options:
station
- the station from which to retrieve departuresvehicles
- the medium(s) of transport to look up (accepts S,U,TRAM,BUS,FERRY,RB,IC)limit
- the number of results to return
/actual
returns actual departure times and accepts the following options:
station
- the station from which to retrieve departures
The JSON response is a list of depatures:
[
["S Prenzlauer Allee", [{
"start": "S Prenzlauer Allee",
"remaining": -300,
"line": "S41\n\n(Gl. 1)",
"end": "Ringbahn S 41"
}, {
"start": "S Prenzlauer Allee",
"remaining": -300,
"line": "S41\n\n(Gl. 1)",
"end": "Ringbahn S 41"
}]]
]
- https://bvg-grabber-api.herokuapp.com/scheduled?station=S%20Prenzlauer%20Allee%20(Berlin)&vehicles=BUS,S&limit=2
- https://bvg-grabber-api.herokuapp.com/actual?station=S%20Prenzlauer%20Allee%20(Berlin)
Although BVG provides an API for web developers, one must submit an application for its use. This API provides some of the features of the official API without the hassle of applying.
This app is based on Heroku's Getting Started with Python on Heroku tutorial and has been upgraded to support Python 3.4.2 according to some very useful information on Stack Overflow.
Make sure you have Python installed properly.
$ pip install -r requirements.txt
$ foreman start web