Skip to content

Exchanges

Manage connected exchange accounts.

MethodPathDescription
GET/v1/exchangesList exchange accounts
GET/v1/exchanges/:idGet exchange account
POST/v1/exchangesAdd exchange account
DELETE/v1/exchanges/:idRemove exchange account
POST/v1/exchanges/testTest exchange credentials
POST/v1/exchanges/:id/syncSync exchange balance

GET /v1/exchanges
Terminal window
curl https://api.tokenbot.com/v1/exchanges \
-H "X-API-Key: tb_live_your_key"

Response:

{
"success": true,
"data": [
{
"id": "exc_abc123",
"exchange_name": "binance",
"account_name": "Main Binance",
"trading_type": "spot",
"is_active": true,
"balance": { "BTC": 1.5, "USDT": 10000 },
"last_sync_at": "2026-02-20T12:00:00Z",
"created_at": "2026-01-15T10:30:00Z"
}
]
}

GET /v1/exchanges/:id
Terminal window
curl https://api.tokenbot.com/v1/exchanges/exc_abc123 \
-H "X-API-Key: tb_live_your_key"

POST /v1/exchanges

Request Body:

{
"exchange_name": "binance",
"account_name": "My Binance",
"trading_type": "spot",
"api_key": "your_exchange_api_key",
"api_secret": "your_exchange_api_secret",
"passphrase": "optional_passphrase"
}
Terminal window
curl -X POST https://api.tokenbot.com/v1/exchanges \
-H "X-API-Key: tb_live_your_key" \
-H "Content-Type: application/json" \
-d '{"exchange_name":"binance","account_name":"My Binance","trading_type":"spot","api_key":"...","api_secret":"..."}'

DELETE /v1/exchanges/:id
Terminal window
curl -X DELETE https://api.tokenbot.com/v1/exchanges/exc_abc123 \
-H "X-API-Key: tb_live_your_key"

POST /v1/exchanges/test

Test exchange API credentials before saving.

Request Body:

{
"exchange_name": "binance",
"api_key": "your_exchange_api_key",
"api_secret": "your_exchange_api_secret",
"trading_type": "spot"
}

POST /v1/exchanges/:id/sync

Force a balance sync with the exchange.

Terminal window
curl -X POST https://api.tokenbot.com/v1/exchanges/exc_abc123/sync \
-H "X-API-Key: tb_live_your_key"