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

Best Answer

  • Jirapongse
    Answer ✓

    @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


Answers

  • Jirapongse

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

  • @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

  • @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.

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