get_todays_goldprice: Retrieves the gold price that was published today.

View source: R/endpoint_goldprice.R

get_todays_goldpriceR Documentation

Retrieves the gold price that was published today.

Description

Retrieves the gold price that was published today.

Usage

get_todays_goldprice()

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.

Value

nbp_api_response object containing today's gold price.

See Also

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

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

Examples


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



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