binance-sdk
v3.6.0TypeScript 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).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
futures_book_ticker
Get best bid/ask (top of book) for a single symbol (v1).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-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).
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_order_book
Get order book depth for a symbol. Limits: 5, 10, 20, 50, 100, 500, 1000.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | string |
futures_recent_trades
Get the most recent executed trades for a symbol (public endpoint).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | integer |
futures_historical_trades
Get older trades for a symbol by fromId (older than recent).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
fromId | integer | |
limit | integer |
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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
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.
| Parameter | Type | Description |
|---|---|---|
interval * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
futures_continuous_klines
Get klines for a continuous contract (perpetual, current_quarter, next_quarter) identified by base pair (e.g. BTCUSDT).
| Parameter | Type | Description |
|---|---|---|
interval * | string | |
symbol * | string | Base pair, e.g. BTCUSDT |
contractType | string | |
endTime | integer | |
limit | integer | |
startTime | integer |
futures_index_price_klines
Get index price candlesticks for a pair (e.g. BTCUSDT index).
| Parameter | Type | Description |
|---|---|---|
interval * | string | |
symbol * | string | Base pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
futures_mark_price_klines
Get mark price candlesticks for a symbol.
| Parameter | Type | Description |
|---|---|---|
interval * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
futures_trading_day_ticker
Get the trading-day ticker (v1: rolling window stats by symbol, including open, close, high, low, volume, closeTime).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
futures_funding_rate_history
Get historical funding rates for a symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
futures_open_interest_hist
Get historical open interest statistics per period.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | integer | |
period | string |
futures_top_long_short_account_ratio
Get top trader long/short account ratio (number of accounts) for a symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | integer | |
period | string |
futures_top_long_short_position_ratio
Get top trader long/short position ratio (accounts with net positions) for a symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | integer | |
period | string |
futures_global_long_short_ratio
Get global long/short account ratio for a symbol (all accounts).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | integer | |
period | string |
futures_taker_long_short_ratio
Get taker buy/sell volume ratio for a symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | integer | |
period | string |
futures_basis
Get basis data (spot-futures spread, mark price - index price) for a pair and contract type.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Base pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
period | string | |
startTime | integer |
futures_asset_index
Get multi-assets mode asset index (collateral price) for one asset or all assets.
| Parameter | Type | Description |
|---|---|---|
symbol | string | Asset index symbol, e.g. ADAUSD |
futures_composite_index_info
Get composite index symbol information (e.g. DEFIUSDT) with constituent weights.
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_insurance_balance
Get the insurance fund balance snapshot (GET /fapi/v1/insuranceBalance) for one symbol or all symbols.
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_index_price_constituents
Get the index price constituents (exchange weights) for a symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
futures_rpi_depth
Get the RPI (Retail Price Improvement) order book depth for a symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | integer |
futures_delivery_price
Get historical quarterly contract settlement/delivery prices for a pair.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Base 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).
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_adl_quantile
Get the position ADL (auto-deleveraging) quantile estimation for one symbol or all symbols (signed).
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-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).
| Parameter | Type | Description |
|---|---|---|
autoCloseType | string | |
endTime | integer | |
limit | integer | |
startTime | integer | |
symbol | string | USD-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).
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-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).
| Parameter | Type | Description |
|---|---|---|
endTime | integer | |
incomeType | string | e.g. TRANSFER, REALIZED_PNL, FUNDING_FEE, COMMISSION |
limit | integer | |
startTime | integer | |
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_user_trades
Get account trade list (filled trades) for a symbol with optional time range (signed).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
fromId | integer | |
limit | integer | |
startTime | integer |
futures_leverage_brackets
Get notional and leverage brackets for one symbol or all: tier caps, maintenance margin rate, max leverage (signed).
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_commission_rate
Get user commission rate (taker & maker fee) for a symbol (signed).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-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).
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true 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).
| Parameter | Type | Description |
|---|---|---|
enabled * | boolean | true 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).
| Parameter | Type | Description |
|---|---|---|
hedgeMode * | boolean | true = 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).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
type * | string | 1 = add margin, 2 = reduce margin |
endTime | integer | |
limit | integer | |
startTime | integer |
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).
| Parameter | Type | Description |
|---|---|---|
endTime | integer | |
startTime | integer | |
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_order_download_status
Get the futures order-history download link by downloadId (signed).
| Parameter | Type | Description |
|---|---|---|
downloadId * | string |
futures_request_trade_download
Request a futures trade-history download (async, 7-day window). Returns a downloadId (signed).
| Parameter | Type | Description |
|---|---|---|
endTime | integer | |
startTime | integer | |
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_trade_download_status
Get the futures trade-history download link by downloadId (signed).
| Parameter | Type | Description |
|---|---|---|
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).
| Parameter | Type | Description |
|---|---|---|
asset * | string | Asset, e.g. USDT |
futures_request_income_download
Request a futures income/transaction-history download (async). Returns a downloadId (signed).
| Parameter | Type | Description |
|---|---|---|
endTime * | integer | |
startTime * | integer |
futures_income_download_status
Get the futures income/transaction-history download link by downloadId (signed).
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
quantity * | string | number | Order quantity in base asset |
side * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
type * | string | |
activationPrice | string | number | Activation price for TRAILING_STOP_MARKET |
callbackRate | string | number | Percent callback for TRAILING_STOP_MARKET, e.g. 0.5 |
closePosition | boolean | Close the full position on trigger (mutually exclusive with quantity) |
goodTillDate | integer | Timestamp when a GTD order expires |
newClientOrderId | string | |
newOrderRespType | string | |
positionSide | string | |
price | string | number | Required for LIMIT and STOP/TAKE_PROFIT (limit-triggered) types |
priceProtect | boolean | |
reduceOnly | boolean | true = only reduces the position, never opens |
selfTradePreventionMode | string | |
stopPrice | string | number | Trigger price for STOP/STOP_MARKET/TAKE_PROFIT/TAKE_PROFIT_MARKET |
timeInForce | string | |
workingType | string | Trigger 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.
| Parameter | Type | Description |
|---|---|---|
quantity * | string | number | Order quantity in base asset |
side * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
type * | string | |
activationPrice | string | number | Activation price for TRAILING_STOP_MARKET |
callbackRate | string | number | Percent callback for TRAILING_STOP_MARKET, e.g. 0.5 |
closePosition | boolean | Close the full position on trigger (mutually exclusive with quantity) |
goodTillDate | integer | Timestamp when a GTD order expires |
newClientOrderId | string | |
newOrderRespType | string | |
positionSide | string | |
price | string | number | Required for LIMIT and STOP/TAKE_PROFIT (limit-triggered) types |
priceProtect | boolean | |
reduceOnly | boolean | true = only reduces the position, never opens |
selfTradePreventionMode | string | |
stopPrice | string | number | Trigger price for STOP/STOP_MARKET/TAKE_PROFIT/TAKE_PROFIT_MARKET |
timeInForce | string | |
workingType | string | Trigger price basis; default CONTRACT_PRICE |
futures_get_order
Query a specific order by orderId or client order id. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
orderId | integer | |
origClientOrderId | string |
futures_cancel_order
Cancel a specific open order by orderId or client order id. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
orderId | integer | |
origClientOrderId | string |
futures_get_open_order
Query a current open order (must exist in the open order book). Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
orderId | integer | |
origClientOrderId | string |
futures_open_orders
Get all current open orders, for one symbol or all symbols. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_all_orders
Get historical orders for a symbol with optional time range (last 7 days by default). Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
orderId | integer | |
startTime | integer |
futures_cancel_all_orders
Cancel all open orders for a symbol. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
quantity * | string | number | |
side * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
newClientOrderId | string | |
orderId | integer | |
origClientOrderId | string | |
positionSide | string | |
price | string | number | |
stopPrice | string | number | |
timeInForce | string |
futures_order_modify_history
Get order modification history for a symbol. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
futures_batch_orders
Place up to 5 orders in one request (array of order objects, max 30 per minute per symbol). Signed.
| Parameter | Type | Description |
|---|---|---|
orders * | array |
futures_cancel_batch_orders
Cancel multiple orders at once (up to 10 by orderId list or client order id list). Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
orderIdList | array | |
origClientOrderIdList | array |
futures_set_leverage
Change initial leverage for a symbol (1-125, within bracket). Signed.
| Parameter | Type | Description |
|---|---|---|
leverage * | integer | |
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
marginType * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
futures_modify_position_margin
Add or reduce isolated position margin. marginType: 1 = add margin, 2 = reduce margin. Signed.
| Parameter | Type | Description |
|---|---|---|
amount * | number | |
marginType * | string | 1 = add margin, 2 = reduce margin |
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
countdownTime * | integer | |
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
algoType * | string | |
quantity * | string | number | |
side * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
type * | string | For CONDITIONAL: STOP_MARKET/TAKE_PROFIT_MARKET. For VP: LIMIT |
clientAlgoId | string | |
closePosition | boolean | |
positionSide | string | |
price | string | number | |
priceProtect | boolean | |
reduceOnly | boolean | |
timeInForce | string | |
triggerPrice | string | number | Required for CONDITIONAL |
urgency | string | Required for VP |
workingType | string |
futures_cancel_algo_order
Cancel an open algo order by algoId or clientAlgoId. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
algoId | integer | |
clientAlgoId | string |
futures_cancel_all_algo_orders
Cancel all open algo orders for a symbol. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
futures_get_algo_order
Query an algo order by algoId or clientAlgoId. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
algoId | integer | |
clientAlgoId | string |
futures_open_algo_orders
Get all current open algo orders, optionally filtered by symbol. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_all_algo_orders
Get historical algo orders for a symbol with optional time range. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
futures_convert_exchange_info
List asset pairs eligible for futures Convert, optionally filtered by fromAsset/toAsset.
| Parameter | Type | Description |
|---|---|---|
fromAsset | string | |
toAsset | string |
futures_convert_get_quote
Request a Convert quote between two assets (quote expires quickly; accept with futures_convert_accept_quote). Signed.
| Parameter | Type | Description |
|---|---|---|
fromAsset * | string | |
toAsset * | string | |
fromAmount | number | |
toAmount | number | |
validTime | string |
futures_convert_accept_quote
Accept a previously requested Convert quote by quoteId. Signed.
| Parameter | Type | Description |
|---|---|---|
quoteId * | string |
futures_convert_order_status
Query the status of a Convert order by orderId or quoteId. Signed.
| Parameter | Type | Description |
|---|---|---|
orderId | string | |
quoteId | string |
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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
spot_ticker_24hr
Get 24-hour rolling price change statistics for a Spot symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
spot_book_ticker
Get the best bid/ask (top of book) for a Spot symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot 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).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
limit | string |
spot_recent_trades
Get the most recent executed trades for a Spot symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
limit | integer |
spot_historical_trades
Get older Spot trades for a symbol by fromId.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
fromId | integer | |
limit | integer |
spot_agg_trades
Get compressed/aggregate Spot trades for a symbol within an optional time window.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
spot_klines
Get Spot candlesticks (OHLCV). Intervals 1m…1M; max 1000 per request.
| Parameter | Type | Description |
|---|---|---|
interval * | string | |
symbol * | string | Spot pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
spot_ui_klines
Get Spot candlesticks via the optimized uiKlines endpoint (same shape as spot_klines).
| Parameter | Type | Description |
|---|---|---|
interval * | string | |
symbol * | string | Spot pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
startTime | integer |
spot_avg_price
Get the current average price (5-minute rolling average) for a Spot symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
spot_rolling_window_ticker
Get rolling-window price change statistics (1d/7d/30d). Omit symbol for all symbols.
| Parameter | Type | Description |
|---|---|---|
symbol | string | Spot pair, e.g. BTCUSDT |
windowSize | string |
spot_trading_day_ticker
Get the Spot trading-day ticker (open/close/high/low/volume by UTC day). Omit symbol for all symbols.
| Parameter | Type | Description |
|---|---|---|
symbol | string | Spot pair, e.g. BTCUSDT |
timeZone | string | |
type | string |
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).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
endTime | integer | |
fromId | integer | |
limit | integer | |
orderId | integer | |
startTime | integer |
spot_my_prevented_matches
Get Spot orders that were expired by the self-trade-prevention (STP) mechanism (signed).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
limit | integer | |
orderId | integer | |
preventedMatchId | integer |
spot_account_commission
Get the Spot account commission rates for a symbol (signed).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot 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.
| Parameter | Type | Description |
|---|---|---|
side * | string | |
symbol * | string | Spot pair, e.g. BTCUSDT |
type * | string | |
icebergQty | string | number | |
newClientOrderId | string | |
newOrderRespType | string | |
price | string | number | Required for LIMIT / STOP_LOSS_LIMIT / TAKE_PROFIT_LIMIT |
quantity | string | number | Base-asset quantity; omit if using quoteOrderQty |
quoteOrderQty | string | number | Quote-asset quantity (e.g. spend 100 USDT on a MARKET order) |
selfTradePreventionMode | string | |
stopPrice | string | number | Trigger price for STOP_LOSS / TAKE_PROFIT variants |
timeInForce | string | Required for LIMIT |
spot_test_order
Validate a Spot order without submitting it. Signed.
| Parameter | Type | Description |
|---|---|---|
side * | string | |
symbol * | string | Spot pair, e.g. BTCUSDT |
type * | string | |
icebergQty | string | number | |
newClientOrderId | string | |
newOrderRespType | string | |
price | string | number | Required for LIMIT / STOP_LOSS_LIMIT / TAKE_PROFIT_LIMIT |
quantity | string | number | Base-asset quantity; omit if using quoteOrderQty |
quoteOrderQty | string | number | Quote-asset quantity (e.g. spend 100 USDT on a MARKET order) |
selfTradePreventionMode | string | |
stopPrice | string | number | Trigger price for STOP_LOSS / TAKE_PROFIT variants |
timeInForce | string | Required for LIMIT |
spot_get_order
Query a specific Spot order by orderId or client order id. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
orderId | integer | |
origClientOrderId | string |
spot_cancel_order
Cancel a specific open Spot order by orderId or client order id. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
newClientOrderId | string | |
orderId | integer | |
origClientOrderId | string |
spot_open_orders
Get all current open Spot orders, for one symbol or all symbols. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol | string | Spot pair, e.g. BTCUSDT |
spot_all_orders
Get historical Spot orders for a symbol with optional time range. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
endTime | integer | |
limit | integer | |
orderId | integer | |
startTime | integer |
spot_cancel_open_orders
Cancel all open Spot orders for a symbol. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot 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.
| Parameter | Type | Description |
|---|---|---|
side * | string | |
symbol * | string | Spot pair, e.g. BTCUSDT |
type * | string | |
cancelNewClientOrderId | string | |
cancelOrderId | integer | |
cancelOrigClientOrderId | string | |
cancelReplaceMode | string | |
newClientOrderId | string | |
price | string | number | |
quantity | string | number | |
timeInForce | string |
spot_new_oco_order
Place a new Spot OCO (one-cancels-other) order: a stop-loss limit + a limit-maker take-profit. Signed.
| Parameter | Type | Description |
|---|---|---|
price * | string | number | Limit (take-profit) price |
quantity * | string | number | Total base-asset quantity for both legs |
side * | string | |
stopPrice * | string | number | Stop-loss trigger price |
symbol * | string | Spot pair, e.g. BTCUSDT |
limitClientOrderId | string | |
listClientOrderId | string | |
stopClientOrderId | string | |
stopLimitPrice | string | number | Stop-loss limit price (defaults to stopPrice) |
stopLimitTimeInForce | string |
spot_cancel_oco_order
Cancel an entire Spot OCO order list by orderListId or listClientOrderId. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
listClientOrderId | string | |
newClientOrderId | string | |
orderListId | integer |
spot_get_oco_order
Query a Spot OCO order list by orderListId or listClientOrderId. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
orderListId | integer | |
origClientOrderId | string |
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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot pair, e.g. BTCUSDT |
endTime | integer | |
fromId | integer | |
limit | integer | |
startTime | integer |
spot_cancel_open_oco_orders
Cancel all open Spot OCO order lists for a symbol. Signed.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Spot 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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Options symbol, e.g. BTC-240329-50000-C |
limit | integer |
options_trades
Get recent trades for a Binance Options symbol.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | Options symbol, e.g. BTC-240329-50000-C |
limit | integer |
options_klines
Get historical klines for a Binance Options symbol.
| Parameter | Type | Description |
|---|---|---|
interval * | string | Kline interval, e.g. 1m, 5m, 15m, 1h, 4h, 1d |
symbol * | string | Options symbol |
endTime | integer | |
limit | integer | |
startTime | integer |
options_mark
Get mark price for Binance Options symbols (all or by symbol).
| Parameter | Type | Description |
|---|---|---|
symbol | string |
options_open_interest
Get current open interest for Binance Options symbols.
| Parameter | Type | Description |
|---|---|---|
symbol | string |
options_account_margin
Get Binance Options account margin details.
| Parameter | Type | Description |
|---|---|---|
underlying | string | Underlying asset, e.g. BTC |
options_positions
Get current Binance Options positions.
| Parameter | Type | Description |
|---|---|---|
symbol | string |
options_open_orders
Get currently open Binance Options orders.
| Parameter | Type | Description |
|---|---|---|
symbol | string |
options_place_order
Place a Binance Options order.
| Parameter | Type | Description |
|---|---|---|
side * | string | |
symbol * | string | Options symbol, e.g. BTC-240329-50000-C |
type * | string | Order type: LIMIT or MARKET |
newClientOrderId | string | |
price | string | number | |
quantity | string | number |
options_cancel_order
Cancel a Binance Options order.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | |
clientOrderId | string | |
orderId | string |
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.
| Parameter | Type | Description |
|---|---|---|
symbol | string |
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.
| Parameter | Type | Description |
|---|---|---|
asset | string | Asset symbol, e.g. BTC |
simple_earn_flexible_position
Get Binance Simple Earn flexible positions.
| Parameter | Type | Description |
|---|---|---|
asset | string | Asset 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.
| Parameter | Type | Description |
|---|---|---|
asset | string | Asset symbol, e.g. BTC |
endTime | integer | |
limit | integer | |
positionId | number | |
startTime | integer |
vip_loan_ongoing_orders
Get Binance VIP Loan ongoing orders.
vip_loan_repay
Repay a Binance VIP Loan.
| Parameter | Type | Description |
|---|---|---|
amount * | number | |
orderId * | number |
fiat_orders_history
Get Binance Fiat deposit/withdraw order history.
| Parameter | Type | Description |
|---|---|---|
transactionType * | number | 0=deposit, 1=withdraw |
beginTime | number | |
endTime | number | |
page | number | |
rows | number |
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.
| Parameter | Type | Description |
|---|---|---|
topics * | array | Stream 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).
| Parameter | Type | Description |
|---|---|---|
contractType * | string | |
interval * | string | Kline interval |
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-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.
| Parameter | Type | Description |
|---|---|---|
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.
| Parameter | Type | Description |
|---|---|---|
limit | integer |
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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
orderId | integer | |
origClientOrderId | string |
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).
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-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).
| Parameter | Type | Description |
|---|---|---|
listenKey * | string |
futures_ws_api_ticker_price
Get latest price via the unsigned WebSocket API (ticker.price); omit symbol for all symbols.
| Parameter | Type | Description |
|---|---|---|
symbol | string | USD-M pair, e.g. BTCUSDT |
futures_ws_api_order_book
Get order-book depth via the unsigned WebSocket API (depth).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
limit | string |
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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
refresh | boolean | Bypass 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).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
marketOrder | boolean | Use MARKET_LOT_SIZE bounds instead of LOT_SIZE |
price | number | |
quantity | number |
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.
| Parameter | Type | Description |
|---|---|---|
side * | string | |
stopPrice * | number | Protective stop price |
symbol * | string | USD-M pair, e.g. BTCUSDT |
entryPrice | number | Defaults to current mark price |
leverage | integer | Used to report required margin |
marketOrder | boolean | |
riskAmount | number | Quote-currency amount to risk, e.g. 50 USDT |
riskPct | number | Percent 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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
dryRun | boolean | |
portion | number | Fraction of the position to close, e.g. 0.5 for half |
positionSide | string | Required 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.
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
period | string |
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.
| Parameter | Type | Description |
|---|---|---|
quantity * | string | number | |
side * | string | |
stopLossPrice * | number | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
entryPrice | number | Omit for a MARKET entry |
positionSide | string | |
takeProfitPrice | number | |
workingType | string |
paper_init
Initialize paper-trading state (reset balances, positions, history). No API keys required.
| Parameter | Type | Description |
|---|---|---|
balance | number | Starting 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.
| Parameter | Type | Description |
|---|---|---|
quantity * | number | |
side * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
price | number | If omitted, uses live ticker price |
paper_close_position
Close a paper position by id (or symbol) and realize PnL at the live/last price.
| Parameter | Type | Description |
|---|---|---|
id | string | Position id from paper_open_position |
price | number | If omitted, uses live ticker price |
symbol | string | Close 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.
| Parameter | Type | Description |
|---|---|---|
quantity * | string | number | Order quantity in base asset |
side * | string | |
symbol * | string | USD-M pair, e.g. BTCUSDT |
type * | string | |
activationPrice | string | number | Activation price for TRAILING_STOP_MARKET |
backend | string | Execution backend for this call; default is the gateway's default backend |
callbackRate | string | number | Percent callback for TRAILING_STOP_MARKET, e.g. 0.5 |
closePosition | boolean | Close the full position on trigger (mutually exclusive with quantity) |
goodTillDate | integer | Timestamp when a GTD order expires |
intentId | string | Idempotency key. Re-submitting the same intentId returns the original execution instead of placing a second order. Recommended for any retry loop. |
newClientOrderId | string | |
newOrderRespType | string | |
positionSide | string | |
price | string | number | Required for LIMIT and STOP/TAKE_PROFIT (limit-triggered) types |
priceProtect | boolean | |
reduceOnly | boolean | true = only reduces the position, never opens |
selfTradePreventionMode | string | |
stopPrice | string | number | Trigger price for STOP/STOP_MARKET/TAKE_PROFIT/TAKE_PROFIT_MARKET |
timeInForce | string | |
workingType | string | Trigger 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).
| Parameter | Type | Description |
|---|---|---|
symbol * | string | USD-M pair, e.g. BTCUSDT |
backend | string | Execution backend for this call; default is the gateway's default backend |
intentId | string | Idempotency key. Re-submitting the same intentId returns the original execution instead of placing a second order. Recommended for any retry loop. |
orderId | integer | Exchange order id |
origClientOrderId | string | Client 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.
| Parameter | Type | Description |
|---|---|---|
intentId * | string | |
backend | string | Execution 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.
| Parameter | Type | Description |
|---|---|---|
backend | string | Execution 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.
| Parameter | Type | Description |
|---|---|---|
intentId * | string | |
backend | string | Execution 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.