sabramooz/laravel-binance

Implementation of Binance trading API for Laravel

v1.1 2021-01-19 13:21 UTC

This package is auto-updated.

Last update: 2024-04-25 12:36:51 UTC


README

Laravel implementation of the Binance crypto exchange trading API

Scrutinizer coverage

https://scrutinizer-ci.com/g/sabramooz/laravel-binance/

Install

composer require sabramooz/laravel-binance

Utilises autoloading in Laravel 5.5+. For older versions add the following lines to your config/app.php

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

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

Usage

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

Binance API Doc

https://binance-docs.github.io/apidocs/spot/en/#market-data-endpoints

🙋 Contributing

If you find an issue or have a better way to do something, feel free to open an issue, or a pull request. If you use laravel-binance in your open source project, create a pull request to provide its URL as a sample application in the README.md file.

❗ Security

If you discover any security-related issues, please email pooya.alen1990@gmail.com instead of using the issue tracker.