Client requests how to develop in CODEBOOK to programmatically access a daily list of the latest (new) corporate bond issuances
We have seen content_search.ipynb under examples in codebk but unsure how to proceed with clients request
Hi @Marc_Belen24, Thank you for reaching out! Yes, you can do this elegantly using the LSEG Data Library for Python.
The easiest way to build your query is to use the Advanced Search app in LSEG Workspace - apply your filters on-screen (asset type, issue date, currency, etc.), then use the "Export Query" option to get the exact API call. From there, simply make the date dynamic in your code: Note: I have IssueDate greater than today. You can change as per your need.
import lseg.data as ld import datetime ld.open_session() today = datetime.date.today().strftime("%Y-%m-%d") response = ld.discovery.search( view=ld.discovery.Views.GOV_CORP_INSTRUMENTS, top=100, filter=f"(DbType eq 'CORP' and IsActive eq true and IssueDate gt {today})", select="RIC,ISIN,DTSubjectName,CouponRate,MaturityDate,IssueDate,RCSCurrencyLeaf,RCSCountryLeaf,FaceIssuedUSD", order_by="IssueDate desc" ) print(response)
What's happening here:
datetime.date.today()
select
top
I would also recommend reading the three articles mentioned below for detailed functioning of the search query/app.
Please let me know if this helps. Thanks : )