getOrderHistory
Retrieve historical orders from Bybit with filters for category, symbol, and time range. Order data may lag; for real-time, use the open order endpoint or WebSocket stream.
Instructions
Query order history. As order creation/cancellation is asynchronous, the data returned from this endpoint may delay. To get real-time order information, you could query the open order endpoint or rely on the websocket stream (recommended).
Unified account covers: Spot / USDT perpetual / USDC contract / Inverse contract / Options
Classic account covers: Spot / USDT perpetual / Inverse contract
Rules:
Last 7 days: supports querying all closed statuses except "Cancelled", "Rejected", "Deactivated"
Last 24 hours: supports querying "Cancelled", "Rejected", "Deactivated" orders
Beyond 7 days: only supports querying orders with final filled statuses (Filled, PartiallyFilledCanceled)
Time range rules:
Without both
startTimeandendTime: returns last 7 days by defaultOnly
startTimeprovided: returns from startTime to startTime + 7 daysOnly
endTimeprovided: returns from endTime - 7 days to endTimeBoth provided: endTime - startTime must be ≤ 7 days
Agent hint: TradFi: use category=spot for xStock order history, category=linear for equity/commodity perpetual order history.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| cursor | No | ||
| symbol | No | ||
| endTime | No | ||
| orderId | No | ||
| baseCoin | No | ||
| category | Yes | ||
| startTime | No | ||
| settleCoin | No | ||
| orderFilter | No | Order | |
| orderLinkId | No | ||
| orderStatus | No |