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
1 0 0 1

Is there a way to pull up TOP NEWS app -> COMMODITIES -> ENERGY into API in Eikon?

We wanna see trending topics, last news, market snap shop


1722530108015.png

eikoneikon-data-api#productapi#contentpython apicommodities
1722530108015.png (298.3 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.

1 Answer

· Write an Answer
Upvote
Accepted
85k 289 53 77

@marceugene.belen

Thank you for reaching out to us.

You can use the Refinitv Data Library for Python to retrieve top news of Commodities/Energy. The code looks like this.

top_news = news.top_news.hierarchy.Definition().get_data();
df = top_news.data.df.reset_index()
newsId = df[df["Subcategory"]=="Energy"]["topNewsId"].to_list()[0]
front_page = news.top_news.Definition(newsId).get_data()
front_page.data.df

You can refer to the news example on GitHub.

For the market snapshot, it should be the get_history method with rebasing the historical data.

df = rd.get_history( 
        universe=['LCOc1'],
        fields=["SETTLE"],
        count=130
    ) 
df["rebase"] = (100/df.iloc[0]["SETTLE"])*(df["SETTLE"]-df.iloc[0]["SETTLE"])
df

1722579690361.png

However, I can't find the endpoints for trending topics, and last news. Please contact the RDP support team directly for the endpoints or the news query for the latest news.


1722579690361.png (18.8 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.

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.