Skip to Content
HTTP APIAccount

Balances

Build your request

Change the values and the command follows. The token is never typed here: the command reads it from the SPECTRE_LOCAL_API_TOKEN environment variable. Run it in your own terminal.

Command
curl 'http://127.0.0.1:48180/v1/account/balances?connection_id=12' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
GET
/account/balances

The last value the exchange sent for each currency since the API was switched on. The exchange sends a balance only when it changes, so a currency with no change since then is absent. available and locked are null when the exchange does not report them. ts is the exchange time, or the time of receipt when there is none.

Authorization

bearerToken account:read
headerAuthorizationBearer <token>

The Local API token: spt_ and 64 hex characters. Copy it from Settings App → General → Local API. It is accepted only in the Authorization header. The names listed with an operation are the scopes it requires. The token of the terminal carries all of them.

Scope: account:read

Query Parameters

connection_id*integer

The connection whose account to read.

Formatint64

Response Body

Balances of the connection.

application/json
  1. response
connection_id*integer
Formatint64
data*array<>
Example Request
curl 'http://127.0.0.1:48180/v1/account/balances?connection_id=12' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Example Response
{  "connection_id": 12,  "data": [    {      "currency": "USDT",      "total": "1000.5",      "available": "900.5",      "locked": "100",      "ts": 1730294400123    }  ]}