question

Upvotes
Accepted
17 3 5 5

Fundamental data and get_timeseries

Using PM-OILTOTPD-EIA as an example (other similar data is experiencing the same issue). In Eikon, these data are correct, but pulling via Python they are not. What am I missing?

rics = ['PM-OILTOTPD-EIA']
start = (date.today()-timedelta(days=365)).strftime("%Y-%m-%d")
fields = ['Timestamp','Close']

df = ek.get_timeseries(rics,fields,start,interval='monthly')


If the interval is not specified, running the script yields an error.

eikoneikon-data-apipython apitimeseries
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.

Upvotes
Accepted
19.2k 86 39 63

@Corey.Stewart

Based on the above code segment you provided, this is the history:

ahs.png

Looking at the screenshot of the chart above, all the history matches up with the exception of the last data point in the chart. That is, the API doesn't return data for March 31, 2022. Can you confirm these details and that the issue is that you don't get the extra data point for a future value?


ahs.png (19.8 KiB)
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.

Ah, yes - that I hadn't noticed. I added an end_date parameter to my code (future date using timedelta) and received the expected result. Thank you!
Upvotes
87.5k 294 53 79

@Corey.Stewart

The default value of the interval parameter is daily. Therefore, if you don't specify the interval parameter, it will request the daily historical data.

According to the result from the Eikon Chart, PM-OILTOTPD-EIA doesn't provide daily historical data.

1646974604337.png

Therefore, to request the historical data of PM-OILTOTPD-EIA, you need to specify the interval parameter.



1646974604337.png (19.6 KiB)
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.

Yes, I am aware of that, and specified "monthly" in my code above. The issue is that the data are incorrect. If you search the RIC in Eikon it shows the correct data (in this case, 5205147.79). But pulling through the API, the last value is 5075855.02). I have this same issue with multiple, related, RICs.

Furthermore, not sure why you don't see history...

capture.png

capture.png (40.6 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.