---
title: "Get OHLC candles for a symbol"
url: https://docs.truemarkets.co/api/market-data/get-candles
description: "Returns open/high/low/close buckets for an asset over a configurable"
---

Docs index: https://docs.truemarkets.co/llms.txt

# Get OHLC candles for a symbol

```
GET https://api.truemarkets.co/v1/defi/market/prices/candles
```

Returns open/high/low/close buckets for an asset over a configurable
lookback window, sampled at a configurable resolution. Use for
candlestick charts and volatility measures that need the intra-bucket
range rather than a single close.

Only sources that store individual ticks can produce OHLC. Requesting
candles for an asset priced from a derived or snapshot source returns
`400`.

See the [Time Window & Resolution](#section/Time-Window-and-Resolution)
section for the format of `window` and `resolution`.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `asset_id` | query | string (uuid) | no | Backend asset ID. Mutually exclusive with `symbol`: exactly one of the two is required, and naming both is a 400. |
| `symbol` | query | string | no | Asset symbol to fetch candles for (e.g. `SOL`, `BTC`). |
| `window` | query | string | no | Lookback period (e.g. `1h`, `4h`, `1d`, `7d`, `1M`). |
| `resolution` | query | string | no | Candle size (e.g. `1m`, `5m`, `1h`). |
| `asset_class` | query | string, one of `spot`, `perp` | no | Asset class to resolve the symbol in. Defaults to `spot`. |

## Responses

Every error status returns the same body, described in [Errors](https://docs.truemarkets.co/developer-resources/errors.md).

### 200

Candle series for the requested symbol

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `asset_id` | string (uuid) | no | Backend asset ID. Absent on the CeFi routes. |
| `symbol` | string | no | The asset symbol |
| `window` | string | no | The time window used for the query |
| `resolution` | string | no | The candle size used for the query |
| `candles` | array of object | no | List of OHLC buckets, oldest first |
| `candles[].t` | string | no | ISO 8601 timestamp of the bucket start |
| `candles[].open` | string | no | First price in the bucket |
| `candles[].high` | string | no | Highest price in the bucket |
| `candles[].low` | string | no | Lowest price in the bucket |
| `candles[].close` | string | no | Last price in the bucket |

### 400

Bad request - invalid parameters, or candles unavailable for the asset's price source

### 404

Symbol not found or no price data

### 500

Internal server error
