knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
freecurrencyapi
is the official package for accessing currency conversion data from freecurrencyapi.com. The API requires a registered API key. You can register an API key here.
The full API documentation can be found here
After registering your API key, set your API key locally by calling the helper function freecurrencyapi_api_key()
or by manually calling Sys.setenv(FREECURRENCYAPI_API_KEY = <key>)
.
Call get_latest_exchange_rates()
to retrieve the most recent exchange rates. By default, USD
is set as base_currency
. For API keys related to the free plan, data is updated daily, for premium plans up to minutely.
Call get_supported_currencies
to retrieve a list of all currencies that are supported by the API.
get_api_status()
- can be used to check whether the API is available. Requests do not count towards your monthly request volume. Information about your API key are provided.get_latest_exchange_rates()
- provides you with the latest exchange rates. get_supported_currencies()
- provides a list of all currencies that are supported by the API.get_historical_exchange_rates()
- provides exchange rate for a historical exchange rates for a given date. Please read our API documentation for all information.
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.