HTX Get Trade History
htx_get_trade_historyRetrieve executed-fill history for a spot or swap instrument to reconcile orders, calculate realized entry/exit prices and fees, or review execution quality. Use an order ID or page through time-bounded trade fills.
Instructions
Return compact executed-fill history for one instrument, not order history.
Traders normally review fills to reconcile an order, calculate realized
entry/exit prices and fees, or inspect recent execution quality. Provide
order_id for reconciliation; otherwise use a bounded time window and
cursor to page a recent instrument history. The exchange retention window
is 48 hours for spot and legacy swaps, and three days for v5 swaps.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum normalized fills to return (1-100). | |
| cursor | No | Opaque cursor from the previous result. Omit on the first page. | |
| product | Yes | HTX product family: spot or USDT-margined perpetual swap. | |
| end_time | No | Optional inclusive millisecond end time for a paged history query. | |
| order_id | No | Optional exchange order ID. When supplied, return fills for that order rather than a paged instrument history. | |
| direction | No | Page direction: prev returns older records and next advances from a cursor. | prev |
| instrument | Yes | Spot symbol such as 'btcusdt' or swap contract such as 'BTC-USDT'. | |
| start_time | No | Optional inclusive millisecond start time for a paged history query. | |
| include_raw | No | When true, include the original HTX envelopes in addition to compact normalized data. | |
| margin_mode | No | Swap margin mode: isolated or cross. | isolated |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||