Skip to main content
Version: Next

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

ParameterTypeRequiredDescription
symbolstringNoTrading pair, e.g. AAPL; omit to return all symbols
orderIdstringNoOrder ID; if provided, returns trade details for that order only
startTimeint64NoStart time (millisecond timestamp)
endTimeint64NoEnd time (millisecond timestamp)
lastIdint64NoCursor for pagination: omit (or pass 0) for the first page; pass the nextId from the previous response for subsequent pages
sizeintNoPage size, default 20, max 100

Request Example

GET /api/v1/stock/open-api/trades?symbol=AAPL&size=20

Response Fields

FieldTypeDescription
codeintStatus code
msgstringStatus message
data.tradesarrayList of trade records
data.trades[].tradeIdstringTrade ID
data.trades[].orderIdstringOrder ID
data.trades[].symbolstringTrading pair
data.trades[].sidestringDirection: buy or sell
data.trades[].pricestringTrade price
data.trades[].quantitystringTrade quantity (shares)
data.trades[].amountstringTrade amount
data.trades[].feestringTrading fee
data.trades[].feeCurrencystringFee currency
data.trades[].rolestringRole: maker or taker
data.trades[].createdAtint64Trade time (millisecond timestamp)
data.hasMoreboolWhether more data exists
data.nextIdint64Cursor for the next page; 0 when hasMore is false
Pagination
  • Omit lastId on the first request
  • When hasMore: true, pass nextId as lastId in 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
}
}