Skip to main content

Order History

info
  • If startTime and endTime are both not specified, it returns last 7 days records by default.
  • Supports fetching 3 months worth of data per request. Returns data up to 6 months old.
  • Market maker can only get recent 3 days orders.
  • Cancelled, Rejected, Deactivated orders save up to 7 days

HTTP Request

GET /spot/v3/private/history-orders

Request Parameters

ParameterRequiredTypeComments
symbolfalsestringName of the trading pair
orderIdfalsestringSpecify orderId to return all the orders that orderId of which are smaller than this particular one for pagination purpose
limitfalseintegerLimit for data size. [1, 500]. Default: 100
startTimefalseintegerThe start timestamp (ms)
endTimefalseintegerThe end timestamp (ms)
orderCategoryfalseintegerOrder category. 0:normal order by default; 1TP/SL order, Required for TP/SL order.

Response Parameters

ParameterTypeComments
accountIdstringAccount ID
symbolstringName of the trading pair
orderLinkIdstringUser-generated order ID
orderIdstringOrder ID
orderPricestringLast traded price
orderQtystringOrder quantity
execQtystringExecuted quantity
cummulativeQuoteQtystringTotal order quantity
avgPricestringAverage filled price
statusstringOrder status
timeInForcestringTime in force
orderTypestringOrder type
sidestringSide. BUY, SELL
stopPricestringStop price
icebergQtystringPlease ignore
createTimenumberOrder created time in the match engine
updateTimenumberLast time order was updated
isWorkingstringIs working. 0:valid, 1:invalid
orderCategoryintegerOrder category. 0:normal order; 1:TP/SL order. TP/SL order has this field
triggerPricestringTrigger price. TP/SL order has this field
blockTradeIdstringParadigm block trade ID
cancelTypestringCancel type. CancelBySmp
smpTypestringSMP execution type
smpGroupintegerSmp group ID. If the uid has no group, it is 0 by default
smpOrderIdstringThe counterparty's orderID which triggers this SMP execution

Request Example

curl --location --request GET 'https://api-testnet.bybit.com/spot/v3/private/history-orders?symbol=BTCUSDT&limit=2&startTime=1658246400000&endTime=1659110400000' \
--header 'X-BAPI-SIGN: XXXXX' \
--header 'X-BAPI-API-KEY: {api key}' \
--header 'X-BAPI-TIMESTAMP: 1659082629976' \
--header 'X-BAPI-RECV-WINDOW: 5000'

Response Example

{
"retCode": 0,
"retMsg": "OK",
"result": {
"list": [
{
"accountId": "533287",
"symbol": "BTCUSDT",
"orderLinkId": "spotx003",
"orderId": "1210856408331857664",
"orderPrice": "23800",
"orderQty": "0.02",
"execQty": "0",
"cummulativeQuoteQty": "0",
"avgPrice": "0",
"status": "REJECTED",
"timeInForce": "GTC",
"orderType": "LIMIT_MAKER",
"side": "BUY",
"stopPrice": "0.0",
"icebergQty": "0.0",
"createTime": 1659081332185,
"updateTime": 1659081332225,
"isWorking": "1",
"blockTradeId": "",
"cancelType": "UNKNOWN"
"smpGroup": 0,
"smpOrderId": "",
"smpType": "None"
}
]
},
"retExtInfo": {},
"time": 1659082630638
}