binance-sdk

v3.6.0
@nemesis-oss/binance-sdk Checked 13 hours ago Published 17 days ago

TypeScript SDK for Binance APIs (Spot, USD-M Futures, COIN-M Futures, Margin, Wallet, Sub-account) — market data, account, trading, algo orders, user data…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

futures_ping

Test connectivity to the Binance USD-M futures REST API. Returns empty object {} on success.

futures_server_time

Get the current Binance USD-M futures server time in milliseconds since epoch.

futures_exchange_info

Get exchange trading rules and symbol metadata: contract type, status, base/quote assets, price/quantity filters, tick size, step size, notional and leverage brackets, delivery dates.

futures_ticker_price

Get latest price for one symbol (v1).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_ticker_price_v2

Get latest price for one symbol, or for all symbols when symbol is omitted (v2 endpoint). Use all-symbols mode for market overviews.

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_ticker_24hr

Get 24-hour rolling price change statistics for a symbol: price change %, high, low, volume, quote volume, open interest.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_book_ticker

Get best bid/ask (top of book) for a single symbol (v1).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_book_ticker_v2

Get best bid/ask (top of book) for one symbol, or all symbols when omitted (v2 endpoint).

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_order_book

Get order book depth for a symbol. Limits: 5, 10, 20, 50, 100, 500, 1000.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitstring

futures_recent_trades

Get the most recent executed trades for a symbol (public endpoint).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitinteger

futures_historical_trades

Get older trades for a symbol by fromId (older than recent).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
fromIdinteger
limitinteger

futures_agg_trades

Get compressed/aggregate trades for a symbol within an optional time window. Each entry aggregates trades with the same price and side.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_klines

Get candlestick (OHLCV) data for a symbol. Intervals: 1m,3m,5m,15m,30m,1h,2h,4h,6h,8h,12h,1d,3d,1w,1M. Max 1500 per request.

ParameterTypeDescription
interval *string
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_continuous_klines

Get klines for a continuous contract (perpetual, current_quarter, next_quarter) identified by base pair (e.g. BTCUSDT).

ParameterTypeDescription
interval *string
symbol *stringBase pair, e.g. BTCUSDT
contractTypestring
endTimeinteger
limitinteger
startTimeinteger

futures_index_price_klines

Get index price candlesticks for a pair (e.g. BTCUSDT index).

ParameterTypeDescription
interval *string
symbol *stringBase pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_mark_price_klines

Get mark price candlesticks for a symbol.

ParameterTypeDescription
interval *string
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_trading_day_ticker

Get the trading-day ticker (v1: rolling window stats by symbol, including open, close, high, low, volume, closeTime).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_mark_price

Get mark price, index price, estimated settle price, last funding rate, next funding time and interest rate for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_funding_rate_history

Get historical funding rates for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_funding_info

Get funding rate configuration for all symbols with adjusted funding cap/floor or interval (e.g. under extreme volatility).

futures_open_interest

Get the current total open interest for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_open_interest_hist

Get historical open interest statistics per period.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitinteger
periodstring

futures_top_long_short_account_ratio

Get top trader long/short account ratio (number of accounts) for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitinteger
periodstring

futures_top_long_short_position_ratio

Get top trader long/short position ratio (accounts with net positions) for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitinteger
periodstring

futures_global_long_short_ratio

Get global long/short account ratio for a symbol (all accounts).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitinteger
periodstring

futures_taker_long_short_ratio

Get taker buy/sell volume ratio for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitinteger
periodstring

futures_basis

Get basis data (spot-futures spread, mark price - index price) for a pair and contract type.

ParameterTypeDescription
symbol *stringBase pair, e.g. BTCUSDT
endTimeinteger
limitinteger
periodstring
startTimeinteger

futures_asset_index

Get multi-assets mode asset index (collateral price) for one asset or all assets.

ParameterTypeDescription
symbolstringAsset index symbol, e.g. ADAUSD

futures_composite_index_info

Get composite index symbol information (e.g. DEFIUSDT) with constituent weights.

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_insurance_balance

Get the insurance fund balance snapshot (GET /fapi/v1/insuranceBalance) for one symbol or all symbols.

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_index_price_constituents

Get the index price constituents (exchange weights) for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_premium_index_klines

Get premium index candlesticks for a symbol (mark price premium over index price).

ParameterTypeDescription
interval *string
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_rpi_depth

Get the RPI (Retail Price Improvement) order book depth for a symbol.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitinteger

futures_delivery_price

Get historical quarterly contract settlement/delivery prices for a pair.

ParameterTypeDescription
symbol *stringBase pair, e.g. BTCUSDT

