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
9 3 4 10

How can i get the news Articles and images?

Hi,

I am using Python to get the News letters.

Here is my code in Python :

headlines = tr.get_news_headlines(query=test+" IN KOREAN",date_from='2023-10-26',date_to='2023-11-28')

for index, headline_row in headlines.iterrows():

story = tr.get_news_story(headline_row['storyId'])

print("story : \n" + str(story))

I was wondering if i could get the thumbnail image with this article.

eikon-data-apirefinitiv-dataplatform-eikon#contentnews
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.

Hi @jwlee08 ,

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 most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thank you,

AHS

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thank you,

AHS

Upvotes
Accepted
79.2k 251 52 74

@jwlee08

I think they are images from top news.

from refinitiv.data.content import news

top_news = news.top_news.hierarchy.Definition().get_data();
#Front Page News
front_page = news.top_news.Definition(top_news.data.df["topNewsId"][0]).get_data()
front_page.data.df

1702538587308.png

Then, get an image.

definition = news.images.Definition(front_page.data.df["imageId"][0])
response = definition.get_data()
image = response.data.image
image.show()

1702538587308.png (21.4 KiB)
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.

Upvotes
5k 16 2 7

Hi @jwlee08 ,


I would suggest using the news service from Refinitiv Data Libraries for Python which has on opetion to render HTML. There you will perhaps see the image rendered. Please check an example here.


Best regards,

Haykaz

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.

I appreciate your help. But what i really want is the way to find the query to get the news that i was looking in the Eikon.


how can i get a query for this articles?

1702532405162.png

1702532405162.png (432.6 KiB)

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.