Candle history
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/market/candles?instrument=binance:futures:BTCUSDT&interval=1m&limit=100' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
The candle history of an instrument, read the same way the chart of the terminal reads it. ts is the opening time of a bar.
bearerToken market: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: market:read
instrument*stringInstrument address, exchange:market:symbol.
connection_id?integerThe 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.
int64interval*stringAn interval code from GET /market/intervals.
limit?integerThe number of bars.
value <= 2000500end?integerThe right boundary in UTC milliseconds. The default is now.
int64The bars, oldest first.
application/json- response
instrument*stringconnection_id*integerThe connection the history was read through.
int64interval*stringdata*array<>curl 'http://127.0.0.1:48180/v1/market/candles?instrument=binance:futures:BTCUSDT&interval=1m&limit=100' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"{ "instrument": "binance:futures:BTCUSDT", "connection_id": 12, "interval": "1m", "data": [ { "ts": 1730294400000, "open": "67000.1", "high": "67010.5", "low": "66990.0", "close": "67003.4", "volume": "52.1", "quote_volume": "3490000.5", "closed": true } ]}List candle and cluster intervals GET
The intervals the terminal knows. `duration_ms` is nominal: for `1M` it is 30 days. Take month boundaries from `ts` of the bars.
Recent trades GET
The last trades of the pair, oldest first. The terminal keeps the last 1000 trades of a pair. If no trade arrives within 3 s, the answer is empty.