Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 2.33 KB

README.md

File metadata and controls

56 lines (37 loc) · 2.33 KB

An alternative JSON API for Berlin's public transportation authority based on bvg-grabber by @MarkusH.

Usage

/scheduled returns scheduled departure times and accepts the following options:

  • station - the station from which to retrieve departures
  • vehicles- 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

Response

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"
    }]]
]

Examples

Motivation

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.

Development Information

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.

Running Locally

Make sure you have Python installed properly.

$ pip install -r requirements.txt
$ foreman start web