Binance
Binance-only functions
Last updated
Binance-only functions
Last updated
The names of the functions related to the Binance spot start with privateAPI.binance_
.
Get an account information, including the balance, fee rate, and etc.
None
Same as the response in the API documentation.
Get the tradable amount(free
) and locked amount(locked
) of the asset in the Binance spot account.
asset
: (string) The name of the asset to get the balance.
asset
: (string) The name of the asset.
free
: (string) The tradable amount of the asset.
locked
: (string) The amount of locked asset.
Create a new market order. In this function, the currency of the amount is a base asset. For example, If the symbol = 'BTCUSDT'
(base asset = BTC, quote asset = USDT) and amount=0.15
, then it creates an order of size 0.15 BTC.
amount
: (float) The amount of the order.
symbol
: (string) The name of the symbol to trade.
orderside
: (string) To buy, set it as 'buy'
, or 'sell'
to sell.
Same as the response in the API documentation.
Create a new market order by the amount of the order in the quote asset. In this function, the currency of the amount is a quote asset. For example, If the symbol = 'BTCUSDT'
(base asset = BTC, quote asset = USDT) and quoteqty=120
, then it creates an order of size 120 USDT.
quoteqty
: (float) The amount of the order in quote asset.
symbol
: (string) The name of the symbol to trade.
orderside
: (string) To buy, set it as 'buy'
, or 'sell'
to sell.
Same as the response in the API documentation.
Create a new limit order. In this function, the currency of the amount is a base asset.
amount
: (float) The amount of the order.
price
: (float) The price for the order to be filled.
symbol
: (string) The name of the symbol to trade.
orderside
: (string) To buy, set it as 'buy'
, or 'sell'
to sell.
Same as the response in the API documentation.
Cancel all open orders of the symbol.
symbol
: (string) The name of the symbol to cancel.
Same as the response in the API documentation.
The names of the functions related to the Binance USDⓈ-M futures start with privateAPI.binance_futures_
.
Get the balance of the assets in the Binance USD-M futures account.
None
Same as the response in the API documentation.
Get the account information of the Binance USDⓈ-M futures account.
None
Same as the response in the API documentation.
Get the open position information of the Binance USDⓈ-M futures account.
None
Same as the response in the API documentation.
Set the leverage of the symbol and create a market order.
leverage
: (int) The leverage value to set.
symbol
: (string) The name of the symbol.
side
: (string) 'BUY'
to open long & close short position, or 'SELL'
to open short & close long position.
qty
: (float) The contract size to set order. In most case, it is the amount in base asset. For instance, symbol=ETHUSDT
, and qty=0.12
will create an order of contract size 0.12 ETH.
Same as the response in the API documentation.
Set the leverage of the symbol and create a limit order.
leverage
: (int) The leverage value to set.
symbol
: (string) The name of the symbol.
side
: (string) 'BUY'
to open long & close short position, or 'SELL'
to open short & close long position.
qty
: (float) The contract size to set order. In most case, it is the amount in base asset. For instance, symbol=ETHUSDT
and qty=0.12
will create an order of contract size 0.12 ETH.
price
: (float) The price for the order to be filled.
Same as the response in the API documentation.
Cancel all open orders of the symbol.
symbol
: (string) The name of the symbol to cancel.
Same as the response in the API documentation.
The names of the functions related to the Binance COIN-M futures start with privateAPI.binance_cm_futures_
.
Get the account information in the Binance COIN-M Futures account.
None
Same as the response in the API documentation.
Get the open position information in the Binance COIN-M Futures account.
None
Same as the response in the API documentation.
Set the leverage of the symbol and create a market order.
leverage
: (int) The leverage value to set.
symbol
: (string) The name of the symbol.
side
: (string) 'BUY'
to open long & close short position, or 'SELL'
to open short & close long position.
qty
: (float) The size of the contract(=CONT) to set order. In most case, 1 CONT is a size of 10 USD, while some symbols such as BTCUSD have 1 CONT as 100 USD. For instance, symbol=ETHUSD
and qty=20
will create an order of ETHUSD with the contract size 200 USD, but symbol=BTCUSD
and qty=20
will create an order of BTCUSD with the contract size 2000 USD.
Same as the response in the API documentation.
Set the leverage of the symbol and create a limit order.
leverage
: (int) The leverage value to set.
symbol
: (string) The name of the symbol.
side
: (string) 'BUY'
to open long & close short position, or 'SELL'
to open short & close long position.
qty
: (float) The size of the contract(=CONT) to set order. In most case, 1 CONT is a size of 10 USD, while some symbols such as BTCUSD have 1 CONT as 100 USD. For instance, symbol=ETHUSD
and qty=20
will create an order of ETHUSD with the contract size 200 USD, but symbol=BTCUSD
and qty=20
will create an order of BTCUSD with the contract size 2000 USD.
price
: (float) The price for the order to be filled.
Same as the response in the API documentation.
Cancel all open orders of the symbol.
symbol
: (string) The name of the symbol to cancel.
Same as the response in the API documentation.
This function filters the elements of the balance
value in the response of the .