Hello, I encountered some problems when using the api fapi/v1/userTrades
. After some investigation, I found out that the root cause is that the behavior of the parameter startTime
is very strange. Intuitively, I think it should return the first limit
trades of the symbol after startTime
. Or according to the api doc, it may return the most recent limit
trades after startTime
since fromId
is not provided. But it does neither. For example, I have exactly 597 trades of BTCUSDT after the start time 1614556800000 (which is 2021/03/01), but the query in case A only returns 102 results. Moreover, if I move forward the start time to 1609459200000 (which is 2021/01/01) as in case B, the query returns no result at all. Does anyone know the logic of the startTime
parameter, or does the api has bugs?
A.
GET https://fapi.binance.com/fapi/v1/userTrades
query_params: {
"symbol": "BTCUSDT",
"startTime": "1614556800000",
"limit": "1000",
"timestamp": "...",
"signature": "..."
}
gives me 102 results.
B.
GET https://fapi.binance.com/fapi/v1/userTrades
query_params: {
"symbol": "BTCUSDT",
"startTime": "1609459200000",
"limit": "1000",
"timestamp": "...",
"signature": "..."
}
gives me 0 result.
C.
GET https://fapi.binance.com/fapi/v1/userTrades
query_params: {
"symbol": "BTCUSDT",
"fromId": "552245922",
"limit": "1000",
"timestamp": "...",
"signature": "..."
}
gives me 597 result (which is expected), where the fromId
552245922 is the id of the first trade returned by case A.