Skip to main content
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.
This guide primarily focuses on the JSON response structure. For details on CSV and XML formats, please refer to the Response Formatting guide.

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

Property Definitions

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

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

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.