Contract

Public

Security: None

Endpoints under Public section can be accessed freely without requiring any API-key or signatures

Test Connectivity

GET https://futuresopenapi.xxx.xx/fapi/v1/ping

This endpoint checks connectivity to the host

{}

Check Server Time

GET https://futuresopenapi.xxx.xx/fapi/v1/time

{
    "serverTime":1607702400000,
    "timezone":Chinese standard time
}

Response:

Contract List

GET https://futuresopenapi.xxx.xx/fapi/v1/contracts

[
    {
        "symbol": "H-HT-USDT",
        "pricePrecision": 8,
        "side": 1,
        "maxMarketVolume": 100000,
        "multiplier": 6,
        "minOrderVolume": 1,
        "maxMarketMoney": 10000000,
        "type": "H",
        "maxLimitVolume": 1000000,
        "maxValidOrder": 20,
        "multiplierCoin": "HT",
        "minOrderMoney": 0.001,
        "maxLimitMoney": 1000000,
        "status": 1
    }
]

Response:

Market

Security: None

Market section can be accessed freely without requiring any API-key or signatures.

Depth

GET https://futuresopenapi.xxx.xx/fapi/v1/depth

Market depth data

Query Parameters

{
  "bids": [
    [
      "3.90000000",   // price
      "431.00000000"  // quantity
    ],
    [
      "4.00000000",
      "431.00000000"
    ]
  ],
  "asks": [
    [
      "4.00000200",  // price
      "12.00000000"  // quantity
    ],
    [
      "5.10000000",
      "28.00000000"
    ]
  ]
}

Response:

The fields bids and asks are lists of order book price level entries, sorted from best to worst.

24hrs ticker

GET https://futuersopenapi.xxx.xx/fapi/v1/ticker

24 hour price change statistics

Query Parameters

{
    "high": "9279.0301",
    "vol": "1302",
    "last": "9200",
    "low": "9279.0301",
    "rose": "0",
    "time": 1595563624731
}

Response:

Get index/marked price

GET https://futuersopenapi.xxx.xx/fapi/v1/index

Query Parameters

{
    "markPrice": 581.5,
    "indexPrice": 646.3933333333333,
    "lastFundingRate": 0.001,
    "contractName": "E-ETH-USDT",
    "time": 1608273554063
}

Response:

Kline/charts data

GET https://futuresopenapi.xxx.xx/fapi/v1/klines

Query Parameters

[
    {
        "high": "6228.77",
        "vol": "111",
        "low": "6228.77",
        "idx": 1594640340,
        "close": "6228.77",
        "open": "6228.77"
    },
    {
        "high": "6228.77",
        "vol": "222",
        "low": "6228.77",
        "idx": 1587632160,
        "close": "6228.77",
        "open": "6228.77"
    },
    {
        "high": "6228.77",
        "vol": "333",
        "low": "6228.77",
        "idx": 1587632100,
        "close": "6228.77",
        "open": "6228.77"
    }
]

Response:

Trading

Security: TRADE

All interfaces under the transaction require signature and API-key verification​

Order creation

POST https://futuresopenapi.xxx.xx/fapi/v1/order

Creation of single new orders

Headers

Request Body

{
    "orderId": 256609229205684228
}

Response:

Condition order creation

POST https://futuresopenapi.xxx.xx/fapi/v1/conditionOrder

Headers

Request Body

{
     "orderId": 256609229205684228
}

Cancel order

POST https://futuresopenapi.xxx.xx/fapi/v1/cancel

Speed limit rules: 20 times/ 2 seconds

Headers

Request Body

{
    "orderId": 256609229205684228
}

Order details

GET https://futuresopenapi.xxx.xx/fapi/v1/order

Request Body

[
    {
       "side": "BUY",
       "executedQty": 0,
       "orderId": 259396989397942275,
       "price": 10000.0000000000000000,
       "origQty": 1.0000000000000000,
       "avgPrice": 0E-8,
       "transactTime": "1607702400000",
       "action": "OPEN",
       "contractName": "E-BTC-USDT",
       "type": "LIMIT",
       "status": "INIT"
    }
]

Response:

Open order

GET https://futuresopenapi.xxx.xx/fapi/v1/openOrders

Speed limit rules: Obtain open contract, the user's current order

Query Parameters

Headers

