Available in plans >= medium

Range Historical Exchange Rates

On this page, we’ll dive into the range historical exchange rates endpoint you can use to retrieve historical exchange rates for a given time range. Data are available all the way back to 1999.


GET/v3/range

RangeHistorical Exchange Rates

This historical exchange rates endpoint provides currency rates for a specified date range.

Required attributes

  • Name
    datetime_start
    Type
    string
    Description

    Datetime for the start of your requested range (format: 2022-12-01T00:00:00Z / ISO8601 Datetime)

  • Name
    datetime_end
    Type
    string
    Description

    ️ Datetime for the end of your requested range (format: 2022-12-31T23:59:59Z / ISO8601 Datetime)

Optional attributes

  • Name
    accuracy
    Type
    string
    Description

    The accuracy you want to receive. Possible Values: day, hour, quarter_hour, minute Default: day For valid time ranges see below

  • Name
    base_currency
    Type
    string
    Description

    The base currency to which all results are behaving relative to By default all values are based on USD

  • Name
    currencies
    Type
    string
    Description

    A list of comma seperated currency codes which you want to get (EUR,USD,CAD) By default all available currencies will be shown

  • Name
    type
    Type
    string
    Description

    They type of currency you want to get (fiat, metal or crypto) By default all types will be shown

Valid Accuracy Time Ranges

  • Name
    day
    Type
    Description
    • not more than 366 days back
  • Name
    hour
    Type
    Description
    • not more than 7 days between start and end
    • not more than 3 months back
  • Name
    quarter_hour
    Type
    Description
    • not more than 24 hours between start and end
    • not more than 7 days back
  • Name
    minute
    Type
    Description
    • not more than 6 hours between start and end
    • not more than 7 days back

Response Properties

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.

Request

GET
/v3/range
curl -G https://api.currencyapi.com/v3/range?datetime_start=2021-11-30T23:59:59Z&datetime_end=2021-12-31T23:59:59Z&accuracy=day \
    -H "apikey: YOUR-API-KEY"

Full Response

{
    "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"
            }
        }
    ]
}

data   Response Properties

Available in plans >= medium
  • Name
    datetime
    Type
    string
    Description

    The date as a datetime string

  • Name
    currencies
    Type
    object
    Description

    a list of supported currencies can be retrieved by calling the /currencies endpoint

  • Name
    currencies.code
    Type
    string
    Description

    the currency code

  • Name
    currencies.value
    Type
    float
    Description

    the current conversion rate

"data": [
    {
        "datetime": "2022-01-01T23:59:59Z",
        "currencies": {
            "AED": {
                "code": "AED",
                "value": 3.67306
            },
            "AFN": {
                "code": "AFN",
                "value": 91.80254
            },
        }
    },
    ...
]