futures_symbol_adl_risk

Get the auto-deleveraging (ADL) risk level for one symbol or all symbols (public market data, no signature required).

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_adl_quantile

Get the position ADL (auto-deleveraging) quantile estimation for one symbol or all symbols (signed).

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_force_orders

Get the user's force-liquidation orders (LIQUIDATION) and ADL orders for a symbol or all symbols (signed).

ParameterTypeDescription
autoCloseTypestring
endTimeinteger
limitinteger
startTimeinteger
symbolstringUSD-M pair, e.g. BTCUSDT

futures_balance

Get futures account balances (v3): asset, wallet balance, unrealized profit, margin balance, available balance (signed).

futures_account

Get full account information (v3): total wallet/margin balance, unrealized profit, available balance, assets & positions (signed).

futures_balance_v2

Get futures account balance (v2 legacy) per asset (signed).

futures_account_v2

Get futures account information (v2 legacy) (signed).

futures_position_risk

Get current open positions (v3): symbol, side, size, entry price, mark price, liquidation price, leverage, unrealized PnL, margin (signed).

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_income_history

Get futures income history (realized PnL, funding fees, commissions, transfers, insurance clearing). incomeType examples: TRANSFER, REALIZED_PNL, FUNDING_FEE, COMMISSION, INSURANCE_CLEAR, REFERRAL_KICKBACK (signed).

ParameterTypeDescription
endTimeinteger
incomeTypestringe.g. TRANSFER, REALIZED_PNL, FUNDING_FEE, COMMISSION
limitinteger
startTimeinteger
symbolstringUSD-M pair, e.g. BTCUSDT

futures_user_trades

Get account trade list (filled trades) for a symbol with optional time range (signed).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
fromIdinteger
limitinteger
startTimeinteger

futures_leverage_brackets

Get notional and leverage brackets for one symbol or all: tier caps, maintenance margin rate, max leverage (signed).

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_commission_rate

Get user commission rate (taker & maker fee) for a symbol (signed).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. ETHUSDT

futures_multi_assets_mode

Get current multi-assets margin mode status (signed).

futures_set_multi_assets_mode

Enable or disable multi-assets mode (signed; 7-day cooldown between toggles).

ParameterTypeDescription
enabled *booleantrue to enable, false to disable

futures_fee_burn_status

Get BNB fee burn status for futures trades (signed).

futures_set_fee_burn

Toggle BNB fee burn on futures trades (signed).

ParameterTypeDescription
enabled *booleantrue to enable fee burn

futures_position_mode

Get current position mode: one-way (BOTH) or hedge mode (LONG/SHORT) (signed).

futures_set_position_mode

Change position mode: hedgeMode true = dual side (hedge), false = one-way (signed; 30-day cooldown).

ParameterTypeDescription
hedgeMode *booleantrue = hedge mode, false = one-way

futures_api_trading_status

Get futures trading quantitative rules indicators and disable intervals (signed).

futures_position_margin_history

Get isolated position margin change history. type: 1 = add margin, 2 = reduce margin (signed).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
type *string1 = add margin, 2 = reduce margin
endTimeinteger
limitinteger
startTimeinteger

futures_rate_limit_order

Query the current user order rate limit usage (signed).

futures_request_order_download

Request a futures order-history download (async, 7-day window). Returns a downloadId (signed).

ParameterTypeDescription
endTimeinteger
startTimeinteger
symbolstringUSD-M pair, e.g. BTCUSDT

futures_order_download_status

Get the futures order-history download link by downloadId (signed).

ParameterTypeDescription
downloadId *string

futures_request_trade_download

Request a futures trade-history download (async, 7-day window). Returns a downloadId (signed).

ParameterTypeDescription
endTimeinteger
startTimeinteger
symbolstringUSD-M pair, e.g. BTCUSDT

futures_trade_download_status

Get the futures trade-history download link by downloadId (signed).

ParameterTypeDescription
downloadId *string

futures_account_config

Get futures account configuration: fee tier, trading permissions, dual-side position setting (signed).

futures_portfolio_margin_account_info

Get Portfolio Margin account info for an asset: cross margin balance and liability (signed).

ParameterTypeDescription
asset *stringAsset, e.g. USDT

futures_request_income_download

Request a futures income/transaction-history download (async). Returns a downloadId (signed).

ParameterTypeDescription
endTime *integer
startTime *integer

futures_income_download_status

Get the futures income/transaction-history download link by downloadId (signed).

ParameterTypeDescription
downloadId *string

futures_new_order

