> ## 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 date range

Retrieve aggregated chart data (open, high, low, close) for a specific currency pair within a custom time range. This endpoint is ideal for generating historical charts or analyzing market trends over a defined period.

<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>

### Query parameters

<ParamField query="starttime" type="string" required>
  The start of the requested period as a UNIX timestamp (seconds since epoch). Example: `1577836800` (January 1st, 2020).
</ParamField>

<ParamField query="endtime" type="string" required>
  The end of the requested period as a UNIX timestamp (seconds since epoch). Example: `1577836800` (January 1st, 2020).
</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 or aggregated ask data.
  </ResponseField>

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

  <ResponseField name="name" type="string">
    The currency pair symbol (e.g., `EURUSD`).
  </ResponseField>

  <ResponseField name="time" type="string">
    Array of timestamps corresponding to the data points.
  </ResponseField>
</ResponseField>

<ResponseExample>
  ```json JSON theme={null}
  {
      "1577836800": [
          1.12182,
          1.1221,
          1.12182,
          1.1221,
          1.12169,
          1.12199,
          1.12169,
          1.12199
      ],
      "1577836920": [
          1.12181,
          1.12182,
          1.12181,
          1.12181,
          1.12169,
          1.12169,
          1.12169,
          1.12169
      ],
      "1577836860": [
          1.12181,
          1.12182,
          1.12181,
          1.12181,
          1.12169,
          1.12169,
          1.12169,
          1.12169
      ]
  }
  ```

  ```xml XML theme={null}
  <result>
      <item>
          <time>1577836800</time>
          <min_ask>1.12182</min_ask>
          <max_ask>1.1221</max_ask>
          <open_ask>1.12182</open_ask>
          <close_ask>1.1221</close_ask>
          <min_bid>1.12169</min_bid>
          <max_bid>1.12199</max_bid>
          <open_bid>1.12169</open_bid>
          <close_bid>1.12199</close_bid>
      </item>
      <item>
          <time>1577836860</time>
          <min_ask>1.12181</min_ask>
          <max_ask>1.12182</max_ask>
          <open_ask>1.12181</open_ask>
          <close_ask>1.12181</close_ask>
          <min_bid>1.12169</min_bid>
          <max_bid>1.12169</max_bid>
          <open_bid>1.12169</open_bid>
          <close_bid>1.12169</close_bid>
      </item>
      <item>
          <time>1577836920</time>
          <min_ask>1.12181</min_ask>
          <max_ask>1.12182</max_ask>
          <open_ask>1.12181</open_ask>
          <close_ask>1.12181</close_ask>
          <min_bid>1.12169</min_bid>
          <max_bid>1.12169</max_bid>
          <open_bid>1.12169</open_bid>
          <close_bid>1.12169</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
  1577836800,1.12182,1.1221,1.12182,1.1221,1.12169,1.12199,1.12169,1.12199
  1577836860,1.12181,1.12182,1.12181,1.12181,1.12169,1.12169,1.12169,1.12169
  1577836920,1.12181,1.12182,1.12181,1.12181,1.12169,1.12169,1.12169,1.12169
  ```
</ResponseExample>
