Skip to content

binance

github-actions[bot] edited this page Jun 11, 2026 · 4 revisions

binance{docsify-ignore}

Kind: global class
Extends: Exchange

enableDemoTrading{docsify-ignore}

enables or disables demo trading mode

Kind: instance method of binance

See

Param Type Required Description
enable boolean No true if demo trading should be enabled, false otherwise
binance.enableDemoTrading (enable?)

fetchTime{docsify-ignore}

fetches the current integer timestamp in milliseconds from the exchange server

Kind: instance method of binance
Returns: int - the current integer timestamp in milliseconds from the exchange server

See

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchTime (params?)

fetchCurrencies{docsify-ignore}

fetches all available currencies on an exchange

Kind: instance method of binance
Returns: object - an associative dictionary of currencies

See

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
binance.fetchCurrencies (params?)

fetchMarkets{docsify-ignore}

retrieves data on all markets for binance

Kind: instance method of binance
Returns: Array<object> - an array of objects representing market data

See

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
binance.fetchMarkets (params?)

fetchBalance{docsify-ignore}

query for balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of binance
Returns: object - a balance structure

See

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
params.type string No 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
params.marginMode string No 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
params.symbols Array<string>, undefined No unified market symbols, only used in isolated margin mode
params.portfolioMargin boolean No set to true if you would like to fetch the balance for a portfolio margin account
params.subType string No 'linear' or 'inverse'
binance.fetchBalance (params?)

fetchOrderBook{docsify-ignore}

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of binance
Returns: object - A dictionary of order book structures indexed by market symbols

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the order book for
limit int No the maximum amount of order book entries to return
params object No extra parameters specific to the exchange API endpoint
params.rpi boolean No future only set to true to use the RPI endpoint
binance.fetchOrderBook (symbol, limit?, params?)

fetchStatus{docsify-ignore}

the latest known information on the availability of the exchange API

Kind: instance method of binance
Returns: object - a status structure

See: https://developers.binance.com/docs/wallet/others/system-status

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
binance.fetchStatus (params?)

