getOrderHistory
Retrieve historical order records including completed, cancelled, or expired orders. Supports up to 2 years of data with filters for time range, order type, and status.
Instructions
Query historical order records. Supports up to 2 years of data.
Max time span between
startTimeandendTimeis 7 daysIf both time params omitted, returns last 7 days
Pagination via
cursortokenUse
orderFilterto target specific order typesUse
orderStatusto filter by terminal status
Agent hint: Use this endpoint to query completed/cancelled/expired orders. For currently active orders, use getOpenOrders instead. 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 | ||
| orderLinkId | No | ||
| orderStatus | No |