question

Upvotes
Accepted
3 3 3 7

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?

eikoneikon-data-apipython apicodebook
icon clock
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

· Write an Answer
Upvote
Accepted
24.7k 64 15 21

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.


icon clock
10 |1500

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

@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

1658414422819.png (83.8 KiB)

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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