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

# Response Structures

> Understand the format and properties of API responses for live and historical data.

The xChangeAPI returns data in two primary structures depending on the type of request: **Live Data** (current exchange rates) and **Historical Data** (past market data).

This guide details the properties and schema for both response types to help you parse and utilize the data effectively.

<Note>
  This guide primarily focuses on the **JSON** response structure. For details on CSV and XML formats, please refer to the [Response Formatting](/docs/guides/response-formatting) guide.
</Note>

## Live Data Structure

Endpoints that provide real-time or latest exchange rates return a JSON object representing the current state of a currency pair.

### Example Response

```json theme={null}
{
    "name": "EURUSD",
    "ask": "1.38488",
    "bid": "1.38477",
    "time": "1398420924.000"
}
```

### Property Definitions

| Property | Type   | Description                                                          |
| :------- | :----- | :------------------------------------------------------------------- |
| `name`   | string | The currency pair symbol (e.g., "EURUSD").                           |
| `ask`    | string | The current lowest price a seller is willing to accept.              |
| `bid`    | string | The current highest price a buyer is willing to pay.                 |
| `time`   | string | Unix timestamp (in seconds) indicating when the quote was generated. |

<Note>
  Prices are returned as strings to preserve decimal precision. Ensure you parse them as floats or decimals in your application logic as needed.
</Note>

## Historical Data Structure

Endpoints providing historical market data (such as OHLC candlesticks) return a dictionary where keys are timestamps and values are arrays containing price data for that period.

### Example Response

```json theme={null}
{
    "1396267200": [
        1.3775,
        1.38071,
        1.37837,
        1.37989,
        1.37738,
        1.38055,
        1.37827,
        1.37976
    ],
    "1396274400": [
        1.37716,
        1.38071,
        1.37789,
        1.37758,
        1.37706,
        1.38059,
        1.37777,
        1.37747
    ]
}
```

### Structure Breakdown

The response is a dictionary object:

* **Key**: A Unix timestamp (string) representing the start of the time period.
* **Value**: An array of 8 floating-point numbers representing the OHLC (Open, High, Low, Close) values for both Ask and Bid prices.

The interval between timestamps corresponds to the requested data **resolution** (e.g., 1 hour, 1 day).

### Array Index Mapping

For **JSON** responses, the values in the array map to the following properties by index.
**XML** and **CSV** responses explicitly use these property names as tags or headers.

| Index | Property    | Description                               |
| :---- | :---------- | :---------------------------------------- |
| 0     | `min_ask`   | Lowest ask price during the period.       |
| 1     | `max_ask`   | Highest ask price during the period.      |
| 2     | `open_ask`  | Ask price at the beginning of the period. |
| 3     | `close_ask` | Ask price at the end of the period.       |
| 4     | `min_bid`   | Lowest bid price during the period.       |
| 5     | `max_bid`   | Highest bid price during the period.      |
| 6     | `open_bid`  | Bid price at the beginning of the period. |
| 7     | `close_bid` | Bid price at the end of the period.       |
