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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
166 10 17 21

'get_data' returns different results when 'end date' is not specified

Please take a look at the following two requests. First:

df1, err =eikon.get_data('CRH.L', ["TR.CAEffectiveDate","TR.CAAdjustmentFactor"],{"SDate":"20030101","EDate":"20180520", "Scale": 6,"FRQ": "D"})

The output is:

Second, when leaving the 'end date' out:

df2, err=eikon.get_data('CRH.L', ["TR.CAEffectiveDate","TR.CAAdjustmentFactor"],{"SDate":"20030101","Scale": 6,"FRQ": "D"})

The output is:

The second one is completely different and not correct. Can this be fixed please? Thanks!

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
df1.jpg (10.1 KiB)
df2.jpg (8.3 KiB)
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.

1 Answer

Upvotes
Accepted
39.2k 75 11 27

@Joris.Hoendervangers
I'm not convinced the result you got is unexpected. As far as I can see for capital change history when you specify only one of the SDate or EDate parameters the service interprets the SDate as the near date and EDate as the far date relative to today. So, when you only provide SDate the service returns the events that occurred prior to the SDate. And when you only provide EDate it returns the events that occurred since the EDate. In your example when you only provide SDate the service returned the only capital change event this stock had prior to 01-Jan-2003, which happened in 2001.

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.

Thanks Alex. Changing SDate to EDate in the second request gives indeed the same output as the first request. I would think of 'start date' in calendar days rather than relative to today. Perhaps a bit confusing for some...

It is unfortunate that the API documentation for get_data does not even mention the two parameters SDate and EDate: https://docs-developers.refinitiv.com/1592335675449/14684/book/en/eikon/index.html#get_data

They're not mentioned because they're not arguments of get_data method. The keyword argument of get_data method, where these parameters may sometimes be utilized, is "parameters", which is indeed mentioned in the documentation for get_data method you referenced. Just like the field names you can utilize in the "fields" keyword argument of get_data method, SDate and EDate parameters are part of the metadata for Eikon Data APIs. Due to sheer size of this metadata (tens of thousands of fields, each with its own set of applicable parameters), it is impossible to include the metadata in the docstrings for get_data method. To learn how to go about metadata discovery for use with Eikon Data APIs, see this tutorial. We recently introduced a new app in Eikon named CodeCreator. This app greatly simplifies the task of writing code for data retrieval expressions, as it introduces the capability to create code snippets, which you can copy & paste into your IDE, into content discovery tools.

Thank you both for your helpful input! The CodeCreator is great tool to know, good work!

Hi @sdittmar

You can refer to this tutorial on "Data Item Browser" tool.

https://developers.refinitiv.com/eikon-apis/eikon-data-api/learning?content=14707&type=learning_material_item


The API document mentions about using this "Data Item Browser" tool to find the supported parameters.


ahs.png (116.3 KiB)
Click below to post an Idea Post Idea