# Get trade history

`GET https://api.cryptohopper.com/v1/hopper/{id}/trade`

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

Returns the completed trades of the hopper in a period, newest first.

OAuth scope: `read`

offset and count are echoed back as sent.

## Headers

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

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Hopper ID. |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `count` | string | no | Maximum number of trades to return. Default 500. |
| `offset` | string | no | Number of trades to skip. Default 0. |
| `dateTo` | string | no | End of the period as a date and time, e.g. 2026-09-25 23:59:59. Default now. |
| `dateFrom` | string | no | Start of the period as a date and time, e.g. 2026-09-01 00:00:00. Default one month ago. |

## Example request

```bash
curl "https://api.cryptohopper.com/v1/hopper/HOPPER_ID/trade" \
  -H "access-token: YOUR_ACCESS_TOKEN"
```

## Response

Example response (illustrative values):

```json
{
    "data": {
        "trades": [
            {
                "id": "268001234",
                "exchange": "binance",
                "currency": "BTC",
                "pair": "BTCUSDT",
                "type": "sell",
                "order_cur": "usdt",
                "order_id": "31245678901",
                "date": "2026-09-20 14:32:10",
                "amount": "0.0015",
                "rate": "65210.5",
                "total": "97.81575",
                "fee": "0.0978",
                "result": "1.52",
                "trigger_strategy": "take-profit",
                "buy_id": "268001100",
                "is_short": "0",
                "result_short": "0.00"
            }
        ],
        "offset": 0,
        "count": 500,
        "results": 1
    }
}
```

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.
