Skip to contents

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()

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.

Note

Requires an internet connection. Results may vary depending on API availability.

See also

Examples

if (FALSE) { # \dontrun{
# 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)
} # }