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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
5 0 0 1

Question regarding to python api get_news_headlines() gramma

Hi all,

I am trying to use get_news_headlines() to extract news relating to keyword "nord stream" in python which has the same result in News monitor (below)微信截图-20211129144323.png

I have tried those two ways which I found potential solutions in this Forum, however the first one gave a wrong result (the result is the same if I enter Nordic States AND Streaming Media in News monitor); the second one threw a JOSON error in python.

ek.get_news_headlines("""nord stream""")

ek.get_news_headlines("\\\"nord stream\\\"")


So how to get the correct result in python? How to use get_news_headlines() function to extract the same result as News monitor if I enter an individual KEYWORDS?


Thanks in advance :)

python api
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
47.4k 111 44 60

@xiaodong.han

I used the following code.

ek.get_news_headlines('\\"nord stream\\"')

The output is:

1638181319721.png



1638181319721.png (29.4 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.

Ok, I found another Q&A which says this issue occuring in eikon library 1.1, so I degraded the version to 1.06 as it suggests, and this grammar worked. Anyway thank you.