get_news_headlines API return significantly less data compared to terminal on the same query

I am using python eikon data api's get_news_headlines function.


As you can see, with the following query, I am able to see up to date news headlines in the terminal. However,the api onlu returns a few stale articles. Can you please check what is the issue for this, and how can I pull the exact same results as shown in terminal?

"R:NSC.N AND Topic:ESG NOT ( Topic:REP OR Topic:RES OR \\\"class action\\\" OR \\\"alert\\\" OR \\\"reminder\\\" OR \\\"notice\\\" ) AND Source:SUGG AND Language:LEN"

Thanks in advance.

news-data-api.pngnews-terminal.jpg

Best Answer

  • Jirapongse
    Jirapongse admin
    Answer ✓

    @DC

    Thanks for reaching out to us.

    I can run it properly.

    q="R:NSC.N AND Topic:ESG NOT ( Topic:REP OR Topic:RES OR \\\"class action\\\" OR \\\"alert\\\" OR \\\"reminder\\\" OR \\\"notice\\\" ) AND Source:SUGG AND Language:LEN"
    headlines = ek.get_news_headlines(q,count=100, date_from="2023-01-01")
    headlines

    The output is:

    1676529368515.png

    The Eikon Data API can retrieve data from the news wire source.

    1676529455691.png

    To get new headlines from other sources, you need to use the Refinitiv Data Library. There is an Eikon Data API in the Refinitiv Data Library. Please see the example on GitHub.

    The code looks like this:

    q="R:NSC.N AND Topic:ESG NOT ( Topic:REP OR Topic:RES OR 'class action' OR 'alert' OR 'reminder' OR 'notice' ) AND Source:SUGG AND Language:LEN"
    ek.get_news_headlines(query = q, repository='WebNews,NewsRoom,NewsWire', count=100, date_from='2023-01-01')

    I hope that this information is of help.

Answers

  • Hi Jirapongse,

    Thank you! The API seemed to be having issues when I last accessed it. Now it works for me as well.

  • Thank you! The api seemed to be misbehaving when I last accessed it. It works for me now as well.