Get lab
GET https://rest.haasapi.com/v1/labs/{lab_id}
Returns one lab: the list row’s fields plus the execution setup (account, market, window) and a summary of the configuration - counts and sizing, not the parameter matrix itself. Poll this while an execution runs; completed, cancelled and failed are terminal.
Requires the read scope.
Example request
Section titled “Example request”curl "https://rest.haasapi.com/v1/labs/{lab_id}" \ -H "Authorization: Bearer hk_live_YOUR_KEY"Response
Section titled “Response”200 OK. Returns a LabDetail.
{ "lab_id": "2f4f0f8a9df646c78be7a2a9f6d5b1c3", "name": "Scalper sweep BTC", "script_id": "7a4b2f91d6e53c8942a0bd7e1f5896c4", "algorithm": "intelligent", "status": "completed", "account_id": "af85799d-a214-4fd2-92ea-443c5eed18ad", "market_tag": "BINANCE_BTC_USDT", "interval": 5, "start_at": "2026-08-01T00:00:00Z", "end_at": "2026-08-15T00:00:00Z", "started_at": "2026-08-20T09:14:10Z", "scheduled_backtests": 100, "completed_backtests": 100, "parameters_count": 8, "enabled_parameters_count": 2, "config": { "max_population": 10, "max_generations": 10, "max_elites": 3 }, "cancel_reason": null, "created_at": "2026-08-20T09:12:04Z", "updated_at": "2026-08-20T11:47:33Z"}Fields
Section titled “Fields”LabDetail
Section titled “LabDetail”| Field | Type | Description |
|---|---|---|
lab_id |
string | Lab identifier - the id the lab endpoints accept. |
name |
string | User-chosen lab name. |
script_id |
string | The HaasScript whose parameter space the lab explores. |
algorithm |
LabAlgorithm | How the lab walks the parameter space. |
status |
LabStatus | Execution status. completed, cancelled and failed are terminal. |
account_id |
string, nullable | The account whose fees and wallet the lab’s backtests simulate. null until the lab was configured. |
market_tag |
string, nullable | The market the lab backtests - joins against market_tag on /v1/markets. null until the lab was configured. |
interval |
integer (int32), nullable | Chart interval in minutes. null until the lab was configured. |
start_at |
string, nullable | Start of the backtested window of the current/last execution, RFC 3339 UTC. null before the first start. |
end_at |
string, nullable | End of the backtested window of the current/last execution, RFC 3339 UTC. null before the first start. |
started_at |
string, nullable | When the current/last execution was started, RFC 3339 UTC. null before the first start. |
scheduled_backtests |
integer (int32) | Backtests the current/last execution scheduled. |
completed_backtests |
integer (int32) | Backtests completed so far. |
parameters_count |
integer (int32) | How many script parameters the lab knows about. |
enabled_parameters_count |
integer (int32) | How many of them are enabled for sweeping. |
config |
LabConfig | The execution sizing of the lab’s algorithm. null until the lab was configured. |
cancel_reason |
string, nullable | Why the last execution stopped early - ‘Cancelled by user’ for POST /cancel, a system reason for an automatic failure. null otherwise. |
created_at |
string, nullable | When the lab was created, RFC 3339 UTC. |
updated_at |
string, nullable | When the lab was last updated, RFC 3339 UTC. |
LabConfig
Section titled “LabConfig”| Field | Type | Description |
|---|---|---|
max_population |
integer (int32) | Parameter combinations evaluated per generation. |
max_generations |
integer (int32) | Generations the search runs. |
max_elites |
integer (int32) | Top results carried into the next generation. |
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 accessible lab with that id. (code: lab_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"}