kr1sp1n / bvg-api

An inofficial API for the BVG (Berlin Public Transportation Services) written for node.js

Home Page:https://bvg-api.herokuapp.com/station?input=alexanderplatz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Request for limited number of departures

deg0nz opened this issue · comments

commented

Hi,
first of all: Good work, thanks for the API! :)

Is it possible to pull just a few JSON Objects from the server within the request URL?

For example:
I want to get only the next 5 departures for my station to avoid an data overhead with all the other departure times, but query the server more often for departures in the near future to get an up-to-date list. (Alexanderplatz and Frankfurter Allee for example return many many objects)

My goal is: I want to write a BVG-Plugin for the MagicMirror Project
For that, only a limited number of the next departures is needed.
I could get the whole output and get the first 5 objects of the array, but it's a waste of bandwidth in my optinion...

Greetz!
B.

vbb-hafas already does this. You could either use that one directly (although one needs an API) or copy the code.

commented

Ah, yeah. That looks nice! I didn't even know, that a thing like HAFAS even exists.
I'll give it a try.

Thanks, @derhuerst