fetchTicker{docsify-ignore}

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of binance
Returns: object - a ticker structure

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
params.rolling boolean No (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker
binance.fetchTicker (symbol, params?)

fetchBidsAsks{docsify-ignore}

fetches the bid and ask price and volume for multiple markets

Kind: instance method of binance
Returns: object - a dictionary of ticker structures

See

Param Type Required Description
symbols Array<string>, undefined Yes unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchBidsAsks (symbols, params?)

fetchLastPrices{docsify-ignore}

fetches the last price for multiple markets

Kind: instance method of binance
Returns: object - a dictionary of lastprices structures

See

Param Type Required Description
symbols Array<string>, undefined Yes unified symbols of the markets to fetch the last prices
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchLastPrices (symbols, params?)

fetchTickers{docsify-ignore}

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

Kind: instance method of binance
Returns: object - a dictionary of ticker structures

See

Param Type Required Description
symbols Array<string> No unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
params.type string No 'spot', 'option', use params["subType"] for swap and future markets
binance.fetchTickers (symbols?, params?)

fetchMarkPrice{docsify-ignore}

fetches mark price for the market

Kind: instance method of binance
Returns: object - a dictionary of ticker structures

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchMarkPrice (symbol, params?)

fetchMarkPrices{docsify-ignore}

fetches mark prices for multiple markets

Kind: instance method of binance
Returns: object - a dictionary of ticker structures

See

Param Type Required Description
symbols Array<string> No unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchMarkPrices (symbols?, params?)

fetchOHLCV{docsify-ignore}

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of binance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch OHLCV data for
timeframe string Yes the length of time each candle represents
since int No timestamp in ms of the earliest candle to fetch
limit int No the maximum amount of candles to fetch
params object No extra parameters specific to the exchange API endpoint
params.price string No "mark" or "index" for mark price and index price candles
params.until int No timestamp in ms of the latest candle to fetch
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
binance.fetchOHLCV (symbol, timeframe, since?, limit?, params?)

fetchTrades{docsify-ignore}

get the list of most recent trades for a particular symbol Default fetchTradesMethod

Kind: instance method of binance
Returns: Array<Trade> - a list of trade structures

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch trades for
since int No only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
limit int No default 500, max 1000
params object No extra parameters specific to the exchange API endpoint
params.until int No only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
params.fetchTradesMethod int No 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades'
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters EXCHANGE SPECIFIC PARAMETERS
params.fromId int No trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
binance.fetchTrades (symbol, since?, limit?, params?)

editContractOrder{docsify-ignore}

edit a trade order

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
id string Yes cancel order id
symbol string Yes unified symbol of the market to create an order in
type string Yes 'market' or 'limit'
side string Yes 'buy' or 'sell'
amount float Yes how much of currency you want to trade in units of base currency
price float No the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to edit an order in a portfolio margin account
binance.editContractOrder (id, symbol, type, side, amount, price?, params?)

editOrder{docsify-ignore}

edit a trade order

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
id string Yes cancel order id
symbol string Yes unified symbol of the market to create an order in
type string Yes 'market' or 'limit'
side string Yes 'buy' or 'sell'
amount float Yes how much of currency you want to trade in units of base currency
price float No the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params object No extra parameters specific to the exchange API endpoint
binance.editOrder (id, symbol, type, side, amount, price?, params?)

editOrders{docsify-ignore}

edit a list of trade orders

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
orders Array Yes list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
params object No extra parameters specific to the exchange API endpoint
binance.editOrders (orders, params?)

createOrders{docsify-ignore}

contract only create a list of trade orders

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
orders Array Yes list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
params object No extra parameters specific to the exchange API endpoint
binance.createOrders (orders, params?)

createOrder{docsify-ignore}

create a trade order

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
symbol string Yes unified symbol of the market to create an order in
type string Yes 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
side string Yes 'buy' or 'sell'
amount float Yes how much of you want to trade in units of the base currency
price float No the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
params object No extra parameters specific to the exchange API endpoint
params.reduceOnly string No for swap and future reduceOnly is a string 'true' or 'false' that cant be sent with close position set to true or in hedge mode. For spot margin and option reduceOnly is a boolean.
params.marginMode string No 'cross' or 'isolated', for spot margin trading
params.sor boolean No spot only whether to use SOR (Smart Order Routing) or not, default is false
params.test boolean No spot only whether to use the test endpoint or not, default is false
params.trailingPercent float No the percent to trail away from the current market price
params.trailingTriggerPrice float No the price to trigger a trailing order, default uses the price argument
params.triggerPrice float No the price that a trigger order is triggered at
params.stopLossPrice float No the price that a stop loss order is triggered at
params.takeProfitPrice float No the price that a take profit order is triggered at
params.portfolioMargin boolean No set to true if you would like to create an order in a portfolio margin account
params.selfTradePrevention string No set unified value for stp, one of NONE, EXPIRE_MAKER, EXPIRE_TAKER or EXPIRE_BOTH
params.icebergAmount float No set iceberg amount for limit orders
params.stopLossOrTakeProfit string No 'stopLoss' or 'takeProfit', required for spot trailing orders
params.positionSide string No swap and portfolio margin only "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
params.hedged bool No swap and portfolio margin only true for hedged mode, false for one way mode, default is false
params.clientOrderId string No the clientOrderId of the order
binance.createOrder (symbol, type, side, amount, price?, params?)

createMarketOrderWithCost{docsify-ignore}

create a market order by providing the symbol, side and cost

Kind: instance method of binance
Returns: object - an order structure

See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade

Param Type Required Description
symbol string Yes unified symbol of the market to create an order in
side string Yes 'buy' or 'sell'
cost float Yes how much you want to trade in units of the quote currency
params object No extra parameters specific to the exchange API endpoint
binance.createMarketOrderWithCost (symbol, side, cost, params?)

createMarketBuyOrderWithCost{docsify-ignore}

create a market buy order by providing the symbol and cost

Kind: instance method of binance
Returns: object - an order structure

See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade

Param Type Required Description
symbol string Yes unified symbol of the market to create an order in
cost float Yes how much you want to trade in units of the quote currency
params object No extra parameters specific to the exchange API endpoint
binance.createMarketBuyOrderWithCost (symbol, cost, params?)

createMarketSellOrderWithCost{docsify-ignore}

create a market sell order by providing the symbol and cost

Kind: instance method of binance
Returns: object - an order structure

See: https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade

Param Type Required Description
symbol string Yes unified symbol of the market to create an order in
cost float Yes how much you want to trade in units of the quote currency
params object No extra parameters specific to the exchange API endpoint
binance.createMarketSellOrderWithCost (symbol, cost, params?)

fetchOrder{docsify-ignore}

fetches information on an order made by the user

Kind: instance method of binance
Returns: object - An order structure

See

Param Type Required Description
id string Yes the order id
symbol string Yes unified symbol of the market the order was made in
params object No extra parameters specific to the exchange API endpoint
params.marginMode string No 'cross' or 'isolated', for spot margin trading
params.portfolioMargin boolean No set to true if you would like to fetch an order in a portfolio margin account
params.trigger boolean No set to true if you would like to fetch a trigger or conditional order
binance.fetchOrder (id, symbol, params?)

fetchOrders{docsify-ignore}

fetches information on multiple orders made by the user

Kind: instance method of binance
Returns: Array<Order> - a list of order structures

See

Param Type Required Description
symbol string Yes unified market symbol of the market orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.marginMode string No 'cross' or 'isolated', for spot margin trading
params.until int No the latest time in ms to fetch orders for
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.portfolioMargin boolean No set to true if you would like to fetch orders in a portfolio margin account
params.trigger boolean No set to true if you would like to fetch portfolio margin account trigger or conditional orders
binance.fetchOrders (symbol, since?, limit?, params?)

fetchOpenOrders{docsify-ignore}

fetch all unfilled currently open orders

Kind: instance method of binance
Returns: Array<Order> - a list of order structures

See

Param Type Required Description
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch open orders for
limit int No the maximum number of open orders structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.marginMode string No 'cross' or 'isolated', for spot margin trading
params.portfolioMargin boolean No set to true if you would like to fetch open orders in the portfolio margin account
params.trigger boolean No set to true if you would like to fetch portfolio margin account conditional orders
params.subType string No "linear" or "inverse"
binance.fetchOpenOrders (symbol, since?, limit?, params?)

fetchOpenOrder{docsify-ignore}

fetch an open order by the id

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
id string Yes order id
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
params.trigger string No set to true if you would like to fetch portfolio margin account stop or conditional orders
params.portfolioMargin boolean No set to true if you would like to fetch for a portfolio margin account
binance.fetchOpenOrder (id, symbol, params?)

fetchClosedOrders{docsify-ignore}

fetches information on multiple closed orders made by the user

Kind: instance method of binance
Returns: Array<Order> - a list of order structures

See

Param Type Required Description
symbol string Yes unified market symbol of the market orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.portfolioMargin boolean No set to true if you would like to fetch orders in a portfolio margin account
params.trigger boolean No set to true if you would like to fetch portfolio margin account trigger or conditional orders
binance.fetchClosedOrders (symbol, since?, limit?, params?)

fetchCanceledOrders{docsify-ignore}

fetches information on multiple canceled orders made by the user

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See

Param Type Required Description
symbol string Yes unified market symbol of the market the orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.portfolioMargin boolean No set to true if you would like to fetch orders in a portfolio margin account
params.trigger boolean No set to true if you would like to fetch portfolio margin account trigger or conditional orders
binance.fetchCanceledOrders (symbol, since?, limit?, params?)

fetchCanceledAndClosedOrders{docsify-ignore}

fetches information on multiple canceled orders made by the user

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See

Param Type Required Description
symbol string Yes unified market symbol of the market the orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.portfolioMargin boolean No set to true if you would like to fetch orders in a portfolio margin account
params.trigger boolean No set to true if you would like to fetch portfolio margin account trigger or conditional orders
binance.fetchCanceledAndClosedOrders (symbol, since?, limit?, params?)

cancelOrder{docsify-ignore}

cancels an open order

Kind: instance method of binance
Returns: object - An order structure

See

Param Type Required Description
id string Yes order id
symbol string Yes unified symbol of the market the order was made in
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to cancel an order in a portfolio margin account
params.trigger boolean No set to true if you would like to cancel a portfolio margin account conditional order
binance.cancelOrder (id, symbol, params?)

cancelAllOrders{docsify-ignore}

cancel all open orders in a market

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See

Param Type Required Description
symbol string Yes unified market symbol of the market to cancel orders in
params object No extra parameters specific to the exchange API endpoint
params.marginMode string No 'cross' or 'isolated', for spot margin trading
params.portfolioMargin boolean No set to true if you would like to cancel orders in a portfolio margin account
params.trigger boolean No set to true if you would like to cancel portfolio margin account conditional orders
binance.cancelAllOrders (symbol, params?)

cancelOrders{docsify-ignore}

cancel multiple orders

Kind: instance method of binance
Returns: object - an list of order structures

See

Param Type Required Description
ids Array<string> Yes order ids
symbol string No unified market symbol
params object No extra parameters specific to the exchange API endpoint
params.clientOrderIds Array<string> No alternative to ids, array of client order ids EXCHANGE SPECIFIC PARAMETERS
params.origClientOrderIdList Array<string> No max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
params.recvWindow Array<int> No
binance.cancelOrders (ids, symbol?, params?)

fetchOrderTrades{docsify-ignore}

fetch all the trades made from a single order

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See

Param Type Required Description
id string Yes order id
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch trades for
limit int No the maximum number of trades to retrieve
params object No extra parameters specific to the exchange API endpoint
binance.fetchOrderTrades (id, symbol, since?, limit?, params?)

fetchMyTrades{docsify-ignore}

fetch all trades made by the user

Kind: instance method of binance
Returns: Array<Trade> - a list of trade structures

See

Param Type Required Description
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch trades for
limit int No the maximum number of trades structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.until int No the latest time in ms to fetch entries for
params.portfolioMargin boolean No set to true if you would like to fetch trades for a portfolio margin account
binance.fetchMyTrades (symbol, since?, limit?, params?)

fetchMyDustTrades{docsify-ignore}

fetch all dust trades made by the user

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See: https://developers.binance.com/docs/wallet/asset/dust-log

Param Type Required Description
symbol string Yes not used by binance fetchMyDustTrades ()
since int No the earliest time in ms to fetch my dust trades for
limit int No the maximum number of dust trades to retrieve
params object No extra parameters specific to the exchange API endpoint
params.type string No 'spot' or 'margin', default spot
binance.fetchMyDustTrades (symbol, since?, limit?, params?)

fetchDeposits{docsify-ignore}

fetch all deposits made to an account

Kind: instance method of binance
Returns: Array<object> - a list of transaction structures

See

Param Type Required Description
code string Yes unified currency code
since int No the earliest time in ms to fetch deposits for
limit int No the maximum number of deposits structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.fiat bool No if true, only fiat deposits will be returned
params.until int No the latest time in ms to fetch entries for
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
binance.fetchDeposits (code, since?, limit?, params?)

fetchWithdrawals{docsify-ignore}

fetch all withdrawals made from an account

Kind: instance method of binance
Returns: Array<object> - a list of transaction structures

See

Param Type Required Description
code string Yes unified currency code
since int No the earliest time in ms to fetch withdrawals for
limit int No the maximum number of withdrawals structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.fiat bool No if true, only fiat withdrawals will be returned
params.until int No the latest time in ms to fetch withdrawals for
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
binance.fetchWithdrawals (code, since?, limit?, params?)

transfer{docsify-ignore}

transfer currency internally between wallets on the same account

Kind: instance method of binance
Returns: object - a transfer structure

See: https://developers.binance.com/docs/wallet/asset/user-universal-transfer

Param Type Required Description
code string Yes unified currency code
amount float Yes amount to transfer
fromAccount string Yes account to transfer from
toAccount string Yes account to transfer to
params object No extra parameters specific to the exchange API endpoint
params.type string No exchange specific transfer type
params.symbol string No the unified symbol, required for isolated margin transfers
binance.transfer (code, amount, fromAccount, toAccount, params?)

fetchTransfers{docsify-ignore}

fetch a history of internal transfers made on an account

Kind: instance method of binance
Returns: Array<object> - a list of transfer structures

See: https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer

Param Type Required Description
code string Yes unified currency code of the currency transferred
since int No the earliest time in ms to fetch transfers for
limit int No the maximum number of transfers structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.until int No the latest time in ms to fetch transfers for
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.internal boolean No default false, when true will fetch pay trade history
binance.fetchTransfers (code, since?, limit?, params?)

fetchDepositAddress{docsify-ignore}

fetch the deposit address for a currency associated with this account

Kind: instance method of binance
Returns: object - an address structure

See: https://developers.binance.com/docs/wallet/capital/deposite-address

Param Type Required Description
code string Yes unified currency code
params object No extra parameters specific to the exchange API endpoint
params.network string No network for fetch deposit address
binance.fetchDepositAddress (code, params?)

fetchTransactionFees{docsify-ignore}

DEPRECATED

please use fetchDepositWithdrawFees instead

Kind: instance method of binance
Returns: Array<object> - a list of fee structures

See: https://developers.binance.com/docs/wallet/capital/all-coins-info

Param Type Required Description
codes Array<string>, undefined Yes not used by binance fetchTransactionFees ()
params object No extra parameters specific to the exchange API endpoint
binance.fetchTransactionFees (codes, params?)

fetchDepositWithdrawFees{docsify-ignore}

fetch deposit and withdraw fees

Kind: instance method of binance
Returns: Array<object> - a list of fee structures

See: https://developers.binance.com/docs/wallet/capital/all-coins-info

Param Type Required Description
codes Array<string>, undefined Yes not used by binance fetchDepositWithdrawFees ()
params object No extra parameters specific to the exchange API endpoint
binance.fetchDepositWithdrawFees (codes, params?)

withdraw{docsify-ignore}

make a withdrawal

Kind: instance method of binance
Returns: object - a transaction structure

See: https://developers.binance.com/docs/wallet/capital/withdraw

Param Type Required Description
code string Yes unified currency code
amount float Yes the amount to withdraw
address string Yes the address to withdraw to
tag string Yes
params object No extra parameters specific to the exchange API endpoint
binance.withdraw (code, amount, address, tag, params?)

fetchTradingFee{docsify-ignore}

fetch the trading fees for a market

Kind: instance method of binance
Returns: object - a fee structure

See

Param Type Required Description
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to fetch trading fees in a portfolio margin account
params.subType string No "linear" or "inverse"
binance.fetchTradingFee (symbol, params?)

fetchTradingFees{docsify-ignore}

fetch the trading fees for multiple markets

Kind: instance method of binance
Returns: object - a dictionary of fee structures indexed by market symbols

See

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchTradingFees (params?)

fetchFundingRate{docsify-ignore}

fetch the current funding rate

Kind: instance method of binance
Returns: object - a funding rate structure

See

Param Type Required Description
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
binance.fetchFundingRate (symbol, params?)

fetchFundingRateHistory{docsify-ignore}

fetches historical funding rate prices

Kind: instance method of binance
Returns: Array<object> - a list of funding rate structures

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the funding rate history for
since int No timestamp in ms of the earliest funding rate to fetch
limit int No the maximum amount of funding rate structures to fetch
params object No extra parameters specific to the exchange API endpoint
params.until int No timestamp in ms of the latest funding rate
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.subType string No "linear" or "inverse"
binance.fetchFundingRateHistory (symbol, since?, limit?, params?)

fetchFundingRates{docsify-ignore}

fetch the funding rate for multiple markets

Kind: instance method of binance
Returns: Array<object> - a list of funding rate structures, indexed by market symbols

See

Param Type Required Description
symbols Array<string>, undefined Yes list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchFundingRates (symbols, params?)

fetchLeverageTiers{docsify-ignore}

retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes

Kind: instance method of binance
Returns: object - a dictionary of leverage tiers structures, indexed by market symbols

See

Param Type Required Description
symbols Array<string>, undefined Yes list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to fetch the leverage tiers for a portfolio margin account
params.subType string No "linear" or "inverse"
binance.fetchLeverageTiers (symbols, params?)

fetchPosition{docsify-ignore}

fetch data on an open position

Kind: instance method of binance
Returns: object - a position structure

See: https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information

Param Type Required Description
symbol string Yes unified market symbol of the market the position is held in
params object No extra parameters specific to the exchange API endpoint
binance.fetchPosition (symbol, params?)

fetchOptionPositions{docsify-ignore}

fetch data on open options positions

Kind: instance method of binance
Returns: Array<object> - a list of position structures

See: https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information

Param Type Required Description
symbols Array<string>, undefined Yes list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
binance.fetchOptionPositions (symbols, params?)

fetchPositions{docsify-ignore}

fetch all open positions

Kind: instance method of binance
Returns: Array<object> - a list of position structure

See

Param Type Required Description
symbols Array<string> No list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.params object No extra parameters specific to the exchange API endpoint
params.method string No method name to call, "positionRisk", "account" or "option", default is "positionRisk"
params.useV2 bool No set to true if you want to use the obsolete endpoint, where some more additional fields were provided
binance.fetchPositions (symbols?, params?)

fetchFundingHistory{docsify-ignore}

fetch the history of funding payments paid and received on this account

Kind: instance method of binance
Returns: object - a funding history structure

See

Param Type Required Description
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch funding history for
limit int No the maximum number of funding history structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.until int No timestamp in ms of the latest funding history entry
params.portfolioMargin boolean No set to true if you would like to fetch the funding history for a portfolio margin account
params.subType string No "linear" or "inverse"
binance.fetchFundingHistory (symbol, since?, limit?, params?)

setLeverage{docsify-ignore}

set the level of leverage for a market

Kind: instance method of binance
Returns: object - response from the exchange

See

Param Type Required Description
leverage float Yes the rate of leverage
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to set the leverage for a trading pair in a portfolio margin account
binance.setLeverage (leverage, symbol, params?)

setMarginMode{docsify-ignore}

set margin mode to 'cross' or 'isolated'

Kind: instance method of binance
Returns: object - response from the exchange

See

Param Type Required Description
marginMode string Yes 'cross' or 'isolated'
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
binance.setMarginMode (marginMode, symbol, params?)

setPositionMode{docsify-ignore}

set hedged to true or false for a market

Kind: instance method of binance
Returns: object - response from the exchange

See

Param Type Required Description
hedged bool Yes set to true to use dualSidePosition
symbol string Yes not used by binance setPositionMode ()
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to set the position mode for a portfolio margin account
params.subType string No "linear" or "inverse"
binance.setPositionMode (hedged, symbol, params?)

fetchLeverages{docsify-ignore}

fetch the set leverage for all markets

Kind: instance method of binance
Returns: object - a list of leverage structures

See

Param Type Required Description
symbols Array<string> No a list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchLeverages (symbols?, params?)

fetchSettlementHistory{docsify-ignore}

fetches historical settlement records

Kind: instance method of binance
Returns: Array<object> - a list of settlement history objects

See: https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records

Param Type Required Description
symbol string Yes unified market symbol of the settlement history
since int No timestamp in ms
limit int No number of records, default 100, max 100
params object No exchange specific params
binance.fetchSettlementHistory (symbol, since?, limit?, params?)

fetchMySettlementHistory{docsify-ignore}

fetches historical settlement records of the user

Kind: instance method of binance
Returns: Array<object> - a list of [settlement history objects]

See: https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record

Param Type Required Description
symbol string Yes unified market symbol of the settlement history
since int No timestamp in ms
limit int No number of records
params object No exchange specific params
binance.fetchMySettlementHistory (symbol, since?, limit?, params?)

fetchLedgerEntry{docsify-ignore}

fetch the history of changes, actions done by the user or operations that altered the balance of the user

Kind: instance method of binance
Returns: object - a ledger structure

See: https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow

Param Type Required Description
id string Yes the identification number of the ledger entry
code string Yes unified currency code
params object No extra parameters specific to the exchange API endpoint
binance.fetchLedgerEntry (id, code, params?)

fetchLedger{docsify-ignore}

fetch the history of changes, actions done by the user or operations that altered the balance of the user

Kind: instance method of binance
Returns: object - a ledger structure

See

Param Type Required Description
code string No unified currency code
since int No timestamp in ms of the earliest ledger entry
limit int No max number of ledger entries to return
params object No extra parameters specific to the exchange API endpoint
params.until int No timestamp in ms of the latest ledger entry
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.portfolioMargin boolean No set to true if you would like to fetch the ledger for a portfolio margin account
params.subType string No "linear" or "inverse"
binance.fetchLedger (code?, since?, limit?, params?)

reduceMargin{docsify-ignore}

remove margin from a position

Kind: instance method of binance
Returns: object - a margin structure

See

Param Type Required Description
symbol string Yes unified market symbol
amount float Yes the amount of margin to remove
params object No extra parameters specific to the exchange API endpoint
binance.reduceMargin (symbol, amount, params?)

addMargin{docsify-ignore}

add margin

Kind: instance method of binance
Returns: object - a margin structure

See

Param Type Required Description
symbol string Yes unified market symbol
amount float Yes amount of margin to add
params object No extra parameters specific to the exchange API endpoint
binance.addMargin (symbol, amount, params?)

fetchCrossBorrowRate{docsify-ignore}

fetch the rate of interest to borrow a currency for margin trading

Kind: instance method of binance
Returns: object - a borrow rate structure

See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History

Param Type Required Description
code string Yes unified currency code
params object No extra parameters specific to the exchange API endpoint
binance.fetchCrossBorrowRate (code, params?)

fetchIsolatedBorrowRate{docsify-ignore}

fetch the rate of interest to borrow a currency for margin trading

Kind: instance method of binance
Returns: object - an isolated borrow rate structure

See: https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data

Param Type Required Description
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS
params.vipLevel object No user's current specific margin data will be returned if viplevel is omitted
binance.fetchIsolatedBorrowRate (symbol, params?)

fetchIsolatedBorrowRates{docsify-ignore}

fetch the borrow interest rates of all currencies

Kind: instance method of binance
Returns: object - a borrow rate structure

See: https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
params.symbol object No unified market symbol EXCHANGE SPECIFIC PARAMETERS
params.vipLevel object No user's current specific margin data will be returned if viplevel is omitted
binance.fetchIsolatedBorrowRates (params?)

fetchBorrowRateHistory{docsify-ignore}

retrieves a history of a currencies borrow interest rate at specific time slots

Kind: instance method of binance
Returns: Array<object> - an array of borrow rate structures

See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History

Param Type Required Description
code string Yes unified currency code
since int No timestamp for the earliest borrow rate
limit int No the maximum number of borrow rate structures to retrieve
params object No extra parameters specific to the exchange API endpoint
binance.fetchBorrowRateHistory (code, since?, limit?, params?)

createGiftCode{docsify-ignore}

create gift code

Kind: instance method of binance
Returns: object - The gift code id, code, currency and amount

See: https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card

Param Type Required Description
code string Yes gift code
amount float Yes amount of currency for the gift
params object No extra parameters specific to the exchange API endpoint
binance.createGiftCode (code, amount, params?)

redeemGiftCode{docsify-ignore}

redeem gift code

Kind: instance method of binance
Returns: object - response from the exchange

See: https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card

Param Type Required Description
giftcardCode string Yes
params object No extra parameters specific to the exchange API endpoint
binance.redeemGiftCode (giftcardCode, params?)

verifyGiftCode{docsify-ignore}

verify gift code

Kind: instance method of binance
Returns: object - response from the exchange

See: https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number

Param Type Required Description
id string Yes reference number id
params object No extra parameters specific to the exchange API endpoint
binance.verifyGiftCode (id, params?)

fetchBorrowInterest{docsify-ignore}

fetch the interest owed by the user for borrowing currency for margin trading

Kind: instance method of binance
Returns: Array<object> - a list of borrow interest structures

See

Param Type Required Description
code string No unified currency code
symbol string No unified market symbol when fetch interest in isolated markets
since int No the earliest time in ms to fetch borrrow interest for
limit int No the maximum number of structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to fetch the borrow interest in a portfolio margin account
binance.fetchBorrowInterest (code?, symbol?, since?, limit?, params?)

repayCrossMargin{docsify-ignore}

repay borrowed margin and interest

Kind: instance method of binance
Returns: object - a margin loan structure

See

Param Type Required Description
code string Yes unified currency code of the currency to repay
amount float Yes the amount to repay
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to repay margin in a portfolio margin account
params.repayCrossMarginMethod string No portfolio margin only 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative)
params.specifyRepayAssets string No portfolio margin papiPostMarginRepayDebt only specific asset list to repay debt
binance.repayCrossMargin (code, amount, params?)

