quandl / quandl-r

This is Quandl's R Package
https://cran.r-project.org/web/packages/Quandl/
Other
139 stars 55 forks source link

Quandl::Quandl gives QECx05 error #58

Closed hidekoji closed 6 years ago

hidekoji commented 6 years ago

Here is the reproducible step.

API key is masked as for security reason.

load_quandl <- function(code, format = "wide", date_since = NULL) {
  api_key <- Quandl::Quandl.api_key("<my_key>")
  data <- Quandl::Quandl(code, start_date = date_since)
  if (format == "long") {
    num_col <- vapply(colnames(data), function(cname) {
      is.numeric(data[[cname]])
    }, FUN.VALUE = FALSE)
    nums <- colnames(data)[num_col]
    gathered <- data %>% tidyr::gather_("Category", "Value", nums)
    gathered
  } else {
    data
  }
}
load_quandl("GOOG", format = "wide", date_since = NULL)
#> Error: {"quandl_error":{"code":"QECx05","message":"The url you requested is incorrect. Please use the following url instead: /api/v3/datasets/:database_code/:dataset_code."}}
A-Scott-Rowe commented 6 years ago

Hi @hidekoji,

The problem here is two-fold, when using the Quandl::Quandl function you need to provide a Quandl code in the form <DATABASE CODE>/<DATASET CODE>. The other problem is that the GOOG database is no longer available on Quandl. A free alternative is the WIKI database and the premium alternative is the EOD database.

I'll close this issue for now, but if you have any more questions feel free to reopen it or open a new issue.

hidekoji commented 6 years ago

Thank you for the update! I changed the code to pass <DATABASE CODE>/<DATASET CODE> and now it works!