# Range Historical Exchange Rates

Returns a range of exchange rates. Generally, we provide data going back to 1999.

Switching Accuracy

Depending on your subscription plan you can request different accuracies: day, hour, quarter_hour, minute

Plan required

The range endpoint is not part of every plan. Depending on your plan you may also receive a 403 status code when

  • your plan does not include the range endpoint at all,
  • you request an accuracy that is above your plan (e.g. You are not allowed to use the accuracy: minute), or
  • your plan limits range requests to a single currency and you request more than one (You are not allowed to request more than one currency).
{
    "message": "You are not allowed to use the range endpoint, please upgrade your plan",
    "info": "For more information, see documentation: https://fxapi.com/docs/status-codes#_403"
}

To lift these limits please upgrade your plan (opens new window).

Request Method: GET
Request URL: https://api.fxapi.com/v1/range

# Request Parameters

Parameter Type Mandatory Description
apikey string Your API Key
datetime_start string Datetime for the start of your requested range (format: 2021-12-31T23:59:59Z / ISO8601 Datetime)
datetime_end string Datetime for the end of your requested range (format: 2021-12-31T23:59:59Z / ISO8601 Datetime)
accuracy string The accuracy you want to receive.
Possible Values: day, hour, quarter_hour, minute
Default: day
For valid time ranges see below
base_currency string The base currency to which all results are behaving relative to
By default all values are based on USD
currencies string A list of comma-separated currency codes which you want to get (EUR,USD,CAD)
The array form currencies[]=EUR&currencies[]=USD is also accepted
By default all available currencies will be shown
type string Filter the returned currencies by type
Possible Values: fiat, metal, crypto
By default currencies of all types are returned

# Valid Accuracy Time Ranges

# day

  • not more than 366 days between start and end (you can go back as far as 1999)

# hour

  • not more than 7 days between start and end
  • not more than 3 months back

# quarter_hour

  • not more than 24 hours between start and end
  • not more than 7 days back

# minute

  • not more than 6 hours between start and end
  • not more than 7 days back

# Sample Response

The API response comes with an easy-to-read JSON format and contains currency pairs for all supported world currencies.

The datetime in each object holds the datetime when the entry was last updated. Daily accuracy would result in end-of-day values and accuracy of an hour would result in end-of-hour values, and so on.

{
    "data": [
        {
            "datetime": "2022-01-01T23:59:59Z",
            "currencies": {
                "AED": {
                    "code": "AED",
                    "value": 3.67306
                },
                "AFN": {
                    "code": "AFN",
                    "value": 91.80254
                },
                "ALL": {
                    "code": "ALL",
                    "value": 108.22904
                },
                "AMD": {
                    "code": "AMD",
                    "value": 480.41659
                },
                "...": "150+ more currencies"
            }
        },
        {
            "datetime": "2022-01-02T23:59:59Z",
            "currencies": {
                "AED": {
                    "code": "AED",
                    "value": 3.67306
                },
                "AFN": {
                    "code": "AFN",
                    "value": 91.80254
                },
                "ALL": {
                    "code": "ALL",
                    "value": 108.22904
                },
                "AMD": {
                    "code": "AMD",
                    "value": 480.41659
                },
                "...": "150+ more currencies"
            }
        },
        {
            "datetime": "2022-01-03T23:59:59Z",
            "currencies": {
                "AED": {
                    "code": "AED",
                    "value": 3.67306
                },
                "AFN": {
                    "code": "AFN",
                    "value": 91.80254
                },
                "ALL": {
                    "code": "ALL",
                    "value": 108.22904
                },
                "AMD": {
                    "code": "AMD",
                    "value": 480.41659
                },
                "...": "150+ more currencies"
            }
        }
    ]
}