Trades
View and manage trades.
Endpoints
Section titled “Endpoints”| Method | Path | Description |
|---|---|---|
| GET | /v1/trades | List trades |
| GET | /v1/trades/:id | Get trade |
| GET | /v1/trades/analytics | Get trade analytics |
| POST | /v1/trades | Create trade |
| POST | /v1/trades/:id/cancel | Cancel trade |
List Trades
Section titled “List Trades”GET /v1/tradesQuery Parameters:
| Parameter | Type | Description |
|---|---|---|
strategy_id | string | Filter by strategy |
exchange_account_id | string | Filter by exchange account |
status | string | PENDING, FILLED, PARTIALLY_FILLED, CANCELLED, FAILED |
side | string | BUY or SELL |
limit | integer | Max results (default 50, max 100) |
offset | integer | Pagination offset |
curl "https://api.tokenbot.com/v1/trades?status=FILLED&limit=10" \ -H "X-API-Key: tb_live_your_key"Get Trade
Section titled “Get Trade”GET /v1/trades/:idGet Trade Analytics
Section titled “Get Trade Analytics”GET /v1/trades/analyticsReturns aggregated trade performance metrics.
curl https://api.tokenbot.com/v1/trades/analytics \ -H "X-API-Key: tb_live_your_key"Create Trade
Section titled “Create Trade”POST /v1/tradesRequest Body:
{ "exchange_account_id": "exc_abc123", "trade_pair_id": "tp_btcusdt", "type": "LIMIT", "side": "BUY", "price": 50000.00, "amount": 0.1}Cancel Trade
Section titled “Cancel Trade”POST /v1/trades/:id/cancelcurl -X POST https://api.tokenbot.com/v1/trades/trd_abc123/cancel \ -H "X-API-Key: tb_live_your_key"
