How to get recent data on Eikon API in Python?

Amith.TUmesh
edited June 12 in Eikon Data APIs

I am using the Eikon API in python.

When I pull data now (11:40am) I get the data from 10am.

Please find below my code:

ek.get_timeseries('EUR=', fields='Close', start_date='2025-01-01 12:00:00', end_date='2025-06-11 11:00:00', interval='hour')

Is there a way to ensure that I get the most recent data?

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @Amith.TUmesh

    Thank you for reaching out to us.

    You can ignore the end_date parameter to get the latest data available in the historical database.

    ek.get_timeseries('EUR=', fields='Close', start_date='2025-01-01 12:00:00', interval='hour')
    

    The time in the response is in UTC. However, the API retrieves data from the endpoint. You need to contact the helpdesk team to verify the retrieved content.

    The Eikon Data API is quite old. Please use the LSEG Data Library for Python instead. For example:

    response = historical_pricing.summaries.Definition(
        universe = ["EUR="], 
        interval=Intervals.HOURLY,    
        start = '2025-01-01T12:00:00',
        end = '2025-06-12T03:00:00',
        fields=["BID"],    
        extended_params={"summaryTimestampLabel":"endPeriod"}
    ).get_data()
    response.data.df
    

    More examples are available on GitHub.