Backtests run asynchronously server-side. backtest.create returns immediately with an ID; the actual computation happens in the background. To get the result, you poll backtest.get until status is terminal ("completed" or "failed").
- Submit the backtest with
backtest.create({hopper_id, start_date, end_date}). - Save the returned
id. - Loop:
backtest.get(id)→ checkstatus- If
"completed"or"failed", return the result - Otherwise sleep ~5 seconds and re-check
The backtest rate bucket is 1 request per 2 seconds. 5-second polling stays well clear of the limit. Don't poll faster than that — you'll start eating 429s.
| Language | File |
|---|---|
| Node.js | nodejs.js |
| Python | python.py |
| Go | go.go |
Each takes the same env vars: CRYPTOHOPPER_TOKEN, HOPPER_ID. Run command is in the file header.
The example uses Q1 2026. Substitute your own dates as YYYY-MM-DD. The server caps backtest spans (typically 2 years); see backtest.limits() for your account's quota.