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.

Best Answer

  • @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?

Answers

  • @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.


  • 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

  • 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!