How to correctly query python API for Eikon news

Hi. I am trying to use the python Eikon API to retrieve the news that show up on the "*TOP NEWS*-Front Page - RTRS | News" page (the section you get when clicking on the "TOP NEWS SUMMARIES ON OTHER SUBJECTS
Front Page TOP/NEWS" on the news app), but I can't seem to figure out how. I am doing the following query:

today = DT.date.today()
source1 = ek.get_news_headlines(query=q, date_from=today, date_to=today, count=13, raw_output=False)

Where "q", I have tried the following:

q = 'Topic:TOP/NEWS AND Language:LEN AND Source:RTRS'

Which doesn't return the same content; and

q = '( Topic:TOP/NEWS OR Topic:SREP OR Topic:EXCLSV ) NOT ( AA OR Topic:TOPNP OR Table OR Brief OR Topic:TAL OR Topic:MKTREP ) AND Source:RTRS AND Language:LEN'

which returns more of the content, but it is still not the same. How can I query for that particular content?

Best Answer

  • Alex Putkov.1
    Alex Putkov.1 ✭✭✭✭✭
    Answer ✓

    If you're looking to get the list of headlines at the top of this page, you won't be able to do it by applying a news search filter. Any news search filter will return the list of headlines that satisfy the filter criteria in chronological order. On the Top News Front Page the headlines are listed in order of importance.
    You can however retrieve the HTML comprising the Top News Front Page and parse the headlines out of it. Here's the call that returns the HTML for the page:

    ek.get_news_story('nTOPNEWS')

Answers