For a deeper look into our Eikon Data API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
7 1 2 5

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?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpython
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

1 Answer

Upvote
Accepted
39.2k 75 11 27

@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'
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Thank you! That worked fantastically.

Click below to post an Idea Post Idea