List candle and cluster intervals
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/intervals' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
The intervals the terminal knows. duration_ms is nominal: for 1M it is 30 days. Take month boundaries from ts of the bars.
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
Interval codes and their nominal length.
application/json- response
candles*array<>clusters*array<>curl 'http://127.0.0.1:48180/v1/market/intervals' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"{ "candles": [ { "id": "1m", "duration_ms": 60000 }, { "id": "1M", "duration_ms": 2592000000 } ], "clusters": [ { "id": "30s", "duration_ms": 30000 }, { "id": "1d", "duration_ms": 86400000 } ]}List instruments GET
The instrument catalogue of one exchange and market, in pages ordered by symbol. Pass either `connection_id` or both `exchange` and `market`. Steps and minimums are `null` when the exchange did not report them.
Candle history GET
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.