repayIsolatedMargin{docsify-ignore}

repay borrowed margin and interest

Kind: instance method of binance
Returns: object - a margin loan structure

See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay

Param Type Required Description
symbol string Yes unified market symbol, required for isolated margin
code string Yes unified currency code of the currency to repay
amount float Yes the amount to repay
params object No extra parameters specific to the exchange API endpoint
binance.repayIsolatedMargin (symbol, code, amount, params?)

borrowCrossMargin{docsify-ignore}

create a loan to borrow margin

Kind: instance method of binance
Returns: object - a margin loan structure

See

Param Type Required Description
code string Yes unified currency code of the currency to borrow
amount float Yes the amount to borrow
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to borrow margin in a portfolio margin account
binance.borrowCrossMargin (code, amount, params?)

borrowIsolatedMargin{docsify-ignore}

create a loan to borrow margin

Kind: instance method of binance
Returns: object - a margin loan structure

See: https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay

Param Type Required Description
symbol string Yes unified market symbol, required for isolated margin
code string Yes unified currency code of the currency to borrow
amount float Yes the amount to borrow
params object No extra parameters specific to the exchange API endpoint
binance.borrowIsolatedMargin (symbol, code, amount, params?)

fetchOpenInterestHistory{docsify-ignore}

Retrieves the open interest history of a currency

Kind: instance method of binance
Returns: object - an array of open interest structure

See

Param Type Required Description
symbol string Yes Unified CCXT market symbol
timeframe string Yes "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
since int No the time(ms) of the earliest record to retrieve as a unix timestamp
limit int No default 30, max 500
params object No exchange specific parameters
params.until int No the time(ms) of the latest record to retrieve as a unix timestamp
params.paginate boolean No default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the availble parameters
binance.fetchOpenInterestHistory (symbol, timeframe, since?, limit?, params?)

fetchOpenInterest{docsify-ignore}

retrieves the open interest of a contract trading pair

Kind: instance method of binance
Returns: object - an open interest structurehttps://docs.ccxt.com/?id=open-interest-structure

See

Param Type Required Description
symbol string Yes unified CCXT market symbol
params object No exchange specific parameters
binance.fetchOpenInterest (symbol, params?)

fetchMyLiquidations{docsify-ignore}

retrieves the users liquidated positions

Kind: instance method of binance
Returns: object - an array of liquidation structures

See

Param Type Required Description
symbol string No unified CCXT market symbol
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the binance api endpoint
params.until int No timestamp in ms of the latest liquidation
params.paginate boolean No spot only default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the available parameters
params.portfolioMargin boolean No set to true if you would like to fetch liquidations in a portfolio margin account
params.type string No "spot"
params.subType string No "linear" or "inverse"
binance.fetchMyLiquidations (symbol?, since?, limit?, params?)

