> ## 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 Price Feed

> Retrieve historical price data for charting and analysis

## Overview

Fetch historical price data for any token with customizable time ranges and resolutions. Perfect for building price charts, analyzing trends, and backtesting strategies.

## Request

<ParamField path="tokenAddress" type="string" required>
  Token contract address
</ParamField>

<ParamField query="startDate" type="string" required>
  ISO 8601 start date (e.g., "2024-01-01T00:00:00Z")
</ParamField>

<ParamField query="endDate" type="string" required>
  ISO 8601 end date (e.g., "2024-02-01T00:00:00Z")
</ParamField>

<ParamField query="resolution" type="string" default="1H">
  Data point frequency:

  * `1` - 1 minute
  * `5` - 5 minutes
  * `15` - 15 minutes
  * `1H` - 1 hour
  * `4H` - 4 hours
  * `1D` - 1 day
  * `1W` - 1 week
</ParamField>

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

## Response

<ResponseField name="date" type="string" required>
  ISO 8601 date-time for this data point
</ResponseField>

<ResponseField name="value" type="number" required>
  Price at this date
</ResponseField>

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

  ```typescript TypeScript theme={null}
  // Fetch 30 days of daily price data
  const tokenAddress = '0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7';
  const endDate = new Date();
  const startDate = new Date();
  startDate.setDate(startDate.getDate() - 30);

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

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

  const data = await response.json();

  // Calculate price statistics
  const prices = data.map(d => d.value);
  const avgPrice = prices.reduce((a, b) => a + b) / prices.length;
  const maxPrice = Math.max(...prices);
  const minPrice = Math.min(...prices);

  console.log(`30-day stats: Avg: $${avgPrice}, High: $${maxPrice}, Low: $${minPrice}`);
  ```

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

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

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

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

  data = response.json()

  # Convert to DataFrame for analysis
  df = pd.DataFrame(data)
  df['date'] = pd.to_datetime(df['date'])
  df.set_index('date', inplace=True)

  # Calculate moving averages
  df['MA7'] = df['value'].rolling(window=7).mean()
  df['MA30'] = df['value'].rolling(window=30).mean()
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  [
    {
      "date": "2024-02-01T00:00:00Z",
      "value": 2320.50
    },
    {
      "date": "2024-02-02T00:00:00Z",
      "value": 2345.75
    },
    {
      "date": "2024-02-03T00:00:00Z",
      "value": 2380.20
    },
    {
      "date": "2024-02-04T00:00:00Z",
      "value": 2365.90
    },
    {
      "date": "2024-02-05T00:00:00Z",
      "value": 2410.30
    },
    {
      "date": "2024-02-06T00:00:00Z",
      "value": 2435.50
    }
  ]
  ```
</ResponseExample>

## Resolution Guidelines

<Info>
  **Recommended resolutions by time range:**

  * **\< 1 day**: 1 or 5 minute resolution
  * **1-7 days**: 15 minute or 1 hour resolution
  * **1-4 weeks**: 1 or 4 hour resolution
  * **1-3 months**: Daily resolution
  * **3+ months**: Weekly resolution
</Info>
