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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
13 3 4 8

Keywords search in News Screener

Hi, I am trying to use the get_news_headlines to run a keyword search on Python. I have noticed that if I use a single word this works as expected, as per example:

ek.get_news_headlines(query = 'plastic', count=100)

However, I am trying to use in this case multiple words combined in a single string as my query. For example I am looking to search for al headline containing the string 'sustainability linked'. On the Eikon News Screener I get multiple hits:

1657279205408.png

But none on Python using the same format as above:

ek.get_news_headlines(query = 'plastic use', count=100)

1657279263779.png

Would you please help me understanding how to run this correctly?

Also, can you advise whether the RDP API would be better suited for this searches?

Thanks!

newspython apirdp searchnews-filter
1657279205408.png (45.5 KiB)
1657279263779.png (7.1 KiB)
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
49.3k 123 44 61

@Giorgio Cozzolino

The query should be inside double quotation marks.

ek.get_news_headlines('\\"plastic use\\"')

The output is:

1657511244388.png


1657511244388.png (42.0 KiB)
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.