Learn R Programming

ArgentinAPI (version 0.1.0)

get_usd_exchange_rates: Get USD Exchange Rates from Argentina's Currency Markets

Description

This function retrieves the latest exchange rates of the US dollar (USD) from multiple currency exchange houses in Argentina, using the public API `https://api.argentinadatos.com/v1/cotizaciones/dolares`. The results are sorted in descending order by date (most recent first).

Usage

get_usd_exchange_rates()

Arguments

Value

A data frame (tibble) with the following columns:

  • casa: Name of the exchange house (e.g., Blue, Oficial, Mayorista).

  • compra: Buying rate (numeric).

  • venta: Selling rate (numeric).

  • fecha: Date of the rate (Date format).

Details

The function connects to the ArgentinaDatos API to obtain current USD exchange rates. It arranges the results in descending order by date, making recent data easier to access.

See Also

Examples

Run this code
if (FALSE) {
# Get latest USD exchange rates
rates <- get_usd_exchange_rates()
head(rates)  # Shows the most recent ones first

# Filter for the year 2025
rates_2025 <- dplyr::filter(rates, lubridate::year(fecha) == 2025)
}

Run the code above in your browser using DataLab