date: date from which the gold price should be fetched.
Returns
nbp_api_response object containing the gold price from the specified date.
Details
As gold prices are not published on the weekends fetching values from a weekend date will result in a 404 error. In those cases the function returns an error with an appropriate message.
Examples
tryCatch({## Fetch the gold price from a week ago response <- get_goldprice_from(Sys.Date()-7)## Preview response content response$content
}, error =function(e) message(e))