Documentation Index
Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/binance/llms.txt
Use this file to discover all available pages before exploring further.
USDMClient is the dedicated REST client for Binance’s USD-M Futures market. It connects to the fapi*.binance.com subdomains and exposes typed methods for perpetual and delivery futures contracts settled in USDT or BUSD. Whether you need to query mark prices and funding rates, manage leveraged positions, place complex multi-leg orders, or retrieve income history, USDMClient provides a complete interface to the USD-M Futures REST API.
Installation
Constructor Options
Your Binance API key. Required for all authenticated (private) endpoints.
Your Binance API secret. Supports HMAC, RSA, and Ed25519 — key type is detected automatically.
When
true, numeric strings in responses are parsed to JavaScript numbers for well-known fields.Routes requests to
https://testnet.binancefuture.com (fapi testnet). The testnet uses simulated market data — not recommended for strategy validation.Routes requests to Binance’s USD-M Futures Demo Trading environment. Uses real market data with simulated order execution — the preferred option for testing trading strategies.
Base URL
| Mode | Base URL |
|---|---|
| Production | https://fapi.binance.com |
| Testnet | https://testnet.binancefuture.com |
| Demo Trading | https://testnet.binancefuture.com (demo flag applied) |
Method Categories
Market Data
Public endpoints — no API key required.| Method | Endpoint | Description |
|---|---|---|
testConnectivity() | GET fapi/v1/ping | Test REST API connectivity |
getExchangeInfo() | GET fapi/v1/exchangeInfo | Exchange rules, filters, and symbol info |
getOrderBook(params) | GET fapi/v1/depth | Order book for a symbol |
getRecentTrades(params) | GET fapi/v1/trades | Recent trades |
getAggregateTrades(params) | GET fapi/v1/aggTrades | Compressed aggregate trades |
getKlines(params) | GET fapi/v1/klines | Candlestick data |
getContinuousContractKlines(params) | GET fapi/v1/continuousKlines | Continuous contract klines |
getMarkPrice(params?) | GET fapi/v1/premiumIndex | Mark price and funding rate |
getFundingRateHistory(params?) | GET fapi/v1/fundingRate | Historical funding rates |
getFundingRates() | GET fapi/v1/fundingInfo | Current funding rates for all symbols |
get24hrChangeStatistics(params?) | GET fapi/v1/ticker/24hr | 24-hour rolling window price change |
getSymbolPriceTicker(params?) | GET fapi/v1/ticker/price | Latest price for symbol(s) |
getSymbolPriceTickerV2(params?) | GET fapi/v2/ticker/price | Latest price (v2) |
getSymbolOrderBookTicker(params?) | GET fapi/v1/ticker/bookTicker | Best bid/ask price and quantity |
getOpenInterest(params) | GET fapi/v1/openInterest | Current open interest |
getOpenInterestStatistics(params) | GET futures/data/openInterestHist | Historical open interest |
getTopTradersLongShortPositionRatio(params) | GET futures/data/topLongShortPositionRatio | Top trader position ratio |
getGlobalLongShortAccountRatio(params) | GET futures/data/globalLongShortAccountRatio | Global long/short ratio |
getTakerBuySellVolume(params) | GET futures/data/takerlongshortRatio | Taker buy/sell volume ratio |
getBasis(params) | GET futures/data/basis | Basis data for a contract |
Order Management
Authenticated endpoints — requireapi_key and api_secret.
| Method | Endpoint | Description |
|---|---|---|
submitNewOrder(params) | POST fapi/v1/order | Place a new futures order |
submitMultipleOrders(orders) | POST fapi/v1/batchOrders | Place up to 5 orders in a single request |
modifyOrder(params) | PUT fapi/v1/order | Modify an existing LIMIT order |
modifyMultipleOrders(orders) | PUT fapi/v1/batchOrders | Modify up to 5 orders in one request |
cancelOrder(params) | DELETE fapi/v1/order | Cancel an active order |
cancelMultipleOrders(params) | DELETE fapi/v1/batchOrders | Cancel multiple orders |
cancelAllOpenOrders(params) | DELETE fapi/v1/allOpenOrders | Cancel all open orders for a symbol |
setCancelOrdersOnTimeout(params) | POST fapi/v1/countdownCancelAll | Auto-cancel orders after a timeout |
getOrder(params) | GET fapi/v1/order | Query a specific order |
getAllOrders(params) | GET fapi/v1/allOrders | All orders for a symbol |
getAllOpenOrders(params?) | GET fapi/v1/openOrders | All open orders |
getCurrentOpenOrder(params) | GET fapi/v1/openOrder | A specific open order |
getOrderModifyHistory(params) | GET fapi/v1/orderAmendment | Order modification history |
testOrder(params) | POST fapi/v1/order/test | Test order without execution |
Position Management
| Method | Endpoint | Description |
|---|---|---|
getPositionsV3(params?) | GET fapi/v3/positionRisk | Current positions (recommended) |
getPositions(params?) | GET fapi/v2/positionRisk | Current positions (v2, deprecated) |
setLeverage(params) | POST fapi/v1/leverage | Set leverage for a symbol |
setMarginType(params) | POST fapi/v1/marginType | Switch between ISOLATED/CROSSED margin |
setIsolatedPositionMargin(params) | POST fapi/v1/positionMargin | Adjust isolated position margin |
setPositionMode(params) | POST fapi/v1/positionSide/dual | Toggle one-way / hedge mode |
getCurrentPositionMode() | GET fapi/v1/positionSide/dual | Query current position mode |
getPositionMarginChangeHistory(params) | GET fapi/v1/positionMargin/history | Margin change history |
getADLQuantileEstimation(params?) | GET fapi/v1/adlQuantile | ADL quantile estimation |
getNotionalAndLeverageBrackets(params?) | GET fapi/v1/leverageBracket | Leverage brackets per symbol |
Account
| Method | Endpoint | Description |
|---|---|---|
getAccountInformationV3() | GET fapi/v3/account | Full account information (recommended) |
getAccountInformation() | GET fapi/v2/account | Account information (v2, deprecated) |
getBalanceV3() | GET fapi/v3/balance | Account balance per asset (recommended) |
getBalance() | GET fapi/v2/balance | Account balance (v2, deprecated) |
getAccountTrades(params) | GET fapi/v1/userTrades | Trade history for a symbol |
getIncomeHistory(params?) | GET fapi/v1/income | Income history (funding, realised P&L, etc.) |
getAccountCommissionRate(params) | GET fapi/v1/commissionRate | Commission rates for a symbol |
getFuturesAccountConfig() | GET fapi/v1/accountConfig | Account-level configuration |
getMultiAssetsMode() | GET fapi/v1/multiAssetsMargin | Multi-assets margin mode status |
setMultiAssetsMode(params) | POST fapi/v1/multiAssetsMargin | Enable/disable multi-assets margin mode |
Algo Orders
| Method | Endpoint | Description |
|---|---|---|
submitNewAlgoOrder(params) | POST fapi/v1/algoOrder | Place a futures algo order (TWAP/VP) |
cancelAlgoOrder(params) | DELETE fapi/v1/algoOrder | Cancel a running algo order |
cancelAllAlgoOpenOrders(params) | DELETE fapi/v1/algoOpenOrders | Cancel all open algo orders for a symbol |
getAlgoOrder(params) | GET fapi/v1/algoOrder | Query a specific algo order |
getOpenAlgoOrders(params?) | GET fapi/v1/openAlgoOrders | All open algo orders |
getAllAlgoOrders(params) | GET fapi/v1/allAlgoOrders | Full algo order history |
Code Examples
Testing Environments
- Demo Trading
- Testnet
Demo Trading uses live market data with simulated order fills. It is the recommended environment for testing strategies.Create a Demo Trading account at Binance Demo Trading.
Full Endpoint Map
A complete reference of everyUSDMClient method, its authentication requirement, HTTP method, and target endpoint:
REST Endpoint Function List →