Get backtest logs
GET https://rest.haasapi.com/v1/backtests/{backtest_id}/logs
The execution log of a finished backtest: the script’s own log output plus the engine’s report summary, in execution order. Returned whole.
Requires the read scope.
Example request
Section titled “Example request”curl "https://rest.haasapi.com/v1/backtests/{backtest_id}/logs" \ -H "Authorization: Bearer hk_live_YOUR_KEY"Response
Section titled “Response”200 OK. Returns a BacktestLogs.
{ "data": [ { "at": "2026-08-29T20:30:00Z", "message": "Backtest start date: 8/28/2026 8:30:00 PM GTM+0" }, { "at": "2026-08-29T20:30:00Z", "message": "Gross profits: 0.00000000 USDT" } ]}Fields
Section titled “Fields”BacktestLogs
Section titled “BacktestLogs”| Field | Type | Description |
|---|---|---|
data |
array of BacktestLogLine | The log lines, in execution order. |
BacktestLogLine
Section titled “BacktestLogLine”| Field | Type | Description |
|---|---|---|
at |
string, nullable | The simulated candle time the line was logged at, RFC 3339 UTC. null when the line carries no timestamp. |
message |
string | The log message. |
Errors
Section titled “Errors”All errors are RFC 9457 problem documents.
| Status | Description |
|---|---|
400 |
The request is malformed (invalid limit, unusable cursor, …). (code: invalid_request) |
401 |
Missing, malformed, disabled, or revoked API key. (code: invalid_api_key) |
404 |
No backtest with that id, or it is still executing. (code: backtest_not_found) |
500 |
An unexpected error inside the API. Nothing about the request caused it; retry, and quote the instance value if it persists. (code: internal_error) |
502 |
An internal service answered in a way the API could not serve. Retry. (code: upstream_error) |
503 |
The request could not be served right now. Retry with the same key - do not discard it. (code: temporarily_unavailable) |
504 |
An internal service did not answer within the deadline. Retry with backoff. (code: upstream_timeout) |
{ "type": "https://docs.haasapi.com/errors/invalid_request", "title": "Invalid request", "status": 400, "detail": "The request is malformed (invalid limit, unusable cursor, …).", "code": "invalid_request"}