Issue with Retrieving Latest News

jimmy.shek
jimmy.shek Newcomer
edited June 19 in Eikon Data APIs

I’m encountering an issue while using the 

get_headlines()

 function. Specifically, I’m not receiving the latest news as expected, even when I specify the endpoint as "now." There seems to be a lag of a few hours between when the news is available on the Workspace application and when it appears in the API results.

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @jimmy.shek

    Thank you for reaching out to us.

    Please share the code that you are using.

  • jimmy.shek
    jimmy.shek Newcomer

    import lseg.data as ld
    from lseg.data.content import news
    from datetime import datetime, timedelta


    news_query = f"{country} AND ECI NOT CLM"
    dNow = datetime.now().date()
    cHeadlines = ld.news.get_headlines(
                    f"{news_query} AND Language:LEN AND Source:RTRS",
    start='2025-06-01',
                end=str(dNow),
                    count=50000
                )

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @jimmy.shek

    Thank you for reaching out to us.

    You may need to specify GMT time in the start and end parameter. For example:

    import lseg.data as ld
    from lseg.data.content import news
    from datetime import datetime, timedelta
    
    
    news_query = f"US AND ECI NOT CLM"
    dNow = datetime.now().date()
    cHeadlines = ld.news.get_headlines(f"{news_query} AND Language:LEN AND Source:RTRS",
                start='2025-06-01T15:04:05',
                end='2025-06-19T08:13:00',
                count=100
                )
    

    The count is limited to 100.

  • jimmy.shek
    jimmy.shek Newcomer

    It works. Many thanks.