PHP code example of sokolnikov911 / yandex-schedule

1. Go to this page and download the library: Download sokolnikov911/yandex-schedule library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

sokolnikov911 / yandex-schedule example snippets


$client = new Client('yourApiKeyHere');

echo $client->getScheduleBetweenStations('NYC', 'SVO',
    Client::TRANSPORT_TYPE_PLANE, Client::SYSTEM_IATA);

echo $client->getScheduleOnStation('2200001', Client::TRANSPORT_TYPE_TRAIN, Client::SYSTEM_EXPRESS);

echo $client->getListStationsRoute('228P_1_2');

echo $client->getCarrier('TK', Client::SYSTEM_IATA);

echo $client->getNearestStations('50.440046', '40.4882367', '40');

echo $client->getCopyright();

$client->setDataFormat(Client::DATA_FORMAT_XML);
$client->setLanguage(Client::DATA_LANG_UK);


bash
# Install Composer
curl -sS https://getcomposer.org/installer | php
bash
php composer.phar