pub enum FuturesApi {
Show 66 variants
TestConnectivity,
CheckServerTime,
ExchangeInformation,
OrderBook,
RecentTrades,
HistoricalTrades,
AggregatedTrades,
KLines,
ContinuousKLines,
IndexPriceKLines,
MarkPriceKLines,
MarkPrice,
FundingRate,
Ticker24hr,
Ticker24hrAll,
PriceTicker,
PriceTickerAll,
OrderBookTicker,
OrderBookTickerAll,
OpenInterest,
OpenInterestStatistics,
TopLongShortAccountRatio,
TopLongShortPositionRatio,
GlobalLongShortAccountRatio,
TakerBuySellVolume,
HistoricalLvtKLines,
CompositeIndexSymbolInfo,
MultiAssetsIndex,
MultiAssetsIndexAll,
GetPositionMode,
ChangePositionMode,
GetMultiAssetsMode,
ChangeMultiAssetsMode,
NewOrder,
GetOrder,
GetOpenOrder,
CancelOrder,
NewOrders,
CancelOrders,
GetOpenOrders,
GetOpenOrdersAllSymbols,
CancelOpenOrders,
AutoCancelOpenOrders,
GetAllOrders,
AccountBalance,
AccountInformation,
ChangeInitialLeverage,
ChangeMarginType,
ModifyIsolatedPositionMargin,
GetPositionMarginHistory,
PositionInformation,
AccountTrades,
GetIncomeHistory,
GetNotionalLeverageBrackets,
PositionAdlQuantileEstimation,
GetForceOrders,
GetForceOrdersAll,
QuantitativeRulesIndicators,
QuantitativeRulesIndicatorsAll,
GetCommissionRate,
GetDownloadIdTransactionHistory,
GetTransactionHistoryById,
StartUserDataStream,
KeepAliveUserDataStream,
CloseUserDataStream,
GetPortfolioMargin,
}
Expand description
Set of possible HTTP methods. Every variant corresponds to a single API call (combination of path and HTTP verb).
Variants§
TestConnectivity
Test connectivity to the Rest API.
CheckServerTime
Test connectivity to the Rest API and get the current server time.
ExchangeInformation
Current exchange trading rules and symbol information.
OrderBook
Get the order book.
RecentTrades
Get recent market trades.
Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won’t be returned.
HistoricalTrades
Get older market historical trades.
Market trades means trades filled in the order book. Only market trades will be returned, which means the insurance fund trades and ADL trades won’t be returned.
AggregatedTrades
Get compressed, aggregate market trades. Market trades that fill in 100ms with the same price and the same taking side will have the quantity aggregated.
- If both
startTime
andendTime
are sent, time betweenstartTime
andendTime
must be less than1 hour
. - If
fromId
,startTime
, andendTime
are not sent, the most recent aggregate trades will be returned. - Only market trades will be aggregated and returned, which means the insurance fund trades and ADL trades won’t be aggregated.
KLines
Kline/candlestick bars for a symbol. Klines are uniquely identified by their open time.
- If
startTime
andendTime
are not sent, the most recent klines are returned.
ContinuousKLines
Kline/candlestick bars for a specific contract type. Klines are uniquely identified by their open time.
- If
startTime
andendTime
are not sent, the most recent klines are returned.
Contract type is one of the following:
- PERPETUAL
- CURRENT_QUARTER
- NEXT_QUARTER
IndexPriceKLines
Kline/candlestick bars for the index price of a pair. Klines are uniquely identified by their open time.
- If
startTime
andendTime
are not sent, the most recent klines are returned.
MarkPriceKLines
Kline/candlestick bars for the mark price of a symbol. Klines are uniquely identified by their open time.
- If
startTime
andendTime
are not sent, the most recent klines are returned.
MarkPrice
Get Mark Price and Funding Rate.
FundingRate
Get Funding Rate History.
- If
startTime
andendTime
are not sent, the most recent data is returned. - If the number of data between
startTime
andendTime
is larger thanlimit
, return asstartTime
+limit
. - In ascending order.
Ticker24hr
24 hour rolling window price change statistics for a single symbol.
Ticker24hrAll
24 hour rolling window price change statistics for all symbols.
PriceTicker
Latest price for a single symbol.
PriceTickerAll
Latest price for all symbols.
OrderBookTicker
Best price/qty on the order book for a single symbol.
OrderBookTickerAll
Best price/qty on the order book for all symbols.
OpenInterest
Get present open interest of a specific symbol.
OpenInterestStatistics
Get open interest history of a specific symbol.
- If
startTime
andendTime
are not sent, the most recent data is returned. - Only the data of the latest 30 days is available.
TopLongShortAccountRatio
Get top traders’ accounts Long
/Short
ratio.
- If
startTime
andendTime
are not sent, the most recent data is returned. - Only the data of the latest 30 days is available.
TopLongShortPositionRatio
Get top traders’ positions Long
/Short
ratio.
- If
startTime
andendTime
are not sent, the most recent data is returned. - Only the data of the latest 30 days is available.
GlobalLongShortAccountRatio
Get all traders’ accounts Long
/Short
ratio.
- If
startTime
andendTime
are not sent, the most recent data is returned. - Only the data of the latest 30 days is available.
TakerBuySellVolume
Taker Buy
/Sell
Volume ratio.
- If
startTime
andendTime
are not sent, the most recent data is returned. - Only the data of the latest 30 days is available.
HistoricalLvtKLines
Historical BLVT NAV Kline/Candlestick.
The BLVT NAV system is based on Binance Futures.
CompositeIndexSymbolInfo
Composite Index Symbol Information.
- Only for composite index symbols.
MultiAssetsIndex
Asset index for Multi-Assets mode for a single symbol.
MultiAssetsIndexAll
Asset index for Multi-Assets mode for all symbols.
GetPositionMode
Get user’s position mode (Hedge Mode or One-way Mode) on every symbol.
ChangePositionMode
Change user’s position mode (Hedge Mode or One-way Mode) on every symbol.
GetMultiAssetsMode
Get user’s Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on every symbol.
ChangeMultiAssetsMode
Change user’s Multi-Assets mode (Multi-Assets Mode or Single-Asset Mode) on every symbol.
NewOrder
Send in a new order.
See detailed documentation at https://binance-docs.github.io/apidocs/futures/en/#new-order-trade
GetOrder
Check an order’s status.
-
These orders will not be found:
- order status is
CANCELED
orEXPIRED
, AND - order has NO filled trade, AND
created time
+ 7 days <current time
- order status is
-
Either
orderId
ororigClientOrderId
must be sent.
GetOpenOrder
Query currently opened order.
- Either
orderId
ororigClientOrderId
must be sent. - If the queried order has been filled or cancelled, the error message “Order does not exist” will be returned.
CancelOrder
Cancel an active order.
- Either
orderId
ororigClientOrderId
must be sent.
NewOrders
Place multiple orders.
- Maximum number of orders is 5.
- The orders are passed as JSON list in the same format as in NewOrder.
CancelOrders
Cancel multiple orders.
- Maximum number of orders is 10.
- Either
orderIdList
ororigClientOrderIdList
must be sent.
GetOpenOrders
Get all open orders on a single symbol.
GetOpenOrdersAllSymbols
Get all open orders for all symbols. Careful when accessing this as it has too much weight.
CancelOpenOrders
Cancels all active orders on a symbol.
AutoCancelOpenOrders
Cancel all open orders of the specified symbol at the end of the specified countdown.
- The endpoint should be called repeatedly as heartbeats so that the existing countdown time can be canceled and replaced by a new one.
- The system will check all countdowns approximately every 10 milliseconds, so please note that sufficient redundancy should be considered when using this function. We do not recommend setting the countdown time to be too precise or too small.
§Example usage:
- Call this endpoint at 30s intervals with
countdownTime
of 120_000 (120s). - If this endpoint is not called within 120 seconds, all your orders of the specified symbol will be automatically canceled.
- If this endpoint is called with
countdownTime
of 0, the countdown timer will be stopped.
GetAllOrders
Get all account orders; active, canceled, or filled.
- These orders will not be found:
- order status is
CANCELED
orEXPIRED
, AND - order has NO filled trade, AND
created time
+ 7 days <current time
- order status is
- If
orderId
is set, it will get orders >= thatorderId
. Otherwise most recent orders are returned. - The query time period must be less then 7 days (default is the recent 7 days).
AccountBalance
Get account balance.
AccountInformation
Get current account information. User in single-asset/multi-assets mode will see different value, see comments in response section for detail.
ChangeInitialLeverage
Change user’s initial leverage of specific symbol market.
ChangeMarginType
Change margin type for a specific symbol market.
ModifyIsolatedPositionMargin
Modify isolated position margin for a specific symbol market.
- Only for isolated symbol.
GetPositionMarginHistory
Get position margin change history.
PositionInformation
Get current position information.
Note: Please use with user data stream ACCOUNT_UPDATE
to meet your timeliness and accuracy needs.
AccountTrades
Get trades for a specific account and symbol.
- If
startTime
andendTime
are both not sent, then the last 7 days’ data will be returned. - The time between
startTime
andendTime
cannot be longer than 7 days. - The parameter
fromId
cannot be sent withstartTime
orendTime
.
GetIncomeHistory
Get income history.
- If neither
startTime
norendTime
is sent, then the recent 7 days’ data will be returned. - If
incomeType
is not sent, all kinds of flow will be returned. trandId
is unique in the sameincomeType
for a user.- Income history only contains data for the last three months.
GetNotionalLeverageBrackets
Get notional and leverage brackets.
PositionAdlQuantileEstimation
Get positions’ ADL quantile estimation.
- Values update every 30s.
- Values 0, 1, 2, 3, 4 shows the queue position and possibility of ADL from low to high.
- For positions of the symbol are in One-way Mode or isolated margined in Hedge Mode, “LONG”, “SHORT”, and “BOTH” will be returned to show the positions’ ADL quantiles of different position sides.
- If the positions of the symbol are crossed margined in Hedge Mode:
- “HEDGE” as a sign will be returned instead of “BOTH”;
- A same value calculated on unrealized PnL-s on Long and Short sides’ positions will be shown for “LONG” and “SHORT” when there are positions in both of Long and Short sides.
GetForceOrders
Get user’s force orders for a single symbol.
- If
autoCloseType
is not sent, orders with both of the types will be returned. - If
startTime
is not sent, data within 7 days beforeendTime
can be queried.
GetForceOrdersAll
Get user’s force orders for all symbols.
- If
autoCloseType
is not sent, orders with both of the types will be returned. - If
startTime
is not sent, data within 7 days beforeendTime
can be queried.
QuantitativeRulesIndicators
Get quantitative rules indicators for a single symbol.
For more information on this, please refer to the Futures Trading Quantitative Rules.
QuantitativeRulesIndicatorsAll
Get quantitative rules indicators for all symbols.
For more information on this, please refer to the Futures Trading Quantitative Rules.
GetCommissionRate
Get user’s commission rate.
GetDownloadIdTransactionHistory
Get download ID for futures transaction history.
Request limitation is 5 times per month, shared by front end download page and Rest API.
GetTransactionHistoryById
Get futures transaction history download link by ID received by GetDownloadIdTransactionHistory.
Download link expiration: 24h.
StartUserDataStream
Start a new user data stream. The stream will close after 60 minutes
unless a keepalive is sent. If the account has an active listenKey
,
that listenKey
will be returned and its validity will be extended for 60 minutes.
KeepAliveUserDataStream
Keepalive a user data stream to prevent a time out. User data streams will close after 60 minutes. It’s recommended to send a ping about every 30 minutes.
CloseUserDataStream
Close out a user data stream.
GetPortfolioMargin
Get current portfolio margin exchange trading rules.
For more information on this, please refer to the FAQ.