Search code examples
rexcelrblpapi

Pulling bond security names from ISIN in R


I'm trying to convert individual ISINs into their respective bond names in R. I've been able to achieve it in Excel, but weirdly passing the 'bdp' function doesn't seem to work in the desired way in R.

To give an example, I currently have an ISIN for a government bond: GB00BK5CVX03, I would like to dynamically convert said ISIN into the name for this bond (UKT 0.625 06/07/2025 GOVT).

In excel, I do:

=BDP("GB00BK5CVX03 ISIN", "ID_BB_SEC_NUM_DES")

And it delivers a useable result: UKT 0.625 06/07/25

In R, I try pretty much the same thing:

bdp("GB00BK5CVX03 ISIN", "ID_BB_SEC_NUM_DES")

And it delivers:the result (assigned to object)

I was expecting a similar result to the excel output (namely a string that I could then attach to an object).

Does anyone know where I'm going wrong? Any help is much appreciated.


Solution

  • So I managed to solve it, turns out the API will not respond to "ISIN" being at the end of the ISIN, even though it works fine in excel. Therefore changing the code to read:

    bdp("GB00BK5CVX03 GOVT", "ID_BB_SEC_NUM_DES")
    

    Solved the issue.