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
53 6 3 6

API does not return the latest data, seems to be an issue with the API as it does give the correct and recent data in excel

CBOT_BO_c2 = ek.get_timeseries('/BOc2',start_date=dt.datetime(2018,8,10))

gives me only data untill 16th of Aug, was expecting untill today including the 17th.

This holds for all RICs that I am working with.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-apidata
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.

Could you please provide with the screenshot or the log of your output?

Upvotes
Accepted
53 6 3 6

I didnt get an error, I just got too less data.

I have restarted the python session and now it does give me the correct data.

The jupyter notebook, where I was working in was open for several days already. I did reset the eikon object and set the API key again, but it did not work. So somehow the end date perceived by the API is not the actual day today, but set somewhere when you start a python session?

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.

we'll check on that, thanks for letting me know

In the meanwhile, maybe you want to set the end date in your code:

end = datetime.datetime.today().strftime('%Y-%m-%d')

Upvotes
4.3k 2 4 5

We found the root cause. It's related to the default arguments evaluation by Python.

While plain values are hard-coded, thus needing no evaluation except that made at compilation time, function calls are expected to be executed at run time.
If we write this:

import datetime as dt
deflog_time(message, time=dt.datetime.now()):
    print("{0}: {1}".format(time.isoformat(), message))

We expect the log_time() function to correctly provide the current time each time we call it. This unfortunately does not work: default arguments are evaluated at definition time (for example when you first import the module), and the result of successive calls is :

>>> log_time("message 1")<br>2015-02-10T21:20:32.998647: message 1<br>>>> log_time("message 2")<br>2015-02-10T21:20:32.998647: message 2<br>>>> log_time("message 3")<br>2015-02-10T21:20:32.998647: message 3

This issue will be fixed in the next version.
In the meanwhile, Joris.Hoendervangers's suggestion is totally appropriate : you can force end_date to dt.datetime.today().strftime('%Y-%m-%d')

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.