Place a new futures order. Types: LIMIT, MARKET, STOP, STOP_MARKET, TAKE_PROFIT, TAKE_PROFIT_MARKET, TRAILING_STOP_MARKET. Use STOP_MARKET as the take-profit/stop-loss trigger and LIMIT for the actual fill. Signed.

ParameterTypeDescription
quantity *string | numberOrder quantity in base asset
side *string
symbol *stringUSD-M pair, e.g. BTCUSDT
type *string
activationPricestring | numberActivation price for TRAILING_STOP_MARKET
callbackRatestring | numberPercent callback for TRAILING_STOP_MARKET, e.g. 0.5
closePositionbooleanClose the full position on trigger (mutually exclusive with quantity)
goodTillDateintegerTimestamp when a GTD order expires
newClientOrderIdstring
newOrderRespTypestring
positionSidestring
pricestring | numberRequired for LIMIT and STOP/TAKE_PROFIT (limit-triggered) types
priceProtectboolean
reduceOnlybooleantrue = only reduces the position, never opens
selfTradePreventionModestring
stopPricestring | numberTrigger price for STOP/STOP_MARKET/TAKE_PROFIT/TAKE_PROFIT_MARKET
timeInForcestring
workingTypestringTrigger price basis; default CONTRACT_PRICE

futures_test_order

Validate a new order without submitting it. Returns 200 on success; use to validate fields and margin before real orders. Signed.

ParameterTypeDescription
quantity *string | numberOrder quantity in base asset
side *string
symbol *stringUSD-M pair, e.g. BTCUSDT
type *string
activationPricestring | numberActivation price for TRAILING_STOP_MARKET
callbackRatestring | numberPercent callback for TRAILING_STOP_MARKET, e.g. 0.5
closePositionbooleanClose the full position on trigger (mutually exclusive with quantity)
goodTillDateintegerTimestamp when a GTD order expires
newClientOrderIdstring
newOrderRespTypestring
positionSidestring
pricestring | numberRequired for LIMIT and STOP/TAKE_PROFIT (limit-triggered) types
priceProtectboolean
reduceOnlybooleantrue = only reduces the position, never opens
selfTradePreventionModestring
stopPricestring | numberTrigger price for STOP/STOP_MARKET/TAKE_PROFIT/TAKE_PROFIT_MARKET
timeInForcestring
workingTypestringTrigger price basis; default CONTRACT_PRICE

futures_get_order

Query a specific order by orderId or client order id. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
orderIdinteger
origClientOrderIdstring

futures_cancel_order

Cancel a specific open order by orderId or client order id. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
orderIdinteger
origClientOrderIdstring

futures_get_open_order

Query a current open order (must exist in the open order book). Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
orderIdinteger
origClientOrderIdstring

futures_open_orders

Get all current open orders, for one symbol or all symbols. Signed.

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_all_orders

Get historical orders for a symbol with optional time range (last 7 days by default). Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
orderIdinteger
startTimeinteger

futures_cancel_all_orders

Cancel all open orders for a symbol. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_modify_order

Modify an open order (price/quantity/stopPrice). Cannot modify when position side is BOTH and closePosition is true. Signed.

ParameterTypeDescription
quantity *string | number
side *string
symbol *stringUSD-M pair, e.g. BTCUSDT
newClientOrderIdstring
orderIdinteger
origClientOrderIdstring
positionSidestring
pricestring | number
stopPricestring | number
timeInForcestring

futures_order_modify_history

Get order modification history for a symbol. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_batch_orders

Place up to 5 orders in one request (array of order objects, max 30 per minute per symbol). Signed.

ParameterTypeDescription
orders *array

futures_cancel_batch_orders

Cancel multiple orders at once (up to 10 by orderId list or client order id list). Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
orderIdListarray
origClientOrderIdListarray

futures_set_leverage

Change initial leverage for a symbol (1-125, within bracket). Signed.

ParameterTypeDescription
leverage *integer
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_set_margin_type

Change margin type for a symbol: isolated or cross. Only allowed when no open position for the symbol. Signed.

ParameterTypeDescription
marginType *string
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_modify_position_margin

Add or reduce isolated position margin. marginType: 1 = add margin, 2 = reduce margin. Signed.

ParameterTypeDescription
amount *number
marginType *string1 = add margin, 2 = reduce margin
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_countdown_cancel_all

Auto-cancel all open orders for a symbol after countdownTime ms (0 = cancel the countdown). Emergency circuit breaker. Signed.

ParameterTypeDescription
countdownTime *integer
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_new_algo_order

Place a conditional algo order (CONDITIONAL or VP). CONDITIONAL supports STOP_MARKET/TAKE_PROFIT_MARKET types with triggerPrice; VP is a volume-participation order with urgency and quantity. Signed.

