For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

jonabl avatar image
18 2 4 5

Python API retrieve stock fundamental data specificly to include OriginalAnnouncementDate

Hi, I would like to retrieve the a whole list of stock fundamental data such as Net income, EBIT, Revenue from the HSI constituents. Also, I would like to include the <TR.ISOriginalAnnouncementDate> of each of the historical data from each fiscal year or quarterly data. The below is my code but it wasn't stable:

field_list = [
    {'TR.NetProfitActValue.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.NetProfitActValue': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.EBIT.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.EBIT': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TotalRevenue.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TotalRevenue': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TotalAssetsReported.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TotalAssetsReported': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TotalLiabilities.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TotalLiabilities': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.CashFromOperatingAct.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.CashFromOperatingAct': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.CashDividendsPaidCommon.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.CashDividendsPaidCommon': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.RetainedEarnings.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.RetainedEarnings': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TtlCmnSharesOut.calcdate': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    {'TR.TtlCmnSharesOut': {'params': {
        'Period': 'FY0',
        'frq': freq,
        'scale': '3',
        'SDate': '1D',
        'EDate': '-20',
        'curn': 'CNY',
        }}},
    ]




			

Thank you

eikoneikon-data-apipythonworkspaceworkspace-data-apirefinitiv-dataplatform-eikonapidata
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Zhenya Kovalyov avatar image
4.6k 26 7 22

Try this:

r, e = tr.get_data(["0#.HSI"], fields=['TR.ISOriginalAnnouncementDate',
                                       'TR.NetProfitActValue.calcdate',
                                       'TR.NetProfitActValue', 
                                       'TR.EBIT.calcdate', 
                                       'TR.EBIT', 
                                       'TR.TotalRevenue.calcdate', 
                                       'TR.TotalRevenue', 
                                       'TR.TotalAssetsReported.calcdate', 
                                       'TR.TotalAssetsReported', 
                                       'TR.TotalLiabilities.calcdate', 
                                       'TR.TotalLiabilities', 
                                       'TR.CashFromOperatingAct.calcdate', 
                                       'TR.CashFromOperatingAct', 
                                       'TR.CashDividendsPaidCommon.calcdate', 
                                       'TR.CashDividendsPaidCommon', 
                                       'TR.RetainedEarnings.calcdate', 
                                       'TR.RetainedEarnings', 
                                       'TR.TtlCmnSharesOut.calcdate', 
                                       'TR.TtlCmnSharesOut' ], 
                   parameters={'SDate':0,'EDate':-20,'Period':'FY0', 'Frq':'FY', 'scale':3, 'curn':'CNY'})
2 comments
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@Zhenya Kovalyov Thanks for you reply, it works! But how can I get past 20 years data ? Your code only get the recent data.

@jonabl, try requesting each company individually and see if it helps. EDate:-20 and FRQ:FY implies that the request goes back 20 fiscal years from todays date.