fetchGreeks{docsify-ignore}

fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract

Kind: instance method of binance
Returns: object - a greeks structure

See: https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price

Param Type Required Description
symbol string Yes unified symbol of the market to fetch greeks for
params object No extra parameters specific to the exchange API endpoint
binance.fetchGreeks (symbol, params?)

fetchAllGreeks{docsify-ignore}

fetches all option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract

Kind: instance method of binance
Returns: object - a greeks structure

See: https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price

Param Type Required Description
symbols Array<string> No unified symbols of the markets to fetch greeks for, all markets are returned if not assigned
params object No extra parameters specific to the exchange API endpoint
binance.fetchAllGreeks (symbols?, params?)

fetchPositionMode{docsify-ignore}

fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets

Kind: instance method of binance
Returns: object - an object detailing whether the market is in hedged or one-way mode

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the order book for
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchPositionMode (symbol, params?)

fetchMarginModes{docsify-ignore}

fetches margin modes ("isolated" or "cross") that the market for the symbol in in, with symbol=undefined all markets for a subType (linear/inverse) are returned

Kind: instance method of binance
Returns: object - a list of margin mode structures

See

Param Type Required Description
symbols Array<string> Yes unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchMarginModes (symbols, params?)

fetchMarginMode{docsify-ignore}

fetches the margin mode of a specific symbol

Kind: instance method of binance
Returns: object - a margin mode structure

See

Param Type Required Description
symbol string Yes unified symbol of the market the order was made in
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchMarginMode (symbol, params?)

fetchOption{docsify-ignore}

fetches option data that is commonly found in an option chain

Kind: instance method of binance
Returns: object - an option chain structure

See: https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics

Param Type Required Description
symbol string Yes unified market symbol
params object No extra parameters specific to the exchange API endpoint
binance.fetchOption (symbol, params?)

fetchMarginAdjustmentHistory{docsify-ignore}

fetches the history of margin added or reduced from contract isolated positions

Kind: instance method of binance
Returns: Array<object> - a list of margin structures

See

Param Type Required Description
symbol string Yes unified market symbol
type string No "add" or "reduce"
since int No timestamp in ms of the earliest change to fetch
limit int No the maximum amount of changes to fetch
params object Yes extra parameters specific to the exchange api endpoint
params.until int No timestamp in ms of the latest change to fetch
binance.fetchMarginAdjustmentHistory (symbol, type?, since?, limit?, params)

fetchConvertCurrencies{docsify-ignore}

fetches all available currencies that can be converted

Kind: instance method of binance
Returns: object - an associative dictionary of currencies

See: https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
binance.fetchConvertCurrencies (params?)