ParameterTypeDescription
algoType *string
quantity *string | number
side *string
symbol *stringUSD-M pair, e.g. BTCUSDT
type *stringFor CONDITIONAL: STOP_MARKET/TAKE_PROFIT_MARKET. For VP: LIMIT
clientAlgoIdstring
closePositionboolean
positionSidestring
pricestring | number
priceProtectboolean
reduceOnlyboolean
timeInForcestring
triggerPricestring | numberRequired for CONDITIONAL
urgencystringRequired for VP
workingTypestring

futures_cancel_algo_order

Cancel an open algo order by algoId or clientAlgoId. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
algoIdinteger
clientAlgoIdstring

futures_cancel_all_algo_orders

Cancel all open algo orders for a symbol. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_get_algo_order

Query an algo order by algoId or clientAlgoId. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
algoIdinteger
clientAlgoIdstring

futures_open_algo_orders

Get all current open algo orders, optionally filtered by symbol. Signed.

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_all_algo_orders

Get historical algo orders for a symbol with optional time range. Signed.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

futures_convert_exchange_info

List asset pairs eligible for futures Convert, optionally filtered by fromAsset/toAsset.

ParameterTypeDescription
fromAssetstring
toAssetstring

futures_convert_get_quote

Request a Convert quote between two assets (quote expires quickly; accept with futures_convert_accept_quote). Signed.

ParameterTypeDescription
fromAsset *string
toAsset *string
fromAmountnumber
toAmountnumber
validTimestring

futures_convert_accept_quote

Accept a previously requested Convert quote by quoteId. Signed.

ParameterTypeDescription
quoteId *string

futures_convert_order_status

Query the status of a Convert order by orderId or quoteId. Signed.

ParameterTypeDescription
orderIdstring
quoteIdstring

spot_ping

Test connectivity to the Binance Spot REST API.

spot_server_time

Get the current Binance Spot server time in ms since epoch.

spot_exchange_info

Get Spot exchange trading rules and symbol metadata (status, base/quote assets, filters, permissions).

spot_ticker_price

Get the latest price for a Spot symbol.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT

spot_ticker_24hr

Get 24-hour rolling price change statistics for a Spot symbol.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT

spot_book_ticker

Get the best bid/ask (top of book) for a Spot symbol.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT

spot_order_book

Get the Spot order book depth for a symbol (limits 5/10/20/50/100/500/1000/5000).

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
limitstring

spot_recent_trades

Get the most recent executed trades for a Spot symbol.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
limitinteger

spot_historical_trades

Get older Spot trades for a symbol by fromId.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
fromIdinteger
limitinteger

spot_agg_trades

Get compressed/aggregate Spot trades for a symbol within an optional time window.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

spot_klines

Get Spot candlesticks (OHLCV). Intervals 1m…1M; max 1000 per request.

ParameterTypeDescription
interval *string
symbol *stringSpot pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

spot_ui_klines

Get Spot candlesticks via the optimized uiKlines endpoint (same shape as spot_klines).

ParameterTypeDescription
interval *string
symbol *stringSpot pair, e.g. BTCUSDT
endTimeinteger
limitinteger
startTimeinteger

spot_avg_price

Get the current average price (5-minute rolling average) for a Spot symbol.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT

spot_rolling_window_ticker

Get rolling-window price change statistics (1d/7d/30d). Omit symbol for all symbols.

ParameterTypeDescription
symbolstringSpot pair, e.g. BTCUSDT
windowSizestring

spot_trading_day_ticker

Get the Spot trading-day ticker (open/close/high/low/volume by UTC day). Omit symbol for all symbols.

ParameterTypeDescription
symbolstringSpot pair, e.g. BTCUSDT
timeZonestring
typestring

spot_account

Get the Spot account: balances (free/locked), commissions, permissions (signed).

spot_my_trades

Get the Spot account trade list (filled trades) for a symbol with optional time range (signed).

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
endTimeinteger
fromIdinteger
limitinteger
orderIdinteger
startTimeinteger

spot_my_prevented_matches

Get Spot orders that were expired by the self-trade-prevention (STP) mechanism (signed).

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
limitinteger
orderIdinteger
preventedMatchIdinteger

spot_account_commission

Get the Spot account commission rates for a symbol (signed).

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT

spot_rate_limit_order

Query the current Spot order rate limit usage (signed).

spot_new_order

Place a new Spot order. Types: LIMIT, MARKET, LIMIT_MAKER, STOP_LOSS, STOP_LOSS_LIMIT, TAKE_PROFIT, TAKE_PROFIT_LIMIT. For MARKET orders use quantity OR quoteOrderQty. Signed.

