I would like to use Python to programmatically find the cusips of all bonds that are currently issued by a given equity. Assume I can use any free api and bloomberg. Thank you!
Bloomberg has a Python interface, so this sort of thing is much easier than it used to be when you had to encapsulate the COM or C++ interface. First, set up a
session as in the Bloomberg documentation, then form a
refDataService = session.getService("//blp/refdata") request = refDataService.createRequest("ReferenceDataRequest")
Now set up your data request
request.append("securities", "IBM US Equity") request.append("fields", "BOND_CHAIN")
send the request and wait for the response event. Iterate over the (single security) and (single) field and you will have an iterable of Bloomberg identifiers for the bonds
Probably a lot easier to use the Bloomberg add-ins in excel, write a macro to cycle the equities your looking for and retrieve the associated CUSIPs.