synyster0fa7x/ginko-rest-client

Rest API Client for Ginko

1.0.1 2018-05-24 11:03 UTC

This package is auto-updated.

Last update: 2024-05-06 08:53:25 UTC


README

CodeFactor

A simple client for Ginko Rest API

Install

composer require synyster0fa7x/ginko-rest-client

Usage

require_once('path/to/vendor/autoload.php');
use Ginko\GinkoClient;

$client = new GinkoClient([
    'apiKey' => 'YOUR_API_KEY'
]); 
// NOTE : api_key is optionnal until 2019

$stops = $client->getStops(); // return all bus stops

$waitingTimes = $client->getWaitingTimeList([
    [
        'name' => 'haut du chazal',
        'lineId' => '101',
        'rightWay' => 1
    ], 
    [
        'name' => 'chalezeule',
        'lineId' => '101',
        'rightWay' => 0
    ]
]);

// echo '<pre>';var_dump($waitingTimes[0]->waitingTimes);echo '</pre>';die;

//show all client method's
//echo '<pre>';var_dump(get_class_methods($client));echo '</pre>';die;

You can check all files in src/Entity directory to learn how datas are mapped from the API return. All client's methods are documented.

API Documentation

All informations are available at https://api.ginko.voyage/#prez

License

This project is open-sourced software licensed under the MIT license.