HTTP APIWorkspace
All windows
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/workspace' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"
GET
All windows with their tabs, stacks and charts. An empty stack has instrument and connection_id of null. position is null for a stack hidden in a group of stacks.
bearerToken workspace:readheader
AuthorizationBearer <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: workspace:read
The layout of the windows.
application/json- response
data*curl 'http://127.0.0.1:48180/v1/workspace' \ -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN"Example Response
{ "data": { "windows": [ { "id": 1, "main": true, "chart_window": false, "focused": true, "geometry": { "x": 0, "y": 0, "width": 1920, "height": 1080, "maximized": true }, "monitor": "DP-1", "tabs": [ { "id": 1, "name": "XRP", "active": true, "stacks": [ { "widget_id": 12, "instrument": "binance:futures:XRPUSDT", "connection_id": 25, "empty": false, "frozen": false, "position": { "column": 0, "row": 1, "cell": 0 } } ], "charts": [ { "widget_id": 13, "instrument": "binance:futures:XRPUSDT", "connection_id": 25, "interval": "5m", "owner_widget_id": 12, "position": { "column": 0, "row": 0, "cell": 0 } } ] } ] } ] }}