Please can you explain why there is a lag on receiving EIA stats data via a script i have written?

Options
Terence_97
Terence_97 LSEG
edited 2:32AM in Eikon Data APIs

Hi team, I am posting on behalf of an external client for the query below, please help and prioritize:

Please can you explain why there is a lag on receiving EIA stats data via a script i have written using the appkey?

from lseg.data.content import historical_pricing as hp
from datetime import date
import os

1. Correct RIC for total commercial crude stocks

crude_rics = ["C-STK-T-EIA"]

2. Date range

start_date = "2020-01-01"
end_date = str(date.today())

3. Fetch data

response = hp.summaries.Definition(
universe=crude_rics,
interval=hp.Intervals.WEEKLY,
start=start_date,
end=end_date
).get_data()

4. Extract and rename

raw_df = response.data.df
print("Latest date returned:", raw_df.index.max())
print("Today's date:", date.today())

comm_last_df = raw_df[["COMM_LAST"]].copy()
comm_last_df.columns = ["TotalCrude"]

5. Save

os.makedirs("../data", exist_ok=True)
comm_last_df.to_csv("../data/crude_total_stocks.csv")
print("Saved:", os.path.exists("../data/crude_total_stocks.csv"))

I can confirm that there should be values for 1st of August but it seems that the script above pulls a week late.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Terence_97

    Thank you for reaching out to us.

    Currently, I could retrieve the data properly.

    image.png

    The library retrieves data from the Historical Pricing API. You can verify this issue by running the following formula in the LSEG Workspace Excel or contacting the Historical Pricing API support team directly when the problem occurred.

    =@RDP .HistoricalPricing("C-STK-T-EIA","COMM_LAST","START:01-Jan-2020 END:07-Aug-2025 INTERVAL:P1W SOURCE:RFV",,"CH:Fd RH:Timestamp",B2)

  • Thanks for the response. I can see on excel as well that this is working fine. But it looks like the script of the client doesn't pull the same dates.

    I have checked the entitlements and it seems good.

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    Currently, the API works fine too.

    image.png

    This issue is similar to the case (14802400).