How to retrieve bond data using a huge list of Tickers?

Using Eikon API, I extracted a huge list of Tikers, which contains all green bond issuers before 2023 (n=2370). The following is the command I used.

response=search.Definition(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top=8172,
filter = "((DbType eq 'GOVT' or DbType eq 'CORP' or DbType eq 'AGNC' or DbType eq 'OMUN' or DbType eq 'OTHR') and (IsGreenBond eq true and IssueDate lt 2023-01-01))",
select = "RIC,IsGreenBond,DBSTicker,ISIN"
).get_data()

df = response.data.df.sort_values(by='DBSTicker')
df=(
df
.sort_values (['DBSTicker'])
.drop_duplicates(['DBSTicker'],keep='first')
)
df=df['DBSTicker']
print(df)

I would like to retrieve a list of all bonds issued (2004-2022) by all green bond issuers using the list of Tickers I extracted. Is there any good way without retrieving a bond list of each issuer one by one.

Best Answer

  • m.bunkowski
    Answer ✓

    Hi @haruo.ogawa

    You can try the below but you would still need to add some additional filters as the response contains 2m+ results.

    tickers = "'"+"' '".join(df.tolist())+"'"

    response=search.Definition(
    view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
    top=10,
    filter = f"DBSTicker in ({tickers}) and IssueDate lt 2022-12-31 and IssueDate gt 2004-01-01",
    select = "RIC,IssueDate"
    ).get_data()

Answers