Open positions
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.
curl 'http://127.0.0.1:48180/v1/account/positions?connection_id=12' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Open positions of the connection. unrealized_pnl and mark_price are computed by the terminal. mark_price is the best bid for a long and the best ask for a short.
bearerToken account:readAuthorizationBearer <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
connection_id*integerThe connection whose account to read.
int64Positions of the connection.
application/json- response
connection_id*integerint64data*array<>curl 'http://127.0.0.1:48180/v1/account/positions?connection_id=12' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"{ "connection_id": 12, "data": [ { "instrument": "binance:futures:BTCUSDT", "side": "long", "size": "0.5", "lot_size": "1", "entry_price": "66500", "notional": "33250", "unrealized_pnl": "250", "mark_price": "67000" } ]}Open orders and trigger orders GET
Open orders and trigger orders of the connection. `key` and `exchange_id` are `null` until they are known. `size`, `filled` and `remaining` are in the base coin.
Balances GET
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.