PHP code example of codenix-sv / bitfinex-api

1. Go to this page and download the library: Download codenix-sv/bitfinex-api 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/ */

    

codenix-sv / bitfinex-api example snippets


use Codenixsv\BitfinexApi\BitfinexClient;

$client = new BitfinexClient();
$data = $client->public()->getPlatformStatus();

$data = $client->public()->getPlatformStatus();

$data = $client->public()->getTickers('tBTCUSD,tLTCUSD,fUSD');

$data = $client->public()->getTicker('tBTCUSD');

$data = $client->public()->getTrades('tBTCUSD', ['limit' => 100]);

$data = $client->public()->getBook('tBTCUSD', 'P0');

$data = $client->public()->getStats('pos.size', '1m', 'tBTCUSD', 'hist', 'long');
$data = $client->public()->getStats('funding.size', '1m', 'fUSD', 'hist');

$data = $client->public()->getCandles('1m', 'tBTCUSD', 'hist');
$data = $client->public()->getCandles('1m', 'fUSD', 'hist', 'p30');

$data = $client->public()->getConfigs('list', 'pair', 'exchange');

$data = $client->public()->getStatus('deriv', ['keys' => 'tBTCF0:USTF0']);
$data = $client->public()->getStatus('deriv/tBTCF0:USTF0/hist', ['start' => 157057800000, 'end' => 1573566992000]);

$data = $client->public()->getLiquidationFeed();

$data = $client->public()->getLeaderboards('vol', '3h', 'tBTCUSD', 'hist');