Skip to Content
HTTP APIMarket data

Recent trades

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

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.

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
limit?integer

How many of the last trades. A value outside the range is moved into it.

Range1 <= value <= 1000
Default100
since_ts?integer

Only trades the terminal received at this time or later. UTC milliseconds.

Formatint64

Response Body

Trades of the pair.

application/json
  1. response
instrument*string
connection_id*integer
Formatint64
data*array<>
Example Request
curl 'http://127.0.0.1:48180/v1/market/trades?instrument=binance:futures:BTCUSDT&limit=50' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Example Response
{  "instrument": "binance:futures:BTCUSDT",  "connection_id": 12,  "data": [    {      "id": null,      "price": "67000.1",      "qty": "0.012",      "side": "buy",      "ts": 1730294400125,      "exchange_ts": 1730294400119    }  ]}