Get user trades#
GET https://api.pro.anboto.xyz/api/v2/trading/userTrades
Either orderIds or clientOrderIds has to be provided for matching ApiKeyAuth required.
Query params#
The exchange —
BINANCE, HUOBI, GATEIO, KRAKEN, KUCOIN, OKX, BYBIT, BITGET, WOO, MEXC, BULLISH, B2C2, COINBASE_PRIME, COINBASE_INTL, … (17 values)subaccount stringSub-account
orderIds array[integer]The list of anboto generated order ids
clientOrderIds array[string]The list of client generated order ids
Headers#
| Header | ||
|---|---|---|
X-API-KEY |
string | required |
X-TIMESTAMP |
int64 ms | required |
X-SIGN |
string | required |
X-RECV-WINDOW |
int, default 5000 |
Responses#
| 200 | A list of matching trades. |
| 401 | Unauthorized: missing or unknown API key |
| 429 | Rate limit exceeded, retry later |
Response fields — TradeDetailsList#
The list of trade details
trades[].trade_id stringThe trade id assigned by the exchange, or the Anboto platform trade id when no exchange trade id was captured
trades[].symbol string requiredThe symbol of the fill in Anboto's symbology
trades[].exchange_order_id stringThe exchange order id of the child order the fill belongs to
trades[].client_order_id stringThe client order id of the child order the fill belongs to
trades[].quantity number requiredThe absolute amount filled by this trade, in base asset
trades[].price number requiredThe traded price
trades[].direction enumThe direction of the trade —
BUY, SELLtrades[].maker_or_taker enumWhether the fill was made as maker or taker —
MAKER, TAKERtrades[].exec_time integerThe execution time of the trade as ms since epoch
trades[].fee numberThe fee charged on the trade, in fee_currency
trades[].fee_currency stringThe asset the fee was charged in
trades[].parent_order_id integerThe Anboto id of the parent order the fill belongs to (the order_id of the enclosing order)
trades[].child_order_id integerThe Anboto id of the child (slice) order that executed on the exchange; the WebSocket trade topic carries it as order_id
curl -X GET "$BASE/api/v2/trading/userTrades?exchange=BINANCE" \
-H "X-API-KEY: $API_KEY" -H "X-TIMESTAMP: $ts" \
-H "X-SIGN: $sign"
params = {"exchange": ..., "subaccount": ..., "orderIds": ..., "clientOrderIds": ...}
r = requests.get(f"{BASE}/api/v2/trading/userTrades",
params=params
headers=signed_headers_query(params))
print(r.json())
let resp = client
.get(format!("{BASE}/api/v2/trading/userTrades?exchange=BINANCE"))
.headers(signed_headers_query(¶ms))
.send()?;
println!("{}", resp.text()?);
req, _ := http.NewRequest("GET", BASE+"/api/v2/trading/userTrades?exchange=BINANCE", nil)
for k, v := range signedHeadersQuery(req.URL.Query()) {
req.Header.Set(k, v)
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
io.Copy(os.Stdout, resp.Body)
HttpResponse<String> resp = client.send(
signedGet("/api/v2/trading/userTrades?exchange=BINANCE"),
HttpResponse.BodyHandlers.ofString());
const res = await fetch(`${BASE}/api/v2/trading/userTrades?exchange=BINANCE`, {
method: "GET",
headers: signedHeadersQuery(params),
});
const data: TradeDetailsList = await res.json();
val request = signedGet("/api/v2/trading/userTrades?exchange=BINANCE")
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
println(response.body())
cpr::Response r = cpr::Get(
cpr::Url{BASE + "/api/v2/trading/userTrades?exchange=BINANCE"},
signedHeadersQuery(params));
std::cout << r.text << std::endl;
const res = await fetch(`${BASE}/api/v2/trading/userTrades?exchange=BINANCE`, {
method: "GET",
headers: signedHeadersQuery(params),
});
console.log(await res.json());
Response 200
{
"trades": [
{
"trade_id": "1204004183",
"symbol": "BTC/USDT:USDT",
"exchange_order_id": "151990408",
"client_order_id": "string",
"quantity": 0.5,
"price": 92.91,
"direction": "BUY",
"maker_or_taker": "MAKER",
"exec_time": 1758276000000,
"fee": 0.0021,
"fee_currency": "USDT",
"parent_order_id": 596990285759373312,
"child_order_id": 596990290020118528
}
]
}