Skip to content

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#

exchange enum required
The exchange — BINANCE, HUOBI, GATEIO, KRAKEN, KUCOIN, OKX, BYBIT, BITGET, WOO, MEXC, BULLISH, B2C2, COINBASE_PRIME, COINBASE_INTL, … (17 values)
subaccount string
Sub-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#

trades array[TradeDetails] required
The list of trade details
trades[].trade_id string
The trade id assigned by the exchange, or the Anboto platform trade id when no exchange trade id was captured
Example: 1204004183
trades[].symbol string required
The symbol of the fill in Anboto's symbology
Example: BTC/USDT:USDT
trades[].exchange_order_id string
The exchange order id of the child order the fill belongs to
Example: 151990408
trades[].client_order_id string
The client order id of the child order the fill belongs to
trades[].quantity number required
The absolute amount filled by this trade, in base asset
Example: 0.5
trades[].price number required
The traded price
Example: 92.91
trades[].direction enum
The direction of the trade — BUY, SELL
Example: BUY
trades[].maker_or_taker enum
Whether the fill was made as maker or taker — MAKER, TAKER
Example: MAKER
trades[].exec_time integer
The execution time of the trade as ms since epoch
Example: 1758276000000
trades[].fee number
The fee charged on the trade, in fee_currency
Example: 0.0021
trades[].fee_currency string
The asset the fee was charged in
Example: USDT
trades[].parent_order_id integer
The Anboto id of the parent order the fill belongs to (the order_id of the enclosing order)
Example: 596990285759373312
trades[].child_order_id integer
The Anboto id of the child (slice) order that executed on the exchange; the WebSocket trade topic carries it as order_id
Example: 596990290020118528
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(&params))
    .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
    }
  ]
}