get_goldprice_from_interval: Retrieves the gold prices from a specific interval.

View source: R/endpoint_goldprice.R

get_goldprice_from_intervalR Documentation

Retrieves the gold prices from a specific interval.

Description

Retrieves the gold prices from a specific interval.

Usage

get_goldprice_from_interval(from, to)

Arguments

from

start day of the interval.

to

end day of the interval.

Details

As gold prices are not published on the weekends fetching values from an interval containing a weekend will result in a response that omits those days.

Value

nbp_api_response object containing the gold prices from the specified interval.

See Also

https://api.nbp.pl/#cenyZlota

Other goldprice: get_current_goldprice(), get_goldprice_from(), get_last_n_goldprices(), get_todays_goldprice()

Examples


tryCatch(
  {
    ## Fetch the gold prices from the past week
    response <- get_goldprice_from_interval(Sys.Date() - 7, Sys.Date())
    ## Preview response content
    response$content
  },
  error = function(e) message(e)
)



szymanskir/rnbp documentation built on April 12, 2025, 8:51 p.m.