For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 1 2 5

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?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonnews
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
Accepted
39.2k 75 11 27

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')
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you! That worked great.

Upvotes
39.2k 75 11 27

Would you mind including detailed step by step instructions how to display in Eikon application the page you're interested in and include the screenshot of this page? I'm having a hard time figuring out what page in Eikon you're looking to replicate.
Alternatively you might want to call TR Helpdesk and ask how you can retrieve the news you're looking for using News Monitor app in Eikon. The news search expressions you can use in Eikon Data APIs and in News Monitor app in Eikon are the same.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Hi Alex. Thank you for your reply. I included the image below. I did contact the TR Helpdesk prior to making this post, but after a day of passing the query around they concluded that I should post here.

news-page.png (141.2 KiB)
Click below to post an Idea Post Idea