Search code examples
rdataframerblpapi

"Duplicated securities submitted"; applying api calls through a small dataframe


I'm trying to find some codes for a few securities currently stored in a dataframe.

Frame is of the following pattern:

tibble [1x 1] (S3: tbl_df/tbl/data.frame)
$ Bloomberg Code: chr [1:6] "BondISIN1" "BondISIN2" "BondISIN3" "BondISIN4" "BondISIN5" "BondISIN6"

I want to feed these codes into a API call so I can find their BB ids as follows (bds has also been tried):

bdp(df$`Bloomberg Code`,"ID_BB")

I this and received:

Error: Duplicated securities submitted.

I tried:

for(isin in 1:length(df$`Bloomberg Code`)){
  thing[[isin]] <- bdp(df$`Bloomberg Code`, 
               'ID_BB', 
               overrides = periods[isin, ]
               )
}

And got the same issue. Does anyone have any ideas on how to fix this?


Solution

  • Seems the best way to do it is by:

    bdp(unique(df$`Bloomberg Code`), "ID_BB")