A simple Skånetrafiken PHP API client.
composer require jeppos/skanetrafiken-php-api-client
Following example shows how to get upcoming departures from Malmö C.
use Jeppos\SkanetrafikenApiClient\SerializerFactory;
use Jeppos\SkanetrafikenApiClient\Service\DepartureBoard;
$guzzleClient = new \GuzzleHttp\Client([
'base_uri' => 'http://www.labs.skanetrafiken.se/v2.2/' // Version 2.2 of Skånetrafiken API
]);
$departureBoard = new DepartureBoard($guzzleClient, SerializerFactory::create());
$departureBoard->setStopAreaId(80000); // 80000 = Malmö C
$departureBoard->call();
$response = $departureBoard->getResponse();