ParameterTypeDescription
side *string
symbol *stringSpot pair, e.g. BTCUSDT
type *string
icebergQtystring | number
newClientOrderIdstring
newOrderRespTypestring
pricestring | numberRequired for LIMIT / STOP_LOSS_LIMIT / TAKE_PROFIT_LIMIT
quantitystring | numberBase-asset quantity; omit if using quoteOrderQty
quoteOrderQtystring | numberQuote-asset quantity (e.g. spend 100 USDT on a MARKET order)
selfTradePreventionModestring
stopPricestring | numberTrigger price for STOP_LOSS / TAKE_PROFIT variants
timeInForcestringRequired for LIMIT

spot_test_order

Validate a Spot order without submitting it. Signed.

ParameterTypeDescription
side *string
symbol *stringSpot pair, e.g. BTCUSDT
type *string
icebergQtystring | number
newClientOrderIdstring
newOrderRespTypestring
pricestring | numberRequired for LIMIT / STOP_LOSS_LIMIT / TAKE_PROFIT_LIMIT
quantitystring | numberBase-asset quantity; omit if using quoteOrderQty
quoteOrderQtystring | numberQuote-asset quantity (e.g. spend 100 USDT on a MARKET order)
selfTradePreventionModestring
stopPricestring | numberTrigger price for STOP_LOSS / TAKE_PROFIT variants
timeInForcestringRequired for LIMIT

spot_get_order

Query a specific Spot order by orderId or client order id. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
orderIdinteger
origClientOrderIdstring

spot_cancel_order

Cancel a specific open Spot order by orderId or client order id. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
newClientOrderIdstring
orderIdinteger
origClientOrderIdstring

spot_open_orders

Get all current open Spot orders, for one symbol or all symbols. Signed.

ParameterTypeDescription
symbolstringSpot pair, e.g. BTCUSDT

spot_all_orders

Get historical Spot orders for a symbol with optional time range. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
endTimeinteger
limitinteger
orderIdinteger
startTimeinteger

spot_cancel_open_orders

Cancel all open Spot orders for a symbol. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT

spot_cancel_replace_order

Cancel an existing Spot order and place a new one on the same symbol (cancel-replace). Signed.

ParameterTypeDescription
side *string
symbol *stringSpot pair, e.g. BTCUSDT
type *string
cancelNewClientOrderIdstring
cancelOrderIdinteger
cancelOrigClientOrderIdstring
cancelReplaceModestring
newClientOrderIdstring
pricestring | number
quantitystring | number
timeInForcestring

spot_new_oco_order

Place a new Spot OCO (one-cancels-other) order: a stop-loss limit + a limit-maker take-profit. Signed.

ParameterTypeDescription
price *string | numberLimit (take-profit) price
quantity *string | numberTotal base-asset quantity for both legs
side *string
stopPrice *string | numberStop-loss trigger price
symbol *stringSpot pair, e.g. BTCUSDT
limitClientOrderIdstring
listClientOrderIdstring
stopClientOrderIdstring
stopLimitPricestring | numberStop-loss limit price (defaults to stopPrice)
stopLimitTimeInForcestring

spot_cancel_oco_order

Cancel an entire Spot OCO order list by orderListId or listClientOrderId. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
listClientOrderIdstring
newClientOrderIdstring
orderListIdinteger

spot_get_oco_order

Query a Spot OCO order list by orderListId or listClientOrderId. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
orderListIdinteger
origClientOrderIdstring

spot_open_oco_orders

Get all current open Spot OCO order lists. Signed.

spot_all_oco_orders

Get historical Spot OCO order lists for a symbol with optional time range. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT
endTimeinteger
fromIdinteger
limitinteger
startTimeinteger

spot_cancel_open_oco_orders

Cancel all open Spot OCO order lists for a symbol. Signed.

ParameterTypeDescription
symbol *stringSpot pair, e.g. BTCUSDT

spot_ws_start_user_stream

Start the Spot user data stream: connects the WebSocket API and sends a signed userDataStream.subscribe.signature. Emits executionReport, outboundAccountPosition, balanceUpdate, listStatus.

spot_ws_stop_user_stream

Stop the Spot user data stream: closes the WebSocket API connection, which ends the subscription.

options_exchange_info

Get Binance Options exchange trading rules, symbol metadata, and filters.

options_depth

Get Binance Options order-book depth for a specific options symbol.

ParameterTypeDescription
symbol *stringOptions symbol, e.g. BTC-240329-50000-C
limitinteger

options_trades

Get recent trades for a Binance Options symbol.

