get_usd_exchange_rates {ArgentinAPI} | R Documentation |
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()
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.
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).
Note
Requires an internet connection. Results may vary depending on API availability.
See Also
Examples
## Not run:
# 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)
## End(Not run)