Live Exchange Rates.
This endpoint is used to get the current rate for which a base currency exchanges with other currencies. For example, The rate for which USD exchanges for CAD or BRL
Description
The ExchangeRatesAPI.live()
method is used to communicate with this endpoint as seen below:
ExchangeRatesAPI.live(base, Optional[target])
Query Parameters
Below are the query parameters for this method:
The base currency to get the latest exchange rates for, e.g GBP. It must be a currency code supported by AbstractAPI.
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 will limit the response data to the specified currency codes.
Usage
Below is a code snippet to query the ExchangeRatesAPI.live()
method:
Below is the response object:
Response Fields
The base currency used to make the request
A Unix timestamp of when the returned data was last updated
A JSON object of currencies supported by AbstractAPI and their rates. Response is limited if target currencies are specified in the request.
The status code of the response.
Limit response data
You can limit the response data 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: