Trade Details
Query the account's historical trade records, with optional filters by symbol, order, or time range. Uses cursor-based pagination.
Interface Information
- Method:
GET - Path:
/api/v1/stock/open-api/trades
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbol | string | No | Trading pair, e.g. AAPL; omit to return all symbols |
| orderId | string | No | Order ID; if provided, returns trade details for that order only |
| startTime | int64 | No | Start time (millisecond timestamp) |
| endTime | int64 | No | End time (millisecond timestamp) |
| lastId | int64 | No | Cursor for pagination: omit (or pass 0) for the first page; pass the nextId from the previous response for subsequent pages |
| size | int | No | Page size, default 20, max 100 |
Request Example
GET /api/v1/stock/open-api/trades?symbol=AAPL&size=20
Response Fields
| Field | Type | Description |
|---|---|---|
| code | int | Status code |
| msg | string | Status message |
| data.trades | array | List of trade records |
| data.trades[].tradeId | string | Trade ID |
| data.trades[].orderId | string | Order ID |
| data.trades[].symbol | string | Trading pair |
| data.trades[].side | string | Direction: buy or sell |
| data.trades[].price | string | Trade price |
| data.trades[].quantity | string | Trade quantity (shares) |
| data.trades[].amount | string | Trade amount |
| data.trades[].fee | string | Trading fee |
| data.trades[].feeCurrency | string | Fee currency |
| data.trades[].role | string | Role: maker or taker |
| data.trades[].createdAt | int64 | Trade time (millisecond timestamp) |
| data.hasMore | bool | Whether more data exists |
| data.nextId | int64 | Cursor for the next page; 0 when hasMore is false |
Pagination
- Omit
lastIdon the first request - When
hasMore: true, passnextIdaslastIdin the next request - When
hasMore: false, all data has been retrieved
Response Example
{
"code": 0,
"msg": "success",
"data": {
"trades": [
{
"tradeId": "987654321",
"orderId": "123456789",
"symbol": "AAPL",
"side": "buy",
"price": "185.50",
"quantity": "500",
"amount": "92750.00",
"fee": "9.28",
"feeCurrency": "USDT",
"role": "taker",
"createdAt": 1720000000000
}
],
"hasMore": true,
"nextId": 99001
}
}