Skip to Content
HTTP APIMarket data

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.

Command
curl 'http://127.0.0.1:48180/v1/market/intervals' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
GET
/market/intervals

The intervals the terminal knows. duration_ms is nominal: for 1M it is 30 days. Take month boundaries from ts of the bars.

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

Response Body

Interval codes and their nominal length.

application/json
  1. response
candles*array<>
clusters*array<>
Example Request
curl 'http://127.0.0.1:48180/v1/market/intervals' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Example Response
{  "candles": [    {      "id": "1m",      "duration_ms": 60000    },    {      "id": "1M",      "duration_ms": 2592000000    }  ],  "clusters": [    {      "id": "30s",      "duration_ms": 30000    },    {      "id": "1d",      "duration_ms": 86400000    }  ]}