Skip to content

Get History Orders

Rate Limit: 10 req/sec/uid

Description

get history orders, sort by create time desc

HTTP Request

  • GET /api/v1/futures/trade/get_history_orders

Request Parameters

ParameterTypeRequiredDescription
symbolstringfalseTrading pair
orderIdstringfalseorder id
clientIdstringfalseclient id
statusstringfalseOrder status
FILLED CANCELEDPART_FILLED_CANCELEDEXPIRED
typestringfalseOrder type
LIMIT
MARKET default all
startTimeint64falseStart timestamp
Unix timestamp in milliseconds format, e.g. 1597026383085
endTimeint64falseStart timestamp
Unix timestamp in milliseconds format, e.g. 1597026683085
skipint64falseskip order count default: 0
limitint64falseNumber of queries: Maximum: 100, default: 10

Request Example

bash
curl -X 'GET'  --location 'https://fapi.bitunix.com/api/v1/futures/trade/get_history_orders?symbol=BTCUSDT' \
   -H "api-key:*******" \
   -H "sign:*" \
   -H "time:1659076670000" \
   -H "language:en-US" \
   -H "Content-Type: application/json"

Response Parameters

ParameterTypeDescription
orderListlistorder list
>orderIdstringorder id
>symbolstringTrading pair
>qtystringAmount (base coin)
>tradeQtystringFill amount (base coin)
>positionModestringONE_WAY or HEDGE
>marginModestringISOLATION or CROSS
>leverageintleverage
>pricestringPrice of the order.
Required if the order type is LIMIT
>sidestringOrder direction
buy: BUY
sell: SELL
>orderTypestringOrder type
LIMIT: limit orders
MARKET: market orders
>effectstringOrder expiration date.
Required if the orderType is limit
IOC: Immediate or cancel
FOK: Fill or kill
GTC: Good till canceled(default value)
POST_ONLY: POST only
>clientIdstringCustomize order ID
>reduceOnlybooleanWhether or not to just reduce the position
>statusstringINIT:prepare status
NEW:pending
PART_FILLED:partially filled
CANCELED:canceled
FILLEDAll filled
>feestringfee
>realizedPNLstringrealized pnl
>tpPricestringtake profit trigger price
>tpStopTypestringtake profit trigger type
MARK_PRICE
LAST_PRICE
>tpOrderTypestringtake profit trigger place order type
LIMIT
MARKET
>tpOrderPricestringtake profit trigger place order price
LIMIT
MARKET
required if tpOrderType is LIMIT
>slPricestringstop loss trigger price
>slStopTypestringstop loss trigger type
MARK_PRICE
LAST_PRICE
>slOrderTypestringstop loss trigger place order type
LIMIT
MARKET
>slOrderPricestringstop loss trigger place order price
LIMIT
MARKET
required if slOrderType is LIMIT
>ctimeint64create timestamp
>mtimeint64latest modify timestamp
totalint64total count

Response Example

json
{"code":0,"data":{"orderList":[{"orderId":"11111","qty":"1","tradeQty":"0.5","price":"60000","symbol":"BTCUSDT","positionMode":"HEDGE","marginMode":"ISOLATION","leverage":15,"status":"CANCELED","fee":"0.01","realizedPNL":"1.78","type":"LIMIT","effect":"GTC","reduceOnly":false,"clientId":"22222","tpPrice":"61000","tpStopType":"MARK","tpOrderType":"LIMIT","tpOrderPrice":"61000.1","slPrice":"59000","slStopType":"MARK","slOrderType":"LIMIT","slOrderPrice":"59000.1","source":"api","ctime":1597026383085,"mtime":1597026383085}],"total":10},"msg":"Success"}