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
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-apipythonrefinitiv-dataplatform-eikonworkspaceworkspace-data-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.

@victor.delima, thank you for your participation in the forum. Is the reply below satisfactory in resolving your query? If yes please click the 'Accept' text next to the reply. This will guide all community members who have a similar question. Otherwise please post again offering further insight into your question. Thanks, AHS

1 Answer

· Write an Answer
Upvote
Accepted
39.4k 77 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 512.0 KiB each and 1.0 MiB total.

Thank you! That worked fantastically.

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.