ParameterTypeDescription
symbol *stringOptions symbol, e.g. BTC-240329-50000-C
limitinteger

options_klines

Get historical klines for a Binance Options symbol.

ParameterTypeDescription
interval *stringKline interval, e.g. 1m, 5m, 15m, 1h, 4h, 1d
symbol *stringOptions symbol
endTimeinteger
limitinteger
startTimeinteger

options_mark

Get mark price for Binance Options symbols (all or by symbol).

ParameterTypeDescription
symbolstring

options_open_interest

Get current open interest for Binance Options symbols.

ParameterTypeDescription
symbolstring

options_account_margin

Get Binance Options account margin details.

ParameterTypeDescription
underlyingstringUnderlying asset, e.g. BTC

options_positions

Get current Binance Options positions.

ParameterTypeDescription
symbolstring

options_open_orders

Get currently open Binance Options orders.

ParameterTypeDescription
symbolstring

options_place_order

Place a Binance Options order.

ParameterTypeDescription
side *string
symbol *stringOptions symbol, e.g. BTC-240329-50000-C
type *stringOrder type: LIMIT or MARKET
newClientOrderIdstring
pricestring | number
quantitystring | number

options_cancel_order

Cancel a Binance Options order.

ParameterTypeDescription
symbol *string
clientOrderIdstring
orderIdstring

pm_account

Get Binance Portfolio Margin account summary (margin level, total net asset, etc.).

pm_balance

Get Binance Portfolio Margin per-asset balances.

pm_um_account

Get Portfolio Margin USDⓈ-M Futures account summary.

pm_um_position_risk

Get Portfolio Margin USDⓈ-M position risk.

ParameterTypeDescription
symbolstring

pm_cm_account

Get Portfolio Margin COIN-M Futures account summary.

pm_portfolio_account

Get Portfolio Margin portfolio-level account (PM loan, collateral, interest).

pm_collateral_rate

Get Portfolio Margin collateral rate table.

pm_rate_limit_order

Get Portfolio Margin order rate-limit usage.

simple_earn_flexible_list

Get Binance Simple Earn flexible product list.

ParameterTypeDescription
assetstringAsset symbol, e.g. BTC

simple_earn_flexible_position

Get Binance Simple Earn flexible positions.

ParameterTypeDescription
assetstringAsset symbol, e.g. BTC

staking_onchain_yields_account

Get Binance On-Chain Yields staking account balance.

staking_rewards_history

Get Binance On-Chain Yields locked rewards history.

ParameterTypeDescription
assetstringAsset symbol, e.g. BTC
endTimeinteger
limitinteger
positionIdnumber
startTimeinteger

vip_loan_ongoing_orders

Get Binance VIP Loan ongoing orders.

vip_loan_repay

Repay a Binance VIP Loan.

ParameterTypeDescription
amount *number
orderId *number

fiat_orders_history

Get Binance Fiat deposit/withdraw order history.

ParameterTypeDescription
transactionType *number0=deposit, 1=withdraw
beginTimenumber
endTimenumber
pagenumber
rowsnumber

wallet_system_status

Get Binance system status (normal / maintenance).

wallet_account_status

Get Binance account status.

wallet_api_trading_status

Get Binance API trading status.

futures_ws_subscribe

Subscribe to real-time market data streams. Topic format: <symbol>@<stream>, e.g. btcusdt@aggTrade, btcusdt@kline_1m, btcusdt@depth20, btcusdt@markPrice@1s, btcusdt@bookTicker, btcusdt@ticker, btcusdt@miniTicker, btcusdt@forceOrder, or all-market topics !ticker@arr, !bookTicker, !markPrice@arr, !markPrice@arr@1s, !forceOrder@arr, !miniTicker@arr, !contractInfo, or the new 2026 streams btcusdt_perpetual@continuousKline_5m, btcusdt@rpiDepth@500ms, tradingSession. Multiple topics can be passed at once.

ParameterTypeDescription
topics *arrayStream topics, e.g. ["btcusdt@aggTrade", "btcusdt@kline_1m"]

futures_ws_continuous_kline

Subscribe to a continuous-contract kline stream for a USDⓈ-M pair. Builds the canonical Binance stream name <symbol>_<contractType>@continuousKline_<interval> (the contract type sits between symbol and stream kind).

ParameterTypeDescription
contractType *string
interval *stringKline interval
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_ws_all_mark_prices_1s

Subscribe to the all-symbols mark-price stream at the 1s update cadence (!markPrice@arr@1s, Binance 2026 addition). Delivers an array of mark-price entries every second.

futures_ws_contract_info