fetchConvertQuote{docsify-ignore}

fetch a quote for converting from one currency to another

Kind: instance method of binance
Returns: object - a conversion structure

See: https://developers.binance.com/docs/convert/trade/Send-quote-request

Param Type Required Description
fromCode string Yes the currency that you want to sell and convert from
toCode string Yes the currency that you want to buy and convert into
amount float Yes how much you want to trade in units of the from currency
params object No extra parameters specific to the exchange API endpoint
params.walletType string No either 'SPOT' or 'FUNDING', the default is 'SPOT'
binance.fetchConvertQuote (fromCode, toCode, amount, params?)

createConvertTrade{docsify-ignore}

convert from one currency to another

Kind: instance method of binance
Returns: object - a conversion structure

See: https://developers.binance.com/docs/convert/trade/Accept-Quote

Param Type Required Description
id string Yes the id of the trade that you want to make
fromCode string Yes the currency that you want to sell and convert from
toCode string Yes the currency that you want to buy and convert into
amount float No how much you want to trade in units of the from currency
params object No extra parameters specific to the exchange API endpoint
binance.createConvertTrade (id, fromCode, toCode, amount?, params?)

fetchConvertTrade{docsify-ignore}

fetch the data for a conversion trade

Kind: instance method of binance
Returns: object - a conversion structure

See: https://developers.binance.com/docs/convert/trade/Order-Status

Param Type Required Description
id string Yes the id of the trade that you want to fetch
code string No the unified currency code of the conversion trade
params object No extra parameters specific to the exchange API endpoint
binance.fetchConvertTrade (id, code?, params?)

fetchConvertTradeHistory{docsify-ignore}

fetch the users history of conversion trades

Kind: instance method of binance
Returns: Array<object> - a list of conversion structures

See: https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History

Param Type Required Description
code string No the unified currency code
since int No the earliest time in ms to fetch conversions for
limit int No the maximum number of conversion structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.until int No timestamp in ms of the latest conversion to fetch
binance.fetchConvertTradeHistory (code?, since?, limit?, params?)

fetchFundingIntervals{docsify-ignore}

fetch the funding rate interval for multiple markets

Kind: instance method of binance
Returns: Array<object> - a list of funding rate structures

See

Param Type Required Description
symbols Array<string> No list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.subType string No "linear" or "inverse"
binance.fetchFundingIntervals (symbols?, params?)

fetchLongShortRatioHistory{docsify-ignore}

fetches the long short ratio history for a unified market symbol

Kind: instance method of binance
Returns: Array<object> - an array of long short ratio structures

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the long short ratio for
timeframe string No the period for the ratio, default is 24 hours
since int No the earliest time in ms to fetch ratios for
limit int No the maximum number of long short ratio structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.until int No timestamp in ms of the latest ratio to fetch
binance.fetchLongShortRatioHistory (symbol, timeframe?, since?, limit?, params?)

fetchADLRank{docsify-ignore}

fetches the auto deleveraging rank and risk percentage for a symbol

Kind: instance method of binance
Returns: object - an auto de leverage structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/ADL-Risk

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the auto deleveraging rank for
params object No extra parameters specific to the exchange API endpoint
binance.fetchADLRank (symbol, params?)

fetchPositionsADLRank{docsify-ignore}

fetches the auto deleveraging rank and risk percentage for a list of symbols that have open positions

Kind: instance method of binance
Returns: Array<object> - an array of auto de leverage structure

See

Param Type Required Description
symbols Array<string> No list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true for the portfolio margin account
binance.fetchPositionsADLRank (symbols?, params?)

ensureUserDataStreamWsSubscribeSignature{docsify-ignore}

watches best bid & ask for symbols

Kind: instance property of binance
Returns: Promise The subscription ID for the user data stream

See: Binance User Data Stream Documentation

Param Type Required Description
marketType string No only supports 'spot'
binance.ensureUserDataStreamWsSubscribeSignature (marketType?)

ensureUserDataStreamWsSubscribeListenToken{docsify-ignore}

subscribes to user data stream using listenToken (for margin)

Kind: instance property of binance
Returns: Promise

See: Binance User Data Stream Documentation

Param Type Required Description
marketType string Yes the market type (e.g., 'margin')
params object Yes extra parameters specific to the request
params.symbol string No required for isolated margin
params.isIsolated boolean No whether it is isolated margin
params.validity number No validity in milliseconds, default 24 hours, max 24 hours
binance.ensureUserDataStreamWsSubscribeListenToken (marketType, params)

watchLiquidations{docsify-ignore}

watch the public liquidations of a trading pair

Kind: instance method of binance
Returns: object - an array of liquidation structures

See

Param Type Required Description
symbol string Yes unified CCXT market symbol
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the bitmex api endpoint
binance.watchLiquidations (symbol, since?, limit?, params?)

watchLiquidationsForSymbols{docsify-ignore}

watch the public liquidations of a trading pair

Kind: instance method of binance
Returns: object - an array of liquidation structures

See

Param Type Required Description
symbols Array<string> Yes list of unified market symbols
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the bitmex api endpoint
binance.watchLiquidationsForSymbols (symbols, since?, limit?, params?)

watchMyLiquidations{docsify-ignore}

watch the private liquidations of a trading pair

Kind: instance method of binance
Returns: object - an array of liquidation structures

See

Param Type Required Description
symbol string Yes unified CCXT market symbol
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the bitmex api endpoint
binance.watchMyLiquidations (symbol, since?, limit?, params?)

watchMyLiquidationsForSymbols{docsify-ignore}

watch the private liquidations of a trading pair

Kind: instance method of binance
Returns: object - an array of liquidation structures

See

Param Type Required Description
symbols Array<string> Yes list of unified market symbols
since int No the earliest time in ms to fetch liquidations for
limit int No the maximum number of liquidation structures to retrieve
params object No exchange specific parameters for the bitmex api endpoint
binance.watchMyLiquidationsForSymbols (symbols, since?, limit?, params?)

watchOrderBook{docsify-ignore}

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of binance
Returns: object - A dictionary of order book structures indexed by market symbols

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the order book for
limit int No the maximum amount of order book entries to return
params object No extra parameters specific to the exchange API endpoint
binance.watchOrderBook (symbol, limit?, params?)

watchOrderBookForSymbols{docsify-ignore}

watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of binance
Returns: object - A dictionary of order book structures indexed by market symbols

See

Param Type Required Description
symbols Array<string> Yes unified array of symbols
limit int No the maximum amount of order book entries to return
params object No extra parameters specific to the exchange API endpoint
params.rpi boolean No future only set to true to use the RPI endpoint
binance.watchOrderBookForSymbols (symbols, limit?, params?)

unWatchOrderBookForSymbols{docsify-ignore}

unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of binance
Returns: object - A dictionary of order book structures indexed by market symbols

See

