Download OpenAPI specification:
QTSurfer backend services API
The auth endpoint exchanges a long-lived API key for a short-lived
JWT used by every other endpoint. Issue an API key via the web app, then
call POST /auth/token at the start of each session (and on 401
responses) to obtain a fresh JWT.
Key functionalities:
Exchanges a long-lived API key for a short-lived JWT used by every other
endpoint. This is the only endpoint that accepts an API key directly —
callers should obtain a JWT here, then send it as Authorization: Bearer <token> to all other operations.
The returned JWT carries the caller's subscription tier as a claim and
expires after expires_in seconds. Callers should refresh the token
before expiry (or on a 401 response) by calling this endpoint again.
{- "access_token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiI3NmI5MDIwMy0wM2MyLTQ2ZjYtYjM2Ni05OTQ0ZjE2N2U4MTgiLCJzY29wZXMiOltdLCJ0aWVyIjoiZnJlZSIsImlhdCI6MTc3OTczNTQ2MiwiZXhwIjoxNzc5NzM5MDYyfQ.signature",
- "token_type": "Bearer",
- "expires_in": 3600,
- "scopes": [ ],
- "tier": "free"
}This set of endpoints allows interaction with various exchanges for cryptocurrencies and financial assets. With these endpoints, users can access information about available exchanges, retrieve the instruments (currency pairs or assets) offered by each exchange, and perform analyses on them. The data provided by these endpoints is crucial for strategic decision-making within the trading platform.
Key functionalities:
| exchangeId required | string Example: binance ID of the exchange to retrieve instruments for |
[- {
- "id": "BTC/USDT",
- "base": "BTC",
- "quote": "USDT",
- "dataFrom": "2026-03-17T00:00:00Z",
- "dataTo": "2026-03-31T18:00:00Z",
- "lastPrice": 84250.5,
- "volume24h": 1234567.89
}, - {
- "id": "ETH/USDT",
- "base": "ETH",
- "quote": "USDT",
- "dataFrom": "2026-03-17T00:00:00Z",
- "dataTo": "2026-03-31T18:00:00Z",
- "lastPrice": 3120.75,
- "volume24h": 456789.12
}
]Serves exactly one hour of raw ticker data for the given instrument on the requested exchange. The payload is a native Lastra file — QTSurfer's columnar format for tick-precision timeseries — with no JSON envelope.
One segment = one hour, aligned to UTC. The hour query parameter selects
the segment and must match YYYY-MM-DDTHH (no minutes/seconds, no timezone
suffix). Example: hour=2026-01-15T10 returns h10.lastra for
2026-01-15, covering [10:00:00Z, 11:00:00Z). Hours not yet available
return 404.
A format=parquet query parameter switches the response to on-the-fly
Parquet conversion via lastra-convert
for clients that don't yet read Lastra. Lastra is the primary format
and cheaper when the client can consume it.
Clients:
curl -OJ for offline dumps (the Content-Disposition header sets a
descriptive filename).| exchangeId required | string Example: binance ID of the exchange (e.g. |
| base required | string Example: BTC Base asset symbol (first leg of the pair). |
| quote required | string Example: USDT Quote asset symbol (second leg of the pair). |
| hour required | string^\d{4}-\d{2}-\d{2}T\d{2}$ Example: hour=2026-01-15T10 Hour selector in |
| format | string Default: "lastra" Enum: "lastra" "parquet" Example: format=lastra Response wire format. |
{- "code": 400,
- "message": "Invalid request"
}Same shape and semantics as /exchange/{exchangeId}/tickers/{base}/{quote},
but serves klines (aggregated bars) instead of raw ticks. One
Lastra segment = one hour of
klines at the exchange's native kline cadence, aligned to UTC.
Klines use the same columnar layout as tickers — readers that handle one format read the other with the same code. Use this endpoint when a per-tick payload would be too large for the window of interest.
| exchangeId required | string Example: binance ID of the exchange (e.g. |
| base required | string Example: BTC Base asset symbol. |
| quote required | string Example: USDT Quote asset symbol. |
| hour required | string^\d{4}-\d{2}-\d{2}T\d{2}$ Example: hour=2026-01-15T10 Hour selector in |
| format | string Default: "lastra" Enum: "lastra" "parquet" Example: format=lastra Response wire format. |
{- "code": 400,
- "message": "Invalid request"
}The backtest endpoints enable users to test trading strategies based on historical data before applying them in real-time trading. This functionality is essential for traders who want to evaluate the performance of a strategy under past market conditions and optimize it before implementing it in a live trading environment.
Key functionalities:
Enqueues a prepare task over the requested date range. Returns immediately with a jobId;
poll GET /backtest/{exchangeId}/{type}/prepare/{jobId} for completion.
The same params always return the same jobId (idempotent). Repeated calls with identical
params do not enqueue duplicate work — they reuse the existing job.
| exchangeId required | string Example: binance ID of the exchange to prepare the backtesting for |
| type required | string (DataSourceType) Value: "ticker" Example: ticker The type of data source to prepare from |
The required data to prepare a backtesting
| instrument required | string (Instrument) Exchange instrument identifier (e.g. a currency pair) |
| from required | string Start date for the preparation process. Supports the following formats:
|
| to required | string End date for the preparation process. Supports the following formats:
|
| cadence | string Default: "1s" Enum: "1s" "5s" "1m" "5m" "15m" "1h" "4h" "1d" Output bar cadence for the prepared range. Defaults to the publisher's
native cadence ( |
{- "instrument": "BTC/USDT",
- "from": "2024-12-13T00:00:00Z",
- "to": "2024-12-14T00:00:00Z",
- "cadence": "1m"
}{- "jobId": "13RBLGQlPnfDjO6wyKSX8i"
}Retrieves the current state of the prepare job identified by jobId.
Poll until status is Completed, Failed, or Aborted.
| exchangeId required | string Example: binance ID of the exchange for the backtesting process |
| type required | string (DataSourceType) Value: "ticker" Example: ticker The type of data source to prepare from |
| jobId required | string Example: 13RBLGQlPnfDjO6wyKSX8i Job ID returned by |
{- "contextId": "ctx_0bjmoxd4vahkgc0hnvdldh",
- "status": "Completed",
- "statusDetail": null,
- "size": 0,
- "completed": 24,
- "startTime": "2026-04-14T15:00:00Z",
- "endTime": "2026-04-14T15:00:01Z"
}Enqueues an execute task that runs the strategy identified by strategyId over the data
prepared by the prepare job identified by prepareJobId. The instrument and date range are
recovered from the prepare job — they do not need to be sent again.
Returns immediately with a jobId; poll GET /backtest/{exchangeId}/{type}/execute/{jobId}
for the result.
The same params (same prepareJobId, strategyId, storeSignals) always return the same
jobId (idempotent).
| exchangeId required | string Example: binance ID of the exchange for the backtesting process |
| type required | string (DataSourceType) Value: "ticker" Example: ticker The type of data source to execute from |
Execute task parameters
| prepareJobId required | string Job ID returned by |
| strategyId required | string (strategyId) Unique identifier for a compiled strategy |
| storeSignals | boolean Default: false When true, the worker uploads emitted signals to object storage and the
response includes |
{- "prepareJobId": "13RBLGQlPnfDjO6wyKSX8i",
- "strategyId": "6bsh31ikwkuivhtgcoa6s4",
- "storeSignals": false
}{- "jobId": "13RBLGQlPnfDjO6wyKSX8i"
}Requests cancellation of the specified execution. The execution
status will transition to Aborted once the cancellation is
processed. Cancellation is asynchronous — poll the GET endpoint
to confirm the final status.
| exchangeId required | string Example: binance |
| type required | string (DataSourceType) Value: "ticker" Example: ticker Managed exchange data sources available for backtesting. |
| jobId required | string Example: 13RBLGQlPnfDjO6wyKSX8i Job ID returned by |
{- "status": "cancelling",
- "jobId": "13RBLGQlPnfDjO6wyKSX8i"
}Retrieves the current state and results of the execute job identified by jobId.
Poll until state.status is Completed, Failed, or Aborted.
| exchangeId required | string Example: binance ID of the exchange for the backtesting process |
| type required | string (DataSourceType) Value: "ticker" Example: ticker The type of data source to execute from |
| jobId required | string Example: 13RBLGQlPnfDjO6wyKSX8i Job ID returned by |
{- "state": {
- "contextId": "ctx_2mnyblatqqw34kix2echpb",
- "status": "Completed",
- "statusDetail": null,
- "size": 0,
- "completed": 73158,
- "startTime": "2026-03-18T13:21:28.958Z",
- "endTime": "2026-03-18T13:21:29.605Z"
}, - "results": {
- "hostName": "executor10",
- "iops": 123956.53,
- "strategyId": "strategy:00000000-0000-0000-0000-000000000000:ticker:2iyvtenlzh9dabqtxn7nbv",
- "instrument": "BTC/USDT",
- "pnlTotal": 42.75,
- "pnlTotalPercent": 2.25,
- "totalTrades": 156,
- "winRate": 58.33,
- "sharpeRatio": 1.245,
- "sortinoRatio": 1.872,
- "cagr": 0.1534,
- "maxDrawdown": 12.5,
- "maxDrawdownPercent": 8.75,
- "equityCurve": [
- {
- "timestamp": 1700000000000,
- "equity": 100
}, - {
- "timestamp": 1700000060000,
- "equity": 110.5
}, - {
- "timestamp": 1700000120000,
- "equity": 90.25
}
], - "signalCount": 100000,
- "signalsId": "00000000-0000-0000-0000-000000000000/exec/binance/3vsndwikcuaatjmb83fjtl",
- "signalsUpload": "Done",
- "signalsUploadedAt": "2026-03-18T13:21:48.170Z"
}
}The strategy endpoints allow users to submit, compile, and validate trading strategies within the platform. This feature is crucial for traders who develop automated trading systems and wish to ensure their strategy is both executable and effective before deploying it in a live/backtesting environment.
Key functionalities:
Submits raw strategy source for compilation. By default the call is synchronous and returns
the strategyId once compilation succeeds. Set the header X-Compile-Async: true to enqueue
the compile task and return immediately with a jobId — poll
GET /strategy/{strategyId} to check status.
The strategyId is deterministic: the same source for the same user always produces the
same id.
| X-Compile-Async | boolean Default: false When |
The raw strategy source code
Raw strategy Java source code
{- "strategyId": "6bsh31ikwkuivhtgcoa6s4"
}Polls the status of a strategy compilation. Useful when the strategy was submitted with
X-Compile-Async: true. Returns the resolved strategyId once compilation completes.
| strategyId required | string Example: 6bsh31ikwkuivhtgcoa6s4 The id returned by |
{- "jobId": "6bsh31ikwkuivhtgcoa6s4",
- "status": "Completed",
- "strategyId": "6bsh31ikwkuivhtgcoa6s4",
- "statusDetail": "string"
}