Upgrade from Eikon -> Workspace. Learn about programming differences.

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
1 0 0 2

Explict search in get_news_headlines does not work

Hi there, I am having issue using the eikon pythin api get_news_headlines function. As you can see in the enclosed screenshot. The plain query works fine. However, the explicit search syntax does not work for me anymore. I have used such syntax to query news headlines before, and not sure why it isn't working. Please help me investigate. I am using eikon package version '1.1.16', the query: query = "\"ESG report\" OR \"CSR report\" OR \"sustainability report\" OR \"climate report\"". The same query works on the terminal.

headline-error.png


Thanks in advance.

eikoneikon-data-api#technologynews
headline-error.png (141.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.

Hello @DC

Thank you for your participation in the forum. Is the reply below satisfactory in resolving your query?


If so please can you click the 'Accept' text next to the appropriate reply? This will guide all community members who have a similar question.

Thanks,


AHS

Please be informed that a reply has been verified as correct in answering the question, and has been marked as such.

Thanks,
AHS

1 Answer

· Write an Answer
Upvotes
Accepted
79.2k 251 52 74

@DC

Thanks for reaching out to us.

The escape characters in the query are quite tricky. The query should look like this:

df = ek.get_news_headlines(query="\\\"ESG report\\\" OR \\\"CSR report\\\" OR \\\"sustainability report\\\" OR \\\"climate report\\\"")
df

The output is:

1675392342300.png

I hope that this information is of help.


1675392342300.png (43.9 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.

Thank you!

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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