WS API How to Retrieve MBS, ABS, and Corporate Bond by Country or Currency

Currently, Our client is looking to obtain data on U.S. MBS (Mortgage-Backed Securities), ABS (Asset-Backed Securities), as well as corporate bonds categorized by country or currency.

Until now, he has been using the following method to retrieve government bond data. However, he have not been successful in acquiring MBS and similar data. Would it be possible for you to advise me on the appropriate approach in order to get this list?

     result = rd.discovery.search(

            view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,

            filter = f"RCSCurrencyLeaf eq '{currency}' and RCSTRBC2012Leaf eq 'Government & Government Finance' and AssetState eq 'AC'",

            select = "DTSubjectName, RIC, ISIN, RCSAssetCategoryLeaf, AssetState, RCSCurrencyLeaf, DocumentTitle, MaturityDate, Identifier, RCSDomicileGenealogy",

            top = 10000,

        )

 

        response = search.Definition(

            view = search.Views.GOV_CORP_INSTRUMENTS,

            top = 10000,

            filter = f"(DbType eq 'GOVT' and RCSAssetCategory eq 'A:J' and (RCSDomicileGenealogy in ('{area}')))",

            select = "RIC,EJVAssetID,DTSubjectName,BusinessEntity,PI,SearchAllCategoryv3,SearchAllCategoryv2,SearchAllCategory,DBSTicker,CouponRate,MaturityDate,IssueDate,ISIN,RCSCurrencyLeaf,RCSCountryLeaf,DbTypeDescription,InstrumentTypeDescription,RCSCouponTypeGenealogy,FaceIssuedUSD,RCSBondGradeLeaf,RCSDomicileGenealogy"

            ).get_data()

image.png

I tried to do like above, but I can not find the parameters something like country_name or decimile, etc in order to filter by countriy(and currency)

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @kunitaka

    Thank you for reaching out to us.

    This forum is dedicated to software developers using LSEG APIs. The moderators on this forum do not have deep expertise in every bit of content available through LSEG products, which is required to answer content questions such as this one.

    The best resource for content questions is the Helpdesk support team, which can be reached by submitting queries through LSEG Support. The support team will either have the required content expertise ready available or can reach out to relevant content experts to get the answer for you.

    You can use the following code to get all fields for each search view.

    from refinitiv.data.content import search
    ,,,
    response = search.metadata.Definition(
        view = search.Views.MORTGAGE_INSTRUMENTS 
    ).get_data()
    
    response.data.df
    
  • Jirapongse
    Jirapongse ✭✭✭✭✭

    I found some country fields in the MORTGAGE_INSTRUMENTS view.

    image.png
  • cppd
    cppd Newcomer

    Thank you for your response.

    I would like to ask an additional question, if I may.

    Regarding the US MBS acquired through MORT, the RIC field is returned blank. Would it be possible for you to advise us on how to obtain this information (or alternatively, are these instruments that do not have RICs)?

    Thank you for your time and assistance.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @cppd

    This forum is dedicated to software developers using LSEG APIs. The moderators on this forum do not have deep expertise in every bit of content available through LSEG products, which is required to answer content questions such as this one.

    The best resource for content questions is the Helpdesk support team, which can be reached by submitting queries through LSEG Support. The support team will either have the required content expertise ready available or can reach out to relevant content experts to get the answer for you.

    Please include the URL of this discussion in your raised question to prevent it from being redirected back to this Q&A forum.

    Otherwise, please share the code that you are using. I can check if it returns blank for the RIC field.

  • cppd
    cppd Newcomer

    Thank you very much for your response.
    Please find below the sample code for your reference.
    In this case, I believe that only the RIC field would not be included in the output results.
    I would greatly appreciate your assistance with this matter.

    MBS_list = rd.discovery.search(
    view = rd.discovery.Views.MORTGAGE_INSTRUMENTS,
    filter = f"RCSIssuerCountryLeaf eq 'United States' and IssueDate ge {start_date} and IssueDate le {end_date}",
    select = "ISIN, RIC, CouponRate, CouponFrequency, DbType, IssuerCommonName, IssueDate, MaturityDate, Price, RCSCouponType, RCSCurrency, RCSCurrencyLeaf, RCSIssuerCountryLeaf",
    top=100,
    )

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @cppd

    Is it the RRPSRic field?

    start_date = "2025-01-01"
    end_date = "2025-08-01"
    MBS_list = ld.discovery.search(
        view = ld.discovery.Views.MORTGAGE_INSTRUMENTS,
        filter = f"RCSIssuerCountryLeaf eq 'United States' and IssueDate ge {start_date} and IssueDate le {end_date}",
        select = "ISIN, RIC, RRPSRic, CouponRate, CouponFrequency, DbType, IssuerCommonName, IssueDate, MaturityDate, Price, RCSCouponType, RCSCurrency, RCSCurrencyLeaf, RCSIssuerCountryLeaf",
        top=100,
        )
    MBS_list