Hello, I would like to replicate this query for bonds within a Jupyter notebook using our API key. Can you please guide me on how i could do so?
rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10,
filter = "(DbType eq 'CORP' and RCSAssetCategory eq 'A:1A' and IsActive eq true and (RCSBondGradeLeaf eq '"Investment Grade"' or RCSBondGradeLeaf eq '"High Yield"' or RCSBondGradeLeaf ne '"Investment Grade"' and RCSBondGradeLeaf ne '"High Yield"') and (InstrumentTypeDescription xeq 'Commercial Paper' and RCSCurrencyLeaf eq 'US Dollar' and IndustrySubSectorDescription in ('Utility - Other' 'Oil and Gas' 'Oilfield Machinery and Services' 'Gas Utility - Pipelines' 'Service - Other' 'Pharmaceuticals' 'Cable/Media' 'Retail Stores - Food/Drug' 'Health Care Facilities' 'Retail Stores - Other' 'Health Care Supply' 'Lodging' 'Leisure' 'Restaurants' 'Electronics' 'Chemicals' 'Machinery' 'Conglomerate/Diversified Mfg' 'Industrials - Other' 'Information/Data Technology' 'Vehicle Parts' 'Containers' 'Aerospace' 'Building Products' 'Textiles/Apparel/Shoes' 'Automotive Manufacturer' 'Food Processors' 'Beverage/Bottling' 'Consumer Products' 'Gas Utility - Local Distrib' 'Telecommunications' 'Railroads' 'Transportation - Other' 'Publishing' 'Tobacco') and ((RatingsScope(RatingType eq 'MCP' and CurrentRatingRank ge 1 and CurrentRatingRank le 98)) or (RatingsScope(RatingType eq 'FCP' and CurrentRatingRank ge 1 and CurrentRatingRank le 8)))))",
select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,DescriptionDetail,IsExecutableQuoted,FaceIssuedTotal,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,FaceOutstanding,WorstStandardYield,MaturityStandardYield,OptionAdjustedSpread,RCSDomicileLeaf,IndustrySubSectorDescription,RCSConvertibleLeaf,IsCallable,IsPutable,IsSinkable,BorrowerName,IsActive,InstrumentTypeDescription,IsPayInKind,RCSBondGradeLeaf,RCSCouponTypeGenealogy,CUSIP,IsPerpetualSecurity,IssuePrice,RatingsScope(filter:((RatingType xeq 'MCP') or (RatingType xeq 'FCP'))),RatingX1XRatingRank",
order_by = "IndustrySubSectorDescription,InstrumentTypeDescription"
)
rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10,
filter = "(DbType eq 'CORP' and IsActive eq true and ((MaturityDate ge 2025-08-23 and MaturityDate le 2042-08-23) and RCSCurrency eq 'C:6' and DbTypeDescription xeq 'Corporate' and MaturityStandardYield gt 0.0000000 and IsExecutableQuoted eq true and IsPutable eq false and IsSinkable eq false and IsCallable eq false and ((RatingsScope(RatingType eq 'MDY' and CurrentRatingRank ge 4 and CurrentRatingRank le 19 and Preliminary eq 'n')) or (RatingsScope(RatingType eq 'FTC' and CurrentRatingRank ge 5 and CurrentRatingRank le 20 and Preliminary eq 'n')))))",
select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,DescriptionDetail,IsExecutableQuoted,FaceIssuedTotal,RCSCurrencyLeaf,RCSCountryLeaf,RCSDomicileLeaf,DbTypeDescription,FaceOutstanding,WorstStandardYield,MaturityStandardYield,OptionAdjustedSpread,IndustrySubSectorDescription,RCSConvertibleLeaf,IsCallable,IsPutable,IsSinkable,BorrowerName,IsActive,InstrumentTypeDescription,IsPayInKind,RCSBondGradeLeaf,RCSCouponTypeGenealogy,CUSIP,IsPerpetualSecurity,IssuePrice,RatingsScope(filter:((RatingType xeq 'MDY') or (RatingType xeq 'MDY.Actual') or (RatingType xeq 'FTC.Actual') or (RatingType xeq 'MDY.Outlook') or (RatingType xeq 'FTC.Outlook') or (RatingType xeq 'MDY.Watch') or (RatingType xeq 'FTC') or (RatingType xeq 'FTC.Watch') or (RatingType xeq 'MDY' and Preliminary xeq 'n') or (RatingType xeq 'FTC' and Preliminary xeq 'n'))),RatingX1XRatingRank,RCSCurrency"
)
I want to access these search results through a Jupyter notebook using our API