Param Type Required Description
symbols Array<string> Yes unified array of symbols
params object No extra parameters specific to the exchange API endpoint
binance.unWatchOrderBookForSymbols (symbols, params?)

unWatchOrderBook{docsify-ignore}

unWatches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of binance
Returns: object - A dictionary of order book structures indexed by market symbols

See

Param Type Required Description
symbol string Yes unified array of symbols
params object No extra parameters specific to the exchange API endpoint
binance.unWatchOrderBook (symbol, params?)

fetchOrderBookWs{docsify-ignore}

fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data

Kind: instance method of binance
Returns: object - A dictionary of order book structures indexed by market symbols

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the order book for
limit int No the maximum amount of order book entries to return
params object No extra parameters specific to the exchange API endpoint
binance.fetchOrderBookWs (symbol, limit?, params?)

watchTradesForSymbols{docsify-ignore}

get the list of most recent trades for a list of symbols

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch trades for
since int No timestamp in ms of the earliest trade to fetch
limit int No the maximum amount of trades to fetch
params object No extra parameters specific to the exchange API endpoint
params.name string No the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
binance.watchTradesForSymbols (symbols, since?, limit?, params?)

unWatchTradesForSymbols{docsify-ignore}

unsubscribes from the trades channel

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch trades for
params object No extra parameters specific to the exchange API endpoint
params.name string No the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
binance.unWatchTradesForSymbols (symbols, params?)

unWatchTrades{docsify-ignore}

unsubscribes from the trades channel

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch trades for
params object No extra parameters specific to the exchange API endpoint
params.name string No the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
binance.unWatchTrades (symbol, params?)

watchTrades{docsify-ignore}

get the list of most recent trades for a particular symbol

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch trades for
since int No timestamp in ms of the earliest trade to fetch
limit int No the maximum amount of trades to fetch
params object No extra parameters specific to the exchange API endpoint
params.name string No the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
binance.watchTrades (symbol, since?, limit?, params?)

watchOHLCV{docsify-ignore}

watches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of binance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch OHLCV data for
timeframe string Yes the length of time each candle represents
since int No timestamp in ms of the earliest candle to fetch
limit int No the maximum amount of candles to fetch
params object No extra parameters specific to the exchange API endpoint
params.timezone object No if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
binance.watchOHLCV (symbol, timeframe, since?, limit?, params?)

watchOHLCVForSymbols{docsify-ignore}

watches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of binance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See

