Rblp / Rblpapi

R package interfacing the Bloomberg API from https://www.bloomberglabs.com/api/
Other
167 stars 75 forks source link

Bdp returns NA value for id_bb_company #376

Closed hanseatischer closed 1 year ago

hanseatischer commented 1 year ago

Hi everyone,

I just started using Rblpapi on my laptop at work and as a first exercise I would need to query the field "ID_BB_COMPANY" for a vector of ISINs. An example of my query would be something like:

bdp(c("US47102XAJ46", "NL0000337319", "GB0000811801"), c("id_bb_company"))

Unfortunately this query returns only NAs. I also tried via BQL in Excel and it works fine there. So it does not seem to be an issue of permissions, data limits or something similar, but I cannot get what is wrong here or what I should check.

Any suggestion would be really appreciated.

Thanks!

johnlaing commented 1 year ago

Usually a yellow key (corp, govt, mtge) is required with the identifier. Try that and see if it works, see examples for guidance.

eddelbuettel commented 1 year ago

Yes, I think there are also older issue tickets with the same. For some reason the way we query the API seems to require this and we cannot just throw in a yellow key as some symbols exists in several contexts...

mtkerbeR commented 1 year ago

Alternatively, one can prepend the isin with "/isin/", i.e.

bdp(paste0("/isin/", c("US47102XAJ46", "NL0000337319", "GB0000811801")), c("id_bb_company"))

hanseatischer commented 1 year ago

@mtkerbeR Thanks! This solved my issue. Since I do not have any other identifier, I needed to use just the ISIN.

It was a really useful hint that I could not find anywhere else!