Error in Eikon NEWS API.

I am trying the below code and my result dataframe is empty. No errors, but there should be rows.

import eikon as ek

import pandas as pd

ek.set_app_key(Eikon_Key)

from datetime import date start_date, end_date = date(2021, 1, 1), date.today()

q = "Topic:OLYMPICS"

headlines = ek.get_news_headlines(query=q, date_from=start_date, date_to=end_date, count=100) headlines.head().

Please help.

Sree

Best Answer

  • @sreedhanya.kavunkara

    "Topic:OLYMPICS" is not a valid news search expression, as the news topic code "OLYMPICS" does not exist. If you're looking for newswires headlines related to Olympic games, the correct topic code is "OLY". So, try q = "Topic:OLY". I recommend to always use News Monitor app in Eikon to help you construct the news search expression, which you can then copy & paste into your code.