Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Eikon Data APIs /

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

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials |  Articles

avatar image
Question by saad.ali · Nov 08, 2021 at 08:32 AM · eikon-data-apihistoricalpython api

How to get historical monthly open interest data in Eikon with Python API?

I used the following code as mentioned in this question

https://community.developers.refinitiv.com/questions/42502/what-is-the-best-way-to-retrieve-open-interests-da.html

but it gives daily data not monthly data. Is there any way to modify it somehow to retrieve monthly data?


Code:

df, e = ek.get_data('NGc1', ['TR.OPENINTEREST.Date', 'TR.OPENINTEREST'], {'SDate':'2011-01-01','EDate':'2020-12-31'})

df

Any leads will be highly appreciated. Thanks in advance.

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by raksina.samasiri · Nov 08, 2021 at 09:17 AM

hi @saad.ali ,

You can add parameter 'Frq' to set the frequency of the data returned. Please note that M is used for monthly, Y=yearly, Q=quarterly, W=weekly, D=day

for example,

df, e = ek.get_data('NGc1', ['TR.OPENINTEREST.Date', 'TR.OPENINTEREST']
                    , {'SDate':'2011-01-01','EDate':'2020-12-31','Frq':'M'})
df

1636362911358.png


1636362911358.png (29.5 KiB)
Comment
saad.ali

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by saad.ali · Nov 08, 2021 at 01:30 PM

@raksina.samasiri Thanks a lot. It works :)

Comment
raksina.samasiri

People who like this

1 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
13 People are following this question.

Related Questions

Trying to fetch Close Bid Price for CMO tranche from Python

How to get block trade for NYMEX WTI 1 MONTH CALENDER SPREAD OPTION CHAIN when occurs via python api?

How can I retrieve the historical values for RIC .AD.US using either the Eikon Data API, or the Historical Pricing API in CodeBook?

How to get historical data for Earnings Quality Country Rank Data (TR.EQCtryRank) through Python?

Why does ek.get_data sometimes return all NaN-values if certain columns included?

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges