Historical Exchange.
This endpoint allows you to get exchange rates record for a specific date
Description
The ExchangeRatesAPI.historical()
method is used to communicate with this endpoint as seen below:
ExchangeRatesAPI.historical(base, date, Optional[target])
Query Parameters
Below are the query parameters for this method:
The base currency to be converted. It must be a currency code supported by AbstractAPI.
A specific date in the past that the response must refer to. The acceptable date format is: YYYY-MM-DD, e.g 2005-02-30.
The target currency or currencies that the base currency is converted into. A list of comma separated currency codes is also permitted, e.g “target=USD,CAD,BRL”. This argument will limit the response data to the selected currencies
Usage
Below is a code snippet to query the ExchangeRatesAPI.historical()
method:
Below is the response object:
Response Fields
The base currency used in the request
The specific date the rates were pulled from.
A JSON Object with each target currency as the key and their respective rates as the value.
The status code of the response.
Limit response fields
You can limit the response by specifying a comma-separated list of target currency codes in your query.
Below is a code snippet to limit response data:
Below is the response object: