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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
3 1 1 2

Eikon python API: Formulating search queries to order news by popularity or filter by the media company

I'm trying to retrieve the most popular news headlines for a given company's ric in a given day.

1. Is there any way to form a search query to output news ordered by how popular they are?

2. Is it possible to filter the search queries to show only certain media companies? How can I encode a newspaper ID in the search query?

3. Can I filter the search query by the type of the output? For example, can I filter out the news which are just video links?

eikoneikon-data-apipythonworkspacerefinitiv-dataplatform-eikonworkspace-data-apinewsquery-stringfilter
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
39.3k 76 11 27

1. Is there any way to form a search query to output news ordered by how popular they are?
Answer: No

2. Is it possible to filter the search queries to show only certain media companies? How can I encode a newspaper ID in the search query?
Answer: Use "Source" keyword in the news search expression to filter news headlines by source. E.g. the following expression retrieves only news headlines provided by Bangkok Post.

ek.get_news_headlines('Source:BANGPO')
To browse the news source codes you can use with the Source keyword use News Monitor app in Eikon application.

3. Can I filter the search query by the type of the output? For example, can I filter out the news which are just video links?
Answer: I don't believe there's such a thing as news that are just video links. News stories are delivered as HTML, which may embed videos, but in my experience it always includes something else: at the very least a caption or a short description of the video. News stories that include video are tagged with the topic code VID, which you can use to filter them out:

ek.get_news_headlines('Source:RTRS NOT Topic:VID')
icon clock
10 |1500

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