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

  • The code works very well! Thank you so much!
  • To retrieve bond data using a large list of tickers, consider using financial data APIs like Bloomberg, Morningstar, or Yahoo Finance. cox customer support billing These platforms allow batch processing of multiple tickers for efficient data retrieval. Additionally, you can use Python libraries such as pandas with yfinance or requests to automate the process, ensuring you handle large datasets effectively.