Use DSS api from a python call

sumit
sumit Explorer

hi,

I have the below code to fetch EOD data via eikon api. I frequently end up with connectivity issues - sometimes no data retireved, sometime partial data retrieved.

I have been asked to use DSS api instead. Can you please provide me with a alternate version of ek.get_data()? My code is:-

ek.set_app_key("2580e18557624af8a1ab810fc5012449982e0407")
isin_list = ['US911312BW51', 'US836205AT15', 'US015271AU38']
date_str = '2024-06-30'

df, err = ek.get_data(
instruments=isin_list,
fields=reuters_fields,
parameters={
'SDate': date_str,
'CH': 'IN;Fd',
'RH': 'date',
'EventType': 'ALL'
}
)

Answers

  • sumit
    sumit Explorer

    The Reuters fields that I am looking to extract as-of a given historical date are:-

     reuters_fields = [
    'TR.ZSPREAD', 'TR.MODIFIEDDURATION', 'TR.YIELDTOMATURITY',
    'TR.FiIndustrySector', 'TR.FiCountry', 'TR.FiCurrency',
    'TR.FiMaturityDate' # 'TR.FiMoodysRating', 'TR.FiIssuerFitchLongRating'
    ]
  • sumit
    sumit Explorer

    Going through the tutorials and other posts in this forum, I've managed to come up with a python code to connect to DSS Rest API and get the pricing info. Shown below is my request payload:

    {"ExtractionRequest": 
        {"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.PriceHistoryExtractionRequest", 
        "ContentFieldNames": ["Z Spread", "Modified Duration", "Bid Yield", "ISIN", "RIC", "Trade Date"], 
        "IdentifierList": 
             {"@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", 
              "InstrumentIdentifiers": 
                    [{"IdentifierType": "Isin", "Identifier": "US911312BW51"}, 
                     {"IdentifierType": "Isin", "Identifier": "US836205AT15"}]}, 
                "Condition": 
                  {"QueryStartDate": "2024-06-30T00:00:00.000Z", "QueryEndDate": "2024-07-02T00:00:00.000Z"}}}
    

    However, I couldn;t find any examples on how to extract:-

    1. Issuer (Ex: AAPL, MSFT)
    2. Issuer sector (Ex: Auto / Manu etc)
    3. Country Iso code of Issuance (Ex: US, EU, BR etc)

    What is the end-point I should target for these end-of-day non price related information?

    Thanks

  • sumit
    sumit Explorer

    I tried the below request, but I get a aut

    "ExtractionRequest": 
    {
        "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.OwnershipExtractionRequest",
        "ContentFieldNames": ["Issuer Name", "Currency Code", "Issuer Sector", "Owner Type", "Owner Country"], 
        "IdentifierList":{
           "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",
            "InstrumentIdentifiers": [{"IdentifierType": "Isin", "Identifier": "US911312BW51"}, {"IdentifierType": "Isin", "Identifier": "US836205AT15"}]}
    }
    

    I get the below error:

    Exception occurred: Error: Status Code:403 Message:{"error":{"message":"No permission for template \"OwnershipReportTemplate\"."}}
    

    Am I on the right track?

    Thanks,

    Sumit

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @sumit

    Thank you for reaching out to us.

    According to the error (No permission for template), this indicates that your account don't have a permission to use the OwnershipExtractionRequest report template. Please contact your LSEG account team or Sales team directly to verify this.

    To find the required fields, you can refer to the LSEG DataScope Select Data Content Guide that provides definitions of all of the data fields available in LSEG DataScope Select. Otherwise, you can contact the DSS support team directly via MyAccoutnt and ask for fields and report templates that can provide the required data.