Skip to Content
HTTP APIMarket data

Market snapshot

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

The latest the terminal knows about the pair. A field is null until its data arrives. best_bid and best_ask are [price, size] from the order book.

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 snapshot.

application/json
  1. response
instrument*string
connection_id*integer
Formatint64
ts*integer
Formatint64
best_bid*array<string>|null
best_ask*array<string>|null
last_trade*|null
mark_price*string|null
ticker*|null
Example Request
curl 'http://127.0.0.1:48180/v1/market/snapshot?instrument=binance:futures:BTCUSDT' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Example Response
{  "instrument": "binance:futures:BTCUSDT",  "connection_id": 12,  "ts": 1730294400130,  "best_bid": [    "67000.1",    "1.25"  ],  "best_ask": [    "67000.2",    "0.40"  ],  "last_trade": {    "id": null,    "price": "67000.1",    "qty": "0.012",    "side": "buy",    "ts": 1730294400125,    "exchange_ts": 1730294400119  },  "mark_price": "67001.0",  "ticker": {    "price": "67000.1",    "change_24h_pct": "1.25",    "volume_24h": "81234.5",    "high_24h": null,    "low_24h": null,    "best_bid": null,    "best_ask": null,    "ts": 1730294400120  }}