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
55 5 8 8

get_news_headlines how to properly use the criterias?

Hello,


I am using the get_news_headlines,

I am trying to identify news as below, but it doesnt show any result, could you please help me to write properly my query ?

df = ek.get_news_headlines("(hurricane OR tropical storm) AND (oil OR Gulf Coast)")


Thanks in advance.

eikoneikon-data-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-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.

@emmanuel.chaslin

Hi,

Thank you for your participation in the forum.

Is the reply below satisfactory in answering your question?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

1 Answer

· Write an Answer
Upvote
Accepted
10.2k 18 6 9

Hi @emmanuel.chaslin Thanks for your question. The get_news_headlines API call uses a query syntax that can be generated from the NEWS app. (Type NEWS into search bar) - I have written an article on how to generate the query from natural language. You can use topic codes or keywords or languages etc - all options appear when you type something into the news query bar, note keywords must be properly escaped by adding another set of "" around those terms - see the ""oil"" term below.

df = ek.get_news_headlines("( Topic:WND) AND (""oil"" OR Topic:PADD3 )")
df 

I hope this can help.


1600338606831.png (374.2 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.

very well thanks

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.