Skip to Content
HTTP APIWorkspace

Open a coin on every exchange

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 -X POST 'http://127.0.0.1:48180/v1/workspace/multiview' \
  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{
  "base": "BTC",
  "target": "new_window",
  "activate": true
}'
POST
/workspace/multiview

Opens the coin the way the Multiview button of the window does. It follows the rows of "Exchange layout", their order-book and chart toggles, and the quote currency of each exchange. Without target the tab opens as the "Open" setting of multiview says.

Authorization

bearerToken workspace:write
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: workspace:write

Request Body

application/json
  1. body
base*string

A coin or a pair: BTC, BTC/USDT, BTCUSDT.

target?WorkspaceTarget

new_tab opens a tab in the window window_id, or in the focused window without it. new_window opens a new window.

Value in"new_tab""new_window"
window_id?integer
Formatint64
Range0 <= value
activate?boolean
Defaulttrue

Response Body

Where the multiview opened. stacks and charts are its widgets, in the order of columns.

application/json
  1. response

What a workspace command opened or touched. The numbers it concerns are filled in. The rest is null or empty.

window_id*|
Formatint64
tab_id*|
Formatint64
stacks*array<>
charts*array<>
Example Request
curl -X POST 'http://127.0.0.1:48180/v1/workspace/multiview' \  -H "Authorization: Bearer $SPECTRE_LOCAL_API_TOKEN" \  -H 'Content-Type: application/json' \  -d '{  "base": "BTC",  "target": "new_window",  "activate": true}'
Example Response
{  "window_id": 3,  "tab_id": 1,  "stacks": [    20,    22  ],  "charts": [    21  ]}