Wallogit.com
2017 © Pedro Peláez
Simple Client for tankstellenkoenig.de json api., (*1)
Inspired by https://github.com/tankerkoenig/tankerkoenig-php-client/, (*2)
composer require lxlang/tankerkoenig-php-client
The free Tankerkönig-Spritpreis-API is under creative commons., (*3)
Get your own API-Key here: https://creativecommons.tankerkoenig.de, (*4)
use Lang\Tankerkoenig\ApiClient;
$apiClient = new ApiClient("your-api-key-here");
// get over
$gasStations = $apiClient->search(
50.538472, //lat
8.649647, //lng
$apiClient::TYPE_E10 //your type of fuel
);
//echo results for testing
print_r($gasStations);
//unique id of a gas station $gasStationUuid = '51d4b6a2-a095-1aa0-e100-80009459e03a'; // returns an object of type \Lang\Tankerkoenig\GasStatsion $gasStation = $apiClient->detail($gasStationUuid); print_r($gasStation);