# Get candles from exchange

`GET https://api.cryptohopper.com/v1/exchange/{exchange}/candle/{pair}/{time-frame}/{start-date}/{end-date}`

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

Returns candles for one market of an exchange over a time range.

Served by a separate service, not by the main API backend, so the response format is not documented here yet. The API gateway checks the access-token before the request reaches that service.

## Headers

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

## Path parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `time-frame` | string | yes | Candle time frame. |
| `exchange` | string | yes | Exchange key as returned by Get available exchanges, for example binance or kucoin. Case insensitive. |
| `start-date` | string | yes | Start of the time range. |
| `end-date` | string | yes | End of the time range. |
| `pair` | string | yes | Market pair, in the exchange's own pair format as returned by Get available markets, for example BTCUSDT on Binance or BTC/USDT on KuCoin. |

## Example request

```bash
curl "https://api.cryptohopper.com/v1/exchange/EXCHANGE/candle/PAIR/TIME_FRAME/START_DATE/END_DATE" \
  -H "access-token: YOUR_ACCESS_TOKEN"
```

## Response

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.
