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

# OHLC chart data for selected period

Retrieve aggregated chart data for a predefined time period. Unlike the date range endpoint, this method automatically calculates the data resolution based on the selected period, simplifying the request for common timeframes.

<Info>
  **Note on Precision**: Some currency pairs are returned with a [multiplier](/docs/http/metadata/multipliers) (e.g., 100 or 1000) to ensure high precision.
</Info>

### Path parameters

<ParamField path="format" type="string" optional default="json">
  The desired output format. Options: `json`, `xml`, `csv`.

  <Warning>
    If you choose `xml`, you must use the **POST** method. `GET` requests for XML will fail.
  </Warning>
</ParamField>

<ParamField path="currency-pair" type="string" required>
  The currency pair symbol (e.g., `EURUSD`). See the list of [available currencies](/docs/guides/available-currencies).
</ParamField>

<ParamField path="period" type="string" required>
  The time period to retrieve data for. Available options:

  * `30m` - Last 30 minutes
  * `1h` - Last 1 hour
  * `6h` - Last 6 hours
  * `12h` - Last 12 hours
  * `1d` - Last 1 day
  * `2d` - Last 2 days
  * `7d` - Last 7 days
  * `1M` - Last 1 month
  * `3M` - Last 3 months
  * `6M` - Last 6 months
  * `1Y` - Last 1 year
</ParamField>

### Response

<Info>
  **Response Structure**: For a detailed explanation of the array indices (for JSON) and property definitions, please refer to the [Response Structures](/docs/guides/data-properties) guide.
</Info>

<ResponseField type="object">
  <ResponseField name="ask" type="string">
    Array of ask prices.
  </ResponseField>

  <ResponseField name="bid" type="string">
    Array of bid prices.
  </ResponseField>

  <ResponseField name="name" type="string">
    The currency pair symbol.
  </ResponseField>

  <ResponseField name="time" type="string">
    Array of timestamps.
  </ResponseField>
</ResponseField>

<ResponseExample>
  ```json JSON theme={null}
  {
      "1584714240": [
          1.07217,
          1.07372,
          1.07329,
          1.07233,
          1.07205,
          1.07358,
          1.07315,
          1.07217
      ],
      [...]
      "1584728880": [
          1.0641,
          1.06594,
          1.06543,
          1.06542,
          1.06396,
          1.06583,
          1.06531,
          1.06529
      ]
  }
  ```

  ```xml XML theme={null}
  <result>
      <item>
          <time>1584709680</time>
          <min_ask>1.07</min_ask>
          <max_ask>1.07129</max_ask>
          <open_ask>1.0703</open_ask>
          <close_ask>1.0711</close_ask>
          <min_bid>1.06988</min_bid>
          <max_bid>1.07115</max_bid>
          <open_bid>1.07019</open_bid>
          <close_bid>1.07097</close_bid>
      </item>
      [...]
      <item>
          <time>1584737520</time>
          <min_ask>1.06966</min_ask>
          <max_ask>1.07034</max_ask>
          <open_ask>1.0699</open_ask>
          <close_ask>1.06996</close_ask>
          <min_bid>1.0692</min_bid>
          <max_bid>1.06987</max_bid>
          <open_bid>1.06927</open_bid>
          <close_bid>1.06966</close_bid>
      </item>
  </result>
  ```

  ```csv CSV theme={null}
  time,min_ask,max_ask,open_ask,close_ask,min_bid,max_bid,open_bid,close_bid
  1584709680,1.07024,1.07129,1.0703,1.0711,1.07014,1.07115,1.07019,1.07097
  [...]
  1584737520,1.06966,1.07034,1.0699,1.06996,1.0692,1.06987,1.06927,1.06966
  ```
</ResponseExample>
