Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
166 13 18 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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apiconstituents
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.

Upvote
Accepted
79.1k 250 52 74

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 512.0 KiB each and 1.0 MiB total.

Upvote
166 13 18 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 512.0 KiB each and 1.0 MiB total.

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.