Subscribe to the all-market contract-info stream (!contractInfo). Emits on symbol listing/delisting and on contract parameter changes (leverage bracket, lot size, price precision).

futures_ws_rpi_depth

Subscribe to the Retail Price Improvement (RPI) order-book depth diff stream (<symbol>@rpiDepth@500ms). 500ms cadence; payloads have the same shape as a depthUpdate event.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT

futures_ws_trading_session

Subscribe to the platform trading-session stream (tradingSession, introduced alongside /fapi/v1/tradingSchedule in December 2025). Emits session phase transitions (open, close, pre-market, post-market).

futures_ws_unsubscribe

Unsubscribe from previously subscribed market data streams.

ParameterTypeDescription
topics *array

futures_ws_subscriptions

List the currently subscribed WebSocket market streams for this client.

futures_ws_events

Read the buffered real-time payloads received since the last read for the subscribed streams (aggregate trades, klines, depth deltas, mark price, book tickers, tickers, force orders). Payloads are parsed; depth deltas must be applied to a snapshot from futures_order_book.

ParameterTypeDescription
limitinteger

futures_ws_clear_events

Clear the buffered WebSocket events so the next read only returns new payloads.

futures_ws_start_user_stream

Start the user data stream: creates a listenKey, connects the private WebSocket, and begins a 30-minute keep-alive. Emits private events (ACCOUNT_UPDATE, ORDER_TRADE_UPDATE, MARGIN_CALL, ACCOUNT_CONFIG_UPDATE, listenKeyExpired) that the application can consume from the client.

futures_ws_stop_user_stream

Stop the user data stream: closes the private WebSocket and invalidates the listenKey.

futures_ws_api_order_status

Query an order via the signed WebSocket API (order.status) — lower-latency alternative to futures_get_order.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
orderIdinteger
origClientOrderIdstring

futures_ws_api_account_status

Get account info via the signed WebSocket API (account.status).

futures_ws_api_account_position

Get current positions via the signed WebSocket API (account.position).

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_ws_api_user_data_stream_start

Create a listenKey via the signed WebSocket API (userDataStream.start) — no REST call required.

futures_ws_api_user_data_stream_stop

Invalidate a listenKey via the signed WebSocket API (userDataStream.stop).

ParameterTypeDescription
listenKey *string

futures_ws_api_ticker_price

Get latest price via the unsigned WebSocket API (ticker.price); omit symbol for all symbols.

ParameterTypeDescription
symbolstringUSD-M pair, e.g. BTCUSDT

futures_ws_api_order_book

Get order-book depth via the unsigned WebSocket API (depth).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
limitstring

futures_symbol_rules

Get the tradeable rules for a symbol in one call: tick size, step size, min/max quantity, market-order lot bounds and minimum notional, flattened out of exchangeInfo filters. Call this before sizing or pricing any order.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
refreshbooleanBypass the 60s cache

futures_quantize

Round a price to the symbol's tick size and a quantity to its step size, returning exchange-ready strings. Use this instead of rounding numbers yourself — Binance rejects off-tick prices (-1111).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
marketOrderbooleanUse MARKET_LOT_SIZE bounds instead of LOT_SIZE
pricenumber
quantitynumber

futures_size_position

Convert a risk budget into an exchange-ready order quantity. Given a stop price and either riskAmount (quote currency) or riskPct (percent of available balance), returns the quantity rounded down to the symbol step size, plus the notional, required margin and every constraint that failed (min notional, lot bounds, wrong-side stop). Never increases risk to satisfy a minimum — it reports instead.

ParameterTypeDescription
side *string
stopPrice *numberProtective stop price
symbol *stringUSD-M pair, e.g. BTCUSDT
entryPricenumberDefaults to current mark price
leverageintegerUsed to report required margin
marketOrderboolean
riskAmountnumberQuote-currency amount to risk, e.g. 50 USDT
riskPctnumberPercent of available balance to risk (signed call)

futures_close_position

Flatten an open position with a reduce-only market order. Reads the current position, derives the closing side from its sign, and automatically uses reduceOnly in one-way mode vs positionSide in hedge mode (Binance rejects the wrong one). Set dryRun to preview the order without sending it. Signed, destructive.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
dryRunboolean
portionnumberFraction of the position to close, e.g. 0.5 for half
positionSidestringRequired when hedge mode has both sides open

futures_market_snapshot

One-call market picture for a symbol: 24h stats, mark/index price with funding, open interest and long/short positioning. Replaces four separate primitive calls; individual feeds degrade to an error field rather than failing the whole snapshot.

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
periodstring

futures_account_overview

