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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
166 10 17 21

Eikon API: Get Data - Constituents as of a certain date

Is it possible to get the constituents of an index at a given date?

In Excel we can use the following formula:

=TR("0#.AEX","TR.RIC","SDate=2016-12-31")

With the Eikon API, this works:

rics, err = eikon.get_data("0#.AEX","TR.RIC")
rics

But this doesn't work:

rics, err = eikon.get_data("0#.AEX","TR.RIC", "SDate=2016-12-31")
rics

It results in the following error:

JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Thank you so much in advance for your help!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonconstituents
icon clock
10 |1500

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

Upvote
Accepted
38.1k 71 35 53

It is similar to this question.

rics, err = ek.get_data(instruments="0#.AEX", fields=["TR.RIC"], parameters={'SDate':'2016-12-31'})
icon clock
10 |1500

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

Upvote
166 10 17 21

Or:

rics, err = eikon.get_data("0#.AEX(2016-12-31)","TR.RIC")
icon clock
10 |1500

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

Click below to post an Idea Post Idea