Skip to main content
GET
https://api.xchangeapi.com/
{format}
/
chart
/
{currency-pair}
/
{period}
OHLC chart data for selected period
curl --request GET \
  --url https://api.xchangeapi.com/{format}/chart/{currency-pair}/{period} \
  --header 'api-key: <api-key>'
{
    "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
    ]
}
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.
Note on Precision: Some currency pairs are returned with a multiplier (e.g., 100 or 1000) to ensure high precision.

Path parameters

format
string
default:"json"
The desired output format. Options: json, xml, csv.
If you choose xml, you must use the POST method. GET requests for XML will fail.
currency-pair
string
required
The currency pair symbol (e.g., EURUSD). See the list of available currencies.
period
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

Response

Response Structure: For a detailed explanation of the array indices (for JSON) and property definitions, please refer to the Response Structures guide.
ask
string
Array of ask prices.
bid
string
Array of bid prices.
name
string
The currency pair symbol.
time
string
Array of timestamps.
{
    "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
    ]
}