mkerix / php-bvg
An unofficial API for the BVG (Berlin Public Transportation Services) for PHP.
Installs: 17
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 2
pkg:composer/mkerix/php-bvg
Requires
- php: ^7.0
- nesbot/carbon: ^1.21
- paquettg/php-html-parser: ^1.6
- rmccue/requests: ^1.6
Requires (Dev)
- phpunit/phpunit: 5.2.*
This package is not auto-updated.
Last update: 2021-06-09 08:46:17 UTC
README
An unofficial API for the BVG (Berlin Public Transportation Services) for PHP.
Installation
This package can be found on Packagist and is best loaded using Composer.
$ composer require mkerix/php-bvg
Usage
You can search for the ID of a station using a search term:
$stations = BVGApi\Station::getStations('alexanderplatz');
With the ID you can get the departures starting at a given point in time, which is symbolized by a Carbon object:
$time = \Carbon\Carbon::create(2016, 3, 21, 12, 0, 0, 'Europe/Berlin'); $departures = BVGApi\Station::getDepartures(9100003, $time);