> ## Documentation Index
> Fetch the complete documentation index at: https://docs.avnu.fi/llms.txt
> Use this file to discover all available pages before exploring further.

# Get OHLCV Data

> Retrieve candlestick (OHLCV) data for technical analysis and charting

## Overview

Returns Open, High, Low, Close, and Volume (OHLCV) candlestick data for any token. Essential for building trading charts and performing technical analysis.

## Path Parameters

<ParamField path="tokenAddress" type="string" required>
  Token contract address (hex format)
</ParamField>

## Query Parameters

<ParamField query="startDate" type="string" required>
  Start date (ISO 8601 format)
</ParamField>

<ParamField query="endDate" type="string" required>
  End date (ISO 8601 format)
</ParamField>

<ParamField query="resolution" type="string" default="1H">
  Candle timeframe: `1`, `5`, `15`, `1H`, `4H`, `1D`, `1W`
</ParamField>

<ParamField query="quoteTokenAddress" type="string">
  Quote currency token address (defaults to USD)
</ParamField>

## Response

Returns an array of candlestick objects (`CandleDataPoint`).

<ResponseField name="date" type="string" required>
  ISO 8601 timestamp for candle open
</ResponseField>

<ResponseField name="open" type="number" required>
  Opening price
</ResponseField>

<ResponseField name="high" type="number" required>
  Highest price during period
</ResponseField>

<ResponseField name="low" type="number" required>
  Lowest price during period
</ResponseField>

<ResponseField name="close" type="number" required>
  Closing price
</ResponseField>

<ResponseField name="volume" type="number" required>
  Total volume traded
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl "https://starknet.impulse.avnu.fi/v3/tokens/0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7/prices/candle?startDate=2024-02-01T00:00:00Z&endDate=2024-02-14T00:00:00Z&resolution=4H"
  ```

  ```typescript TypeScript theme={null}
  const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
  const endDate = new Date();
  const startDate = new Date(endDate.getTime() - 24 * 60 * 60 * 1000);

  const params = new URLSearchParams({
    startDate: startDate.toISOString(),
    endDate: endDate.toISOString(),
    resolution: '1H'
  });

  const response = await fetch(
    `https://starknet.impulse.avnu.fi/v3/tokens/${tokenAddress}/prices/candle?${params}`
  );

  const candles = await response.json();
  console.log(`Fetched ${candles.length} candles`);
  ```

  ```python Python theme={null}
  import requests
  from datetime import datetime, timedelta

  token_address = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7'
  end_date = datetime.now()
  start_date = end_date - timedelta(days=7)

  params = {
      'startDate': start_date.isoformat() + 'Z',
      'endDate': end_date.isoformat() + 'Z',
      'resolution': '4H'
  }

  response = requests.get(
      f'https://starknet.impulse.avnu.fi/v3/tokens/{token_address}/prices/candle',
      params=params
  )

  candles = response.json()
  print(f"Fetched {len(candles)} candles")
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "date": "2024-02-05T00:00:00Z",
      "open": 2410.30,
      "high": 2425.80,
      "low": 2405.15,
      "close": 2418.60,
      "volume": 1250000
    },
    {
      "date": "2024-02-05T04:00:00Z",
      "open": 2418.60,
      "high": 2435.00,
      "low": 2415.25,
      "close": 2430.75,
      "volume": 1480000
    },
    {
      "date": "2024-02-05T08:00:00Z",
      "open": 2430.75,
      "high": 2445.90,
      "low": 2428.00,
      "close": 2435.50,
      "volume": 1620000
    }
  ]
  ```
</ResponseExample>

## Resolution Values

| Value | Description |
| ----- | ----------- |
| `1`   | 1 minute    |
| `5`   | 5 minutes   |
| `15`  | 15 minutes  |
| `1H`  | 1 hour      |
| `4H`  | 4 hours     |
| `1D`  | 1 day       |
| `1W`  | 1 week      |
