Skip to Content
HTTP APIMarket data

Volume clusters

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/market/clusters?instrument=binance:futures:BTCUSDT' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
GET
/market/clusters

Up to ten latest cluster buckets, oldest first. The interval is the one chosen for the instrument in the terminal, 5m by default. For an instrument that is not open in the terminal, the first call starts the calculation and waits up to 3 s for history.

Authorization

bearerToken market: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: market:read

Query Parameters

instrument*string

Instrument address, exchange:market:symbol.

connection_id?integer

The connection to read through. Without it the terminal uses the enabled trading connection of the exchange and market, or the read-only one if there is none.

Formatint64

Response Body

The latest buckets.

application/json
  1. response
instrument*string
connection_id*integer
Formatint64
interval*string

The interval chosen for the instrument in the terminal.

ts*integer
Formatint64
data*array<>
Example Request
curl 'http://127.0.0.1:48180/v1/market/clusters?instrument=binance:futures:BTCUSDT' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Example Response
{  "instrument": "binance:futures:BTCUSDT",  "connection_id": 12,  "interval": "5m",  "ts": 1730294400123,  "data": [    {      "interval": "5m",      "ts": 1730294100000,      "end_ts": 1730294400000,      "volume": "12.5",      "buy_volume": "7.25",      "sell_volume": "5.25",      "trades": 120,      "vwap": "67000.1",      "min_price": "66990.0",      "max_price": "67010.5",      "completed": false,      "last_trade_ts": 1730294399870,      "levels": [        {          "price": "67000.1",          "volume": "1.25",          "buy_volume": "0.75",          "sell_volume": "0.5",          "buy_trades": 3,          "sell_trades": 2        }      ]    }  ]}