View source: R/endpoint_goldprice.R
get_goldprice_from_interval | R Documentation |
Retrieves the gold prices from a specific interval.
get_goldprice_from_interval(from, to)
from |
start day of the interval. |
to |
end day of the interval. |
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.
nbp_api_response object containing the gold prices from the specified interval.
Other goldprice:
get_current_goldprice()
,
get_goldprice_from()
,
get_last_n_goldprices()
,
get_todays_goldprice()
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)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.