[
    {
       "side": "BUY",
       "executedQty": 0,
       "orderId": 259396989397942275,
       "price": 10000.0000000000000000,
       "origQty": 1.0000000000000000,
       "avgPrice": 0E-8,
       "transactTime": "1607702400000",
       "action": "OPEN",
       "contractName": "E-BTC-USDT",
       "type": "LIMIT",
       "status": "INIT"
    }
]

Response:

order history

POST https://futuresopenapi.xxx.xx/fapi/v1/orderHistorical

Headers

Request Body

[
    {
        "side":"BUY",
        "clientId":"0",
        "ctimeMs":1632903411000,
        "positionType":2,
        "orderId":777293886968070157,
        "avgPrice":41000,
        "openOrClose":"OPEN",
        "leverageLevel":26,
        "type":4,
        "closeTakerFeeRate":0.00065,
        "volume":2,
        "openMakerFeeRate":0.00025,
        "dealVolume":1,
        "price":41000,
        "closeMakerFeeRate":0.00025,
        "contractId":1,
        "ctime":"2021-09-29T16:16:51",
        "contractName":"E-BTC-USDT",
        "openTakerFeeRate":0.00065,
        "dealMoney":4.1,
        "status":4
    }
]

profit history

POST https://futuresopenapi.xxx.xx/fapi/v1/profitHistorical

Headers

Request Body

[
    {
        "side":"SELL",
        "positionType":2,
        "tradeFee":-5.23575,
        "realizedAmount":0,
        "leverageLevel":26,
        "openPrice":44500,
        "settleProfit":0,
        "mtime":1632882739000,
        "shareAmount":0,
        "openEndPrice":44500,
        "closeProfit":-45,
        "volume":900,
        "contractId":1,
        "historyRealizedAmount":-50.23575,
        "ctime":1632882691000,
        "id":8764,
        "capitalFee":0
    }
]

Order record

GET https://futuresopenapi.xxx.xx/fapi/v1/myTrades

Query Parameters

Headers

[
  {
    "symbol": "ETHBTC",
    "id": 100211,
    "bidId": 150695552109032492,
    "askId": 150695552109032493,
    "price": "4.00000100",
    "qty": "12.00000000",
    "time": 1499865549590,
    "isBuyer": true,
    "isMaker": false,
    "fee":"0.001"
  },...
]

Response:

Account

Security: USER_DATA

All interfaces under the account require signature and API-key verification​

Account info

GET https://futuresopenapi.xxx.com /fapi/v1/account

Headers

{
    "account": [
        {
            "marginCoin": "USDT",
            "accountNormal": 999.5606,
            "accountLock": 23799.5017,
            "partPositionNormal": 9110.7294,
            "totalPositionNormal": 0,
            "achievedAmount": 4156.5072,
            "unrealizedAmount": 650.6385,
            "totalMarginRate": 0,
            "totalEquity": 99964804.560,
            "partEquity": 13917.8753,
            "totalCost": 0,
            "sumMarginRate": 873.4608,
            "positionVos": [
                {
                    "contractId": 1,
                    "contractName": "E-BTC-USDT",
                    "contractSymbol": "BTC-USDT",
                    "positions": [
                        {
                            "id": 13603,
                            "uid": 10023,
                            "contractId": 1,
                            "positionType": 2,
                            "side": "BUY",
                            "volume": 69642.0,
                            "openPrice": 11840.2394,
                            "avgPrice": 11840.3095,
                            "closePrice": 12155.3005,
                            "leverageLevel": 24,
                            "holdAmount": 7014.2111,
                            "closeVolume": 40502.0,
                            "pendingCloseVolume": 0,
                            "realizedAmount": 8115.9125,
                            "historyRealizedAmount": 1865.3985,
                            "tradeFee": -432.0072,
                            "capitalFee": 2891.2281,
                            "closeProfit": 8117.6903,
                            "shareAmount": 0.1112,
                            "freezeLock": 0,
                            "status": 1,
                            "ctime": "2020-12-11T17:42:10",
                            "mtime": "2020-12-18T20:35:43",
                            "brokerId": 21,
                            "marginRate": 0.2097,
                            "reducePrice": 9740.8083,
                            "returnRate": 0.3086,
                            "unRealizedAmount": 2164.5289,
                            "openRealizedAmount": 2165.0173,
                            "positionBalance": 82458.2839,
                            "settleProfit": 0.4883,
                            "indexPrice": 12151.1175,
                            "keepRate": 0.005,
                            "maxFeeRate": 0.0025
                        }
                    ]
                }
            ]
        }
    ]
}

Response:

account field:

positionVos field:

positions field:

Last updated