PHP code example of sabramooz / laravel-binance

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

    

sabramooz / laravel-binance example snippets


'providers' => [
        ...
        sabramooz\binance\BinanceServiceProvider::class,
        ...
    ],

 'aliases' => [
        ...
        'Binance' => sabramooz\binance\BinanceAPIFacade::class,
    ],

    $binance = new \sabramooz\binance\BinanceAPI();
    dump($binance->getAvgPrice("BTCUSDT"));
    dump($binance->getAvgPrice("ETHUSDT"));
text
    array:2 [▼
      "mins" => 5
      "price" => "37009.43501853"
    ]
    array:2 [▼
      "mins" => 5
      "price" => "1407.75224237"
    ]