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

getting news texts included certain keywords by Codebook

I am trying to retrieve news articles that contain both the words 'inflation' and 'Japan' (in Japanese), using the following code. However, I am only able to retrieve articles that contain 'inflation'. Why am I unable to retrieve articles that contain 'Japan', and how can I improve the code to do so?"


1688443687607.png

python#technologynewscodebook
1688443687607.png (14.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.

Upvote
Accepted
80.9k 264 53 75

@masatoshi.kawashima

Thank you for reaching out to us.

Please try this one:

ek.get_news_headlines('Language:LJA AND Source:RTRS AND \\"インフレ\\" AND \\"日本\\" NOT UPDATE', count=100, date_from="2023-06-10", date_to="2023-06-19")

Please check with the News Monitory app if it returns any data.

I checked this query and it worked.

ek.get_news_headlines('Language:LJA AND Source:RTRS AND \\"インフレ\\" NOT UPDATE',
                      count=100, date_from="2023-06-10", date_to="2023-06-19")

1688445784038.png



1688445784038.png (19.7 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.

Upvotes
1 0 0 2

@Jirapongse

Thank you for your response. It worked out well with your help.

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.

Upvotes
1 0 0 2

@Jirapongse

I have another question. I want to retrieve articles containing "インフレ" and "日本" or articles containing "岸田", but the code below doesn't work well. Some articles that meet the specified criteria are retrieved, but articles are also retrieved from news sources that are not specified. Chinese articles are also included, and articles other than Japanese are also included.

1688517272218.png

1688517431470.png


1688517272218.png (9.0 KiB)
1688517431470.png (36.5 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.

Upvote
80.9k 264 53 75

@masatoshi.kawashima

It should look like this:

ek.get_news_headlines('Language:LJA AND (Source:KYDO OR Source:RTRS) AND ((\\"インフレ\\" AND \\"日本\\") OR \\"岸田\\") NOT UPDATE', count=100, date_from="2023-06-10", date_to="2023-06-19")

However, you can contact the Eikon support team via MyRefinitiv to verify the query. Queries in the Eikon News Monitor can also be used in the 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.

Upvotes
1 0 0 2

@Jirapongse
Thank you for your help. It worked well.

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.

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.