How to get the field names for ek.get_timeseries method?

Current, I am extracting the Price and OpenInterest data for a voluntary carbon credit product using the following formulas in excel:

=@RHistory("ONGZ2",".Timestamp;.Close","START:01-Mar-2021 INTERVAL:1D",,"SORT:ASC TSREPEAT:NO CH:IN;Fd",B2)


=@RHistory("ONGZ2","OPINT_1.Timestamp;OPINT_1.Value","START:30-Jul-2021 INTERVAL:1D",,"TSREPEAT:NO SORT:ASC CH:IN;Fd",G3)


Now, I want to get this data in python using the eikon-python api.

df= ek.get_timeseries('ONGZ2', fields=['Close'], start_date=startDate,end_date=endDate)

I now the filed name for Price as 'Close' but can't find the field name for 'Open interest' column. the codebook only suggest the code using get_data() method but now get_timeseries()

How do I find the appropriate field name here?

Best Answer

  • Gurpreet
    Answer ✓

    Hi @Mohit.Rai,

    The get_timeseries API only returns the intervalalized bar data - i.e. Open/High/Low/Close etc. You can omit the fields parameter to get all the available fields. Others besides the bar fields, like Open Interest, etc are not available in timeseries API.


Answers

  • @Gurpreet Thanks for quick response. Could you kindly guide me how can I get combination of timestamp, Close price and Volume using the python api?

    Maybe using the get_data() method?

  • get_data does not go that far in history. Here is how you could get it to recent months:


    1658414422819.png