# Start a backtest

`POST https://api.cryptohopper.com/v1/backtest`

Part of [Backtesting](https://www.cryptohopper.com/api-documentation/api-reference/backtesting.md) in the Cryptohopper API reference.

Starts a backtest of one of your bots, one of your templates or a marketplace template. If you already have a backtest for the same template or bot, that backtest is reset and runs again with the new settings.

OAuth scope: `read`, `manage`

Send hopper_id instead of template_id to test one of your bots; it takes precedence. template_type is user or market (default market). subscription_id (1, 2 or 3) sets the plan level to simulate and defaults to your highest plan. When you are at your limit of running backtests or daily backtests, the backtest is queued and the message says so. Only trading, portfolio and grid bots and templates can be backtested. Requires an active subscription or trial; otherwise the request is refused with 403.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | yes | The OAuth access token of the user. |

## Example request

```bash
curl -X POST "https://api.cryptohopper.com/v1/backtest" \
  -H "access-token: YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"template_id":8812,"template_type":"market","start_date":"2026-08-01 00:00:00","end_date":"2026-08-31 00:00:00","start_amount":1000,"maker_fee":0.1,"taker_fee":0.1,"subscription_id":3}'
```

## Response

Example response (illustrative values):

```json
{
    "data": "Your backtest has started. You can track the progress on this page."
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
