API to get "Important and Most Recent" news headlines

Hi,

Is there a way to pull only important news headlines using ek.get_news_headlines() api call in python?

Thanks so much,

Tagged:

Best Answer

  • Hello @zliu ,

    Please see Eikon Data APIs for Python - Reference Guide section get_news_headlines.

    I think you are looking for something like:

    ek.get_news_headlines(query='Topic:TOPALL and Language:LEN', count=10, 
    date_from=None, date_to=None, raw_output=False, debug=False)

    Where TOPALL is top, most important news, and count=10 is 10 most recent headlines.

Answers

  • Hi @zliu

    As outlined within the Eikon Data API documentation, the get_news_headlines() API provides the most recent top news headlines by default. Specifically:

    get_news_headlines(query='Topic:TOPALL and Language:LEN', count=10,
    date_from=None, date_to=None, raw_output=False, debug=False)
  • hi @zliu ,

    This article demonstrates how to retrieve Top News Energy headlines and stories using Python code with Eikon Data API, feel free to check it. Plus, to get other queries for top news, you can type "top news - " on the Eikon search bar to see that which keyword can be used