get_news_headlines query not working.

I ran the following query yesterday and it worked fine:

today = DT.date.today()
q = '( Topic:NEWS1 OR Topic:SREP OR Topic:EXCLSV ) NOT ( AA OR Topic:TOPNP OR "Table" OR "Brief" OR Topic:TAL OR Topic:MKTREP ) AND Source:RTRS AND Language:LES'
news = ek.get_news_headlines(query=q, date_from=today, date_to=today, count=15, raw_output=False)
print(news)
But today I get the following error:
requests.exceptions.HTTPError: Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'i' looking for beginning of value 

if I set q to a simple query like:

Topic:NEWS1 AND Source:RTRS AND Language:LEN

Then it works fine. I tried restarting Eikon but nothing works. Does anyone know what's going on?

Best Answer

  • @victor.delima
    I reproduced the error as you described. Then I removed the double quotes around keywords Table and Brief and was able to retrieve the headlines. Try

    q = '( Topic:NEWS1 OR Topic:SREP OR Topic:EXCLSV ) NOT ( AA OR Topic:TOPNP OR Table OR Brief OR Topic:TAL OR Topic:MKTREP ) AND Source:RTRS AND Language:LES'

Answers