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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

question

Upvotes
Accepted
105 4 6 8

Trying to reproduce new issues in the news tutorial

Hello! I am trying to reproduce the tutorial from the Developer Website with no success:

https://developers.refinitiv.com/eikon-apis/eikon-data-api/learning?content=15351&type=learning_material_item

The code itself:

from datetime import date

start_date, end_date = date(2010, 1, 1), date.today()
q = "Product:IFREM AND Topic:ISU AND Topic:EUB AND (\"PRICED\" OR \"DEAL\")"
headlines = tr.get_news_headlines(query=q, date_from=start_date, date_to=end_date, count=100, raw_output=False)
headlines.head()

Error message:

2020-03-12 13:14:43,924 P[17328] [MainThread 13732] Backend error. Failed to deserialize backend response. Expected valid JSON. Error: invalid character 'i' looking for beginning of value

Could you please help?

eikoneikon-data-apiworkspaceworkspace-data-apirefinitiv-dataplatform-eikonpythonnewsissue
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
20.3k 73 10 20

Hi @alex.yermolayev

I just tried the following as per the tutorial and it works Ok

start_date, end_date = date(2010, 1, 1), date.today()
q = "Product:IFREM AND Topic:ISU AND Topic:EUB AND (PRICED OR DEAL)"
headlines = tr.get_news_headlines(query=q, date_from=start_date, date_to=end_date, count=100, raw_output=False)
headlines.head()

If I add the \" back in, then I get the same error as you do.


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.

Many thanks, Umer @

I saw the error and corrected it. I downloaded the source code from the link on github, I guess the string formatting is not correct there.

Hi @alex.yermolayev

Apologies for the problem and thanks for pointing out the differences on github. I have alerted the example owner.

Click below to post an Idea Post Idea