Skip to Content
HTTP APIService

Health of the Local API

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/health' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
GET
/health

Authorization

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

Response Body

The status and the counters of the Local API.

application/json
  1. response
status*string

ok while the API answers.

uptime_ms*integer
Formatint64
clients*integer

Stream connections.

streams*integer

Pairs the API serves now.

api_only_instruments*integer

How many of them are opened only for the API.

dropped_events*integer

Market events that reached no client because the terminal was overloaded.

Formatint64
dropped_frames*integer

Frames dropped for clients that read too slowly.

Formatint64
overflow_closes*integer

Stream connections closed with code 4008.

Formatint64
stream_available*boolean

Whether the terminal was built with market data. Without it the stream and market operations answer unsupported.

Example Request
curl 'http://127.0.0.1:48180/v1/health' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
Example Response
{  "status": "ok",  "uptime_ms": 1234,  "clients": 1,  "streams": 3,  "api_only_instruments": 2,  "dropped_events": 0,  "dropped_frames": 0,  "overflow_closes": 0,  "stream_available": true}