Param Type Required Description
symbolsAndTimeframes Array<Array<string>> Yes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example 'BTC/USDT', '1m'], ['LTC/USDT', '5m'
since int No timestamp in ms of the earliest candle to fetch
limit int No the maximum amount of candles to fetch
params object No extra parameters specific to the exchange API endpoint
params.timezone object No if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
binance.watchOHLCVForSymbols (symbolsAndTimeframes, since?, limit?, params?)

unWatchOHLCVForSymbols{docsify-ignore}

unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of binance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See

Param Type Required Description
symbolsAndTimeframes Array<Array<string>> Yes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example 'BTC/USDT', '1m'], ['LTC/USDT', '5m'
params object No extra parameters specific to the exchange API endpoint
params.timezone object No if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
binance.unWatchOHLCVForSymbols (symbolsAndTimeframes, params?)

unWatchOHLCV{docsify-ignore}

unWatches historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of binance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch OHLCV data for
timeframe string Yes the length of time each candle represents
params object No extra parameters specific to the exchange API endpoint
params.timezone object No if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
binance.unWatchOHLCV (symbol, timeframe, params?)

fetchTickerWs{docsify-ignore}

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of binance
Returns: object - a ticker structure

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
params.method string No method to use can be ticker.price or ticker.book
params.returnRateLimits boolean No return the rate limits for the exchange
binance.fetchTickerWs (symbol, params?)

fetchOHLCVWs{docsify-ignore}

query historical candlestick data containing the open, high, low, and close price, and the volume of a market

Kind: instance method of binance
Returns: Array<Array<int>> - A list of candles ordered as timestamp, open, high, low, close, volume

See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#klines

Param Type Description
symbol string unified symbol of the market to query OHLCV data for
timeframe string the length of time each candle represents
since int timestamp in ms of the earliest candle to fetch
limit int the maximum amount of candles to fetch
params object extra parameters specific to the exchange API endpoint
params.until int timestamp in ms of the earliest candle to fetch EXCHANGE SPECIFIC PARAMETERS
params.timeZone string default=0 (UTC)
binance.fetchOHLCVWs (symbol, timeframe, since, limit, params)

watchTicker{docsify-ignore}

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

Kind: instance method of binance
Returns: object - a ticker structure

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
params.name string No stream to use can be ticker or miniTicker
binance.watchTicker (symbol, params?)

watchMarkPrice{docsify-ignore}

watches a mark price for a specific market

Kind: instance method of binance
Returns: object - a ticker structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
params.use1sFreq boolean No default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds
binance.watchMarkPrice (symbol, params?)

watchMarkPrices{docsify-ignore}

watches the mark price for all markets

Kind: instance method of binance
Returns: object - a ticker structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream-for-All-market

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
params.use1sFreq boolean No default is true if set to true, the mark price will be updated every second, otherwise every 3 seconds
binance.watchMarkPrices (symbols, params?)

watchTickers{docsify-ignore}

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of binance
Returns: object - a ticker structure

See

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
binance.watchTickers (symbols, params?)

unWatchTickers{docsify-ignore}

unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of binance
Returns: object - a ticker structure

See

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
binance.unWatchTickers (symbols, params?)

unWatchMarkPrices{docsify-ignore}

unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of binance
Returns: object - a ticker structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
binance.unWatchMarkPrices (symbols, params?)

unWatchMarkPrice{docsify-ignore}

unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of binance
Returns: object - a ticker structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/websocket-market-streams/Mark-Price-Stream

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
binance.unWatchMarkPrice (symbol, params?)

unWatchTicker{docsify-ignore}

unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

Kind: instance method of binance
Returns: object - a ticker structure

See

Param Type Required Description
symbol string Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
binance.unWatchTicker (symbol, params?)

watchBidsAsks{docsify-ignore}

watches best bid & ask for symbols

Kind: instance method of binance
Returns: object - a ticker structure

See

Param Type Required Description
symbols Array<string> Yes unified symbol of the market to fetch the ticker for
params object No extra parameters specific to the exchange API endpoint
binance.watchBidsAsks (symbols, params?)

fetchBalanceWs{docsify-ignore}

fetch balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of binance
Returns: object - a balance structure

See

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
params.type string, undefined No 'future', 'delivery', 'savings', 'funding', or 'spot'
params.marginMode string, undefined No 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
params.symbols Array<string>, undefined No unified market symbols, only used in isolated margin mode
params.method string, undefined No method to use. Can be account.balance, account.status, v2/account.balance or v2/account.status
binance.fetchBalanceWs (params?)

fetchPositionWs{docsify-ignore}

fetch data on an open position

Kind: instance method of binance
Returns: object - a position structure

See: https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/websocket-api/Position-Information

Param Type Required Description
symbol string Yes unified market symbol of the market the position is held in
params object No extra parameters specific to the exchange API endpoint
binance.fetchPositionWs (symbol, params?)

fetchPositionsWs{docsify-ignore}

fetch all open positions

Kind: instance method of binance
Returns: Array<object> - a list of position structure

See

Param Type Required Description
symbols Array<string> No list of unified market symbols
params object No extra parameters specific to the exchange API endpoint
params.returnRateLimits boolean No set to true to return rate limit informations, defaults to false.
params.method string, undefined No method to use. Can be account.position or v2/account.position
binance.fetchPositionsWs (symbols?, params?)

watchBalance{docsify-ignore}

watch balance and get the amount of funds available for trading or funds locked in orders

Kind: instance method of binance
Returns: object - a balance structure

Param Type Required Description
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to watch the balance of a portfolio margin account
binance.watchBalance (params?)

createOrderWs{docsify-ignore}

create a trade order

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
symbol string Yes unified symbol of the market to create an order in
type string Yes 'market' or 'limit'
side string Yes 'buy' or 'sell'
amount float Yes how much of currency you want to trade in units of base currency
price float, undefined No the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params object No extra parameters specific to the exchange API endpoint
params.test boolean Yes test order, default false
params.returnRateLimits boolean Yes set to true to return rate limit information, default false
binance.createOrderWs (symbol, type, side, amount, price?, params?)

editOrderWs{docsify-ignore}

edit a trade order

Kind: instance method of binance
Returns: object - an order structure

See

Param Type Required Description
id string Yes order id
symbol string Yes unified symbol of the market to create an order in
type string Yes 'market' or 'limit'
side string Yes 'buy' or 'sell'
amount float Yes how much of the currency you want to trade in units of the base currency
price float, undefined No the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
params object No extra parameters specific to the exchange API endpoint
binance.editOrderWs (id, symbol, type, side, amount, price?, params?)

cancelOrderWs{docsify-ignore}

cancel multiple orders

Kind: instance method of binance
Returns: object - an list of order structures

See

Param Type Required Description
id string Yes order id
symbol string No unified market symbol, default is undefined
params object No extra parameters specific to the exchange API endpoint
params.cancelRestrictions string, undefined No Supported values: ONLY_NEW - Cancel will succeed if the order status is NEW. ONLY_PARTIALLY_FILLED - Cancel will succeed if order status is PARTIALLY_FILLED.
params.trigger boolean No set to true if you would like to cancel a conditional order
binance.cancelOrderWs (id, symbol?, params?)

cancelAllOrdersWs{docsify-ignore}

cancel all open orders in a market

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#cancel-open-orders-trade

Param Type Required Description
symbol string No unified market symbol of the market to cancel orders in
params object No extra parameters specific to the exchange API endpoint
binance.cancelAllOrdersWs (symbol?, params?)

fetchOrderWs{docsify-ignore}

fetches information on an order made by the user

Kind: instance method of binance
Returns: object - An order structure

See

Param Type Required Description
id string Yes order id
symbol string No unified symbol of the market the order was made in
params object No extra parameters specific to the exchange API endpoint
binance.fetchOrderWs (id, symbol?, params?)

fetchOrdersWs{docsify-ignore}

fetches information on multiple orders made by the user

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists

Param Type Required Description
symbol string Yes unified market symbol of the market orders were made in
since int, undefined No the earliest time in ms to fetch orders for
limit int, undefined No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.orderId int No order id to begin at
params.startTime int No earliest time in ms to retrieve orders for
params.endTime int No latest time in ms to retrieve orders for
params.limit int No the maximum number of order structures to retrieve
binance.fetchOrdersWs (symbol, since?, limit?, params?)

fetchClosedOrdersWs{docsify-ignore}

fetch closed orders

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#order-lists

Param Type Required Description
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch open orders for
limit int No the maximum number of open orders structures to retrieve
params object No extra parameters specific to the exchange API endpoint
binance.fetchClosedOrdersWs (symbol, since?, limit?, params?)

fetchOpenOrdersWs{docsify-ignore}

fetch all unfilled currently open orders

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/trading-requests#current-open-orders-user_data

Param Type Required Description
symbol string Yes unified market symbol
since int, undefined No the earliest time in ms to fetch open orders for
limit int, undefined No the maximum number of open orders structures to retrieve
params object No extra parameters specific to the exchange API endpoint
binance.fetchOpenOrdersWs (symbol, since?, limit?, params?)

watchOrders{docsify-ignore}

watches information on multiple orders made by the user

Kind: instance method of binance
Returns: Array<object> - a list of order structures

See

Param Type Required Description
symbol string Yes unified market symbol of the market the orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.marginMode string, undefined No 'cross' or 'isolated', for spot margin
params.portfolioMargin boolean No set to true if you would like to watch portfolio margin account orders
binance.watchOrders (symbol, since?, limit?, params?)

watchPositions{docsify-ignore}

watch all open positions

Kind: instance method of binance
Returns: Array<object> - a list of position structure

Param Type Required Description
symbols Array<string>, undefined Yes list of unified market symbols
since number No since timestamp
limit number No limit
params object Yes extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to watch positions in a portfolio margin account
binance.watchPositions (symbols, since?, limit?, params)

fetchMyTradesWs{docsify-ignore}

fetch all trades made by the user

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/account-requests#account-trade-history-user_data

Param Type Required Description
symbol string Yes unified market symbol
since int, undefined No the earliest time in ms to fetch trades for
limit int, undefined No the maximum number of trades structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.endTime int No the latest time in ms to fetch trades for
params.fromId int No first trade Id to fetch
binance.fetchMyTradesWs (symbol, since?, limit?, params?)

fetchTradesWs{docsify-ignore}

fetch all trades made by the user

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

See: https://developers.binance.com/docs/binance-spot-api-docs/websocket-api/market-data-requests#recent-trades

Param Type Required Description
symbol string Yes unified market symbol
since int No the earliest time in ms to fetch trades for
limit int No the maximum number of trades structures to retrieve, default=500, max=1000
params object No extra parameters specific to the exchange API endpoint EXCHANGE SPECIFIC PARAMETERS
params.fromId int No trade ID to begin at
binance.fetchTradesWs (symbol, since?, limit?, params?)

watchMyTrades{docsify-ignore}

watches information on multiple trades made by the user

Kind: instance method of binance
Returns: Array<object> - a list of trade structures

Param Type Required Description
symbol string Yes unified market symbol of the market orders were made in
since int No the earliest time in ms to fetch orders for
limit int No the maximum number of order structures to retrieve
params object No extra parameters specific to the exchange API endpoint
params.portfolioMargin boolean No set to true if you would like to watch trades in a portfolio margin account
binance.watchMyTrades (symbol, since?, limit?, params?)

Clone this wiki locally