Learn R Programming

rnbp (version 0.2.2)

get_todays_goldprice: Retrieves the gold price that was published today.

Description

Retrieves the gold price that was published today.

Usage

get_todays_goldprice()

Arguments

Value

nbp_api_response object containing today's gold price.

Details

If today's data is not available the API will return a 404 Not found error. In that case the function will return an error with an appropriate message.

See Also

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

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

Examples

Run this code
# \donttest{
tryCatch(
  {
    ## Fetch todays gold price
    response <- get_todays_goldprice()
    ## Preview response content
    response$content
  },
  error = function(e) message(e)
)
# }

Run the code above in your browser using DataLab