1. Go to this page and download the library: Download mrabdelaziz/binance-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/ */
mrabdelaziz / binance-api example snippets
use MrAbdelaziz\BinanceApi\Facades\BinanceApi;
// Get account information
$account = BinanceApi::account()->getAccountInfo();
// Get account balances
$balances = BinanceApi::account()->getAccountBalances();
// Get account trading status
$status = BinanceApi::account()->getAccountStatus();
// Place a market buy order
$order = BinanceApi::orders()->marketBuy('BTCUSDT', 0.001);
// Place a limit sell order
$order = BinanceApi::orders()->limitSell('BTCUSDT', 0.001, 50000);
// Cancel an order
$cancelled = BinanceApi::orders()->cancelOrder('BTCUSDT', $orderId);
// Get order status
$orderStatus = BinanceApi::orders()->getOrder('BTCUSDT', $orderId);
// Get all orders for a symbol
$orders = BinanceApi::orders()->getAllOrders('BTCUSDT');
// Get current price
$price = BinanceApi::market()->getPrice('BTCUSDT');
// Get 24hr ticker
$ticker = BinanceApi::market()->get24hrTicker('BTCUSDT');
// Get exchange info
$exchangeInfo = BinanceApi::market()->getExchangeInfo();
// Get open positions
$positions = BinanceApi::positions()->getOpenPositions();
// Get position for specific symbol
$position = BinanceApi::positions()->getPosition('BTCUSDT');
// Get position history
$history = BinanceApi::positions()->getPositionHistory('BTCUSDT');