One-call account picture: funded balances, open positions only (zero-size entries filtered out), working orders, and totals for unrealized PnL and gross notional. Signed.

futures_place_bracket_order

Place an entry order together with its protective stop-loss and optional take-profit, with all prices quantized to the symbol tick. Returns each leg separately; if a protective leg fails the response is flagged protectionComplete=false and the entry is NOT auto-cancelled (it may already have filled). Signed, destructive.

ParameterTypeDescription
quantity *string | number
side *string
stopLossPrice *number
symbol *stringUSD-M pair, e.g. BTCUSDT
entryPricenumberOmit for a MARKET entry
positionSidestring
takeProfitPricenumber
workingTypestring

paper_init

Initialize paper-trading state (reset balances, positions, history). No API keys required.

ParameterTypeDescription
balancenumberStarting USDT balance

paper_balance

Get current paper-trading balance and open-position equity (uses live market prices if an open position exists). No API keys required.

paper_open_position

Open an in-memory paper position at the live ticker price (or a fixed price). No API keys required.

ParameterTypeDescription
quantity *number
side *string
symbol *stringUSD-M pair, e.g. BTCUSDT
pricenumberIf omitted, uses live ticker price

paper_close_position

Close a paper position by id (or symbol) and realize PnL at the live/last price.

ParameterTypeDescription
idstringPosition id from paper_open_position
pricenumberIf omitted, uses live ticker price
symbolstringClose the position for this symbol

paper_positions

List open paper positions with live unrealized PnL (marked to market).

paper_history

List paper-trading history of open/close events with realized PnL.

paper_summary

Summarize paper-trading state: balance, open positions, trade count.

execution_place_order

Place an order through the execution gateway: idempotent (retry with the same intentId returns the original execution), reconciled on ambiguous failures, and routable to the live exchange or the paper simulator via `backend`. Paper orders need no API keys. MARKET and LIMIT types supported on paper.

ParameterTypeDescription
quantity *string | numberOrder quantity in base asset
side *string
symbol *stringUSD-M pair, e.g. BTCUSDT
type *string
activationPricestring | numberActivation price for TRAILING_STOP_MARKET
backendstringExecution backend for this call; default is the gateway's default backend
callbackRatestring | numberPercent callback for TRAILING_STOP_MARKET, e.g. 0.5
closePositionbooleanClose the full position on trigger (mutually exclusive with quantity)
goodTillDateintegerTimestamp when a GTD order expires
intentIdstringIdempotency key. Re-submitting the same intentId returns the original execution instead of placing a second order. Recommended for any retry loop.
newClientOrderIdstring
newOrderRespTypestring
positionSidestring
pricestring | numberRequired for LIMIT and STOP/TAKE_PROFIT (limit-triggered) types
priceProtectboolean
reduceOnlybooleantrue = only reduces the position, never opens
selfTradePreventionModestring
stopPricestring | numberTrigger price for STOP/STOP_MARKET/TAKE_PROFIT/TAKE_PROFIT_MARKET
timeInForcestring
workingTypestringTrigger price basis; default CONTRACT_PRICE

execution_cancel_order

Cancel an order idempotently by exchange orderId, clientOrderId, or the intentId from execution_place_order. Cancels of already-gone orders resolve to a terminal CANCELED execution (never a thrown -2011).

ParameterTypeDescription
symbol *stringUSD-M pair, e.g. BTCUSDT
backendstringExecution backend for this call; default is the gateway's default backend
intentIdstringIdempotency key. Re-submitting the same intentId returns the original execution instead of placing a second order. Recommended for any retry loop.
orderIdintegerExchange order id
origClientOrderIdstringClient order id (the reconciliation key)

execution_get_order

Fetch an execution from the ledger by its intentId. When `backend` is omitted both ledgers are searched (paper first), so callers do not need to remember where an intent ran.

ParameterTypeDescription
intentId *string
backendstringExecution backend for this call; default is the gateway's default backend

execution_list_orders

List the execution ledger (most recent first) for a backend. Each entry carries status, fills, and reconciliation state. Paper and live ledgers are independent.

ParameterTypeDescription
backendstringExecution backend for this call; default is the gateway's default backend

execution_reconcile_order

Force a reconciliation pass for an intent whose outcome is unknown (e.g. after a timeout). Recovers the true state from the exchange (live) or simulator (paper) instead of guessing.

ParameterTypeDescription
intentId *string
backendstringExecution backend for this call; default is the gateway's default backend

execution_status

Snapshot of the execution environment: default backend, risk-gateway state (when a trading policy is configured), and the paper simulator account (balance, positions, unrealized PnL). Read-only, never places orders.