Package 'currencyapi'

Title: Client for the 'currencyapi.com' Currency Conversion API
Description: An R client for the 'currencyapi.com' currency conversion API. The API requires registration of an API key. Basic features are free, some require a paid subscription. You can find the full API documentation at <https://currencyapi.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:39:53 UTC
Source: https://github.com/cran/currencyapi

Help Index


Convert a value to a specific range of other currencies from the Currencyapi.com API. Retrieve the latest exchange rate data or for a specific historic date.

Description

Convert a value to a specific range of other currencies from the Currencyapi.com API. Retrieve the latest exchange rate data or for a specific historic date.

Usage

convert_exchange_rates(
  value,
  date = NULL,
  base_currency = NULL,
  currencies = NULL
)

Arguments

value

(required) The value you want to convert

date

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 calculated values for today or any given date for all or a specific set of currencies.


Currencyapi API Key

Description

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

Usage

currencyapi_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_date_range_historical_exchange_rates(
  datetime_start,
  datetime_end,
  accuracy = NULL,
  base_currency = NULL,
  currencies = NULL
)

Arguments

datetime_start

(required) Datetime for the start of your requested range (format: 2021-12-31T23:59:59Z / ISO8601 Datetime)

datetime_end

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

accuracy

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

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 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 Currencyapi.com API

Description

Get exchange rate from the Currencyapi.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.