Time series of economic events using Python API

I would like to retrieve a time series of economic events using Python. The following works for getting the most recent values.

fields= ['TR.IndicatorName', 'TR.IndicatorType', 'TR.IndicatorSource',
    "ACT_STA_DT","ACT_END_DT","ECI_ACT_DT","ACT_VAL_NS","RELEVANCE","RTR_POLL",
    "ECON_ACT","UNIT_PREFX","RPT_UNITS","ECON_PRIOR","PRIOR_REV","FCAST_LOW",
    "FCAST_HIGH","FCAST_NUM","FCAST_SEST","FCAST_ACRY"]

df, e = ek.get_data('EUGDQY=ECI', fields=fields)

Is it possible to retrieve the available time series for a given indicator using the python api? Using the app it is possible to export the time series into an excel file.

Best Answer

  • jason.ramchandani01
    Answer ✓

    Hi @niskrev - Thanks for your question. Yes it is possible to receive a timeseries history for economic indicators using the get_timeseries api. You need to specify the correct interval - most economic indicators are either monthly or quarterly.

    df = ek.get_timeseries(['EUGDQY=ECI'],start_date='2010-03-01',end_date='2020-04-26',interval='quarterly')
    df

    However, due to the reduced data model in our current timeseries API (OHLCVc) you will not be able to get those fields other than the value of the indicator itself with the Eikon Data API.

    I hope this can help.

Answers