Package 'freecurrencyapi'

Title: Client for the 'freecurrencyapi.com' Currency Conversion API
Description: An R client for the 'freecurrencyapi.com' currency conversion API. The API requires registration of an API key. You can find the full API documentation at <https://freecurrencyapi.com/docs> .
Authors: Dominik Kukacka [aut, cre]
Maintainer: Dominik Kukacka <[email protected]>
License: MIT + file LICENSE
Version: 0.1.0
Built: 2025-02-04 04:24:28 UTC
Source: https://github.com/cran/freecurrencyapi

Help Index


Freecurrencyapi API Key

Description

freecurrencyapi.com requires authentication via an API key. For this package, the API key is saved as a environmental variable. In interactive mode, using freecurrencyapi_api_key will require you to enter an API key. Alternatively, you can also use Sys.setenv(FREECURRENCYAPI_API_KEY = <key>) to set the API key manually.

Usage

freecurrencyapi_api_key(force = FALSE)

Arguments

force

If TRUE, resets the API key & requires the user to provide a new API key. If FALSE and an API key already exists, the key will be printed to the console. If no key exists, you will be required to enter a key. force. Defaults to FALSE.

Value

Returns the set API key that has been stored as an enviroment variable.


Get the current status of the API.

Description

Get the current status of the API.

Usage

get_api_status()

Value

Returns your current quota. Requests to this endpoint do not count against your quota or rate limit.


Get historical exchange rates for a specific date for a single or multiple currencies.

Description

Get historical exchange rates for a specific date for a single or multiple currencies.

Usage

get_historical_exchange_rates(date, base_currency = NULL, currencies = NULL)

Arguments

date

(required) Date to retrieve historical rates from (format: 2021-12-31)

base_currency

The base currency for the conversion (e.g., "USD")

currencies

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

Value

Returns exchange rates for a given time range. Generally, we provide data going back to 1999.


Get exchange rate from the Freecurrencyapi.com API

Description

Get exchange rate from the Freecurrencyapi.com API

Usage

get_latest_exchange_rates(base_currency = NULL)

Arguments

base_currency

The base currency for the conversion (e.g., "USD")

Value

Returns the latest currency exchange rates.


Get the current status of the API.

Description

Get the current status of the API.

Usage

get_supported_currencies(currencies = NULL)

Arguments

currencies

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

Value

Returns all our supported currencies.