I am looking to find historical credit ratings for a vast amount of bonds (spanning about 10 years). I can't search for a specific date because they were all issued at different times. When using codebook, I managed to find ratings for a large number of bonds but that was the rating at the time of my search instead of historical.
Here is the code I used -
import eikon as ek
import pandas as pd
ek.set_app_key('...')
isins = [ ]
fields = ['TR.GR.Rating','TR.GR.RatingSourceCode' ]
data, err = ek.get_data(isins, fields)
if err:
print(f"An error occurred: {err}")
else:
print(data)
except Exception as e:
print(f"An error occurred: {e}")
data.to_csv('bond_credit_ratings.csv', index=False)
If anyone knows how to access historical credit ratings for large amounts of bonds at once, please let me know. Any help with this would be very appreciated