PHP code example of kuromoka / cyger

1. Go to this page and download the library: Download kuromoka/cyger 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/ */

    

kuromoka / cyger example snippets




use Cyger\Client;

$client = new Client();
$result = $client->setExchange('Poloniex')->setPair('BTC_ETH')->getLastPrice();
echo $result['Poloniex']['BTC_ETH'];    // 0.04549105

$client = new Client();
$result = $client->setPair('BTC_ETH')->getLastPrice();
echo $result['Poloniex']['BTC_ETH'];     // 0.04549105
echo $result['Bittrex']['BTC_ETH'];      // 0.04577
echo $result['Coincheck']['BTC_ETH'];    // NULL (Coincheck doesn't support BTC_ETH pair.)

$client->setExchange('poloniex')    // OK
$client->setExchange('POLONIEX')    // OK
$client->setExchange('POLONIE')     // NG

$client->setPair('BTC_ETH');        // OK
$client->setPair('btc-eth');        // OK
$client->setPair('ETH/BTC');        // OK
$client->setPair('BTC:ETH');        // NG

$client = new Client();
$result = $client->setExchange('POLONIEX')->setPair('ETH/BTC')->getLastPrice();
echo $result['POLONIEX']['ETH/BTC'];    // 0.04549105