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
REFINITIV
Question by Richard.Willingham · Mar 31 at 02:58 PM · error

Error pulling RIC

I am geetting an error pulling the RIC HOSURF1.


TYpeError: get_data() missing 1 required positional argument: 'fields'


What other API fields do I need?

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.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Jirapongse · Apr 01 at 03:40 AM

@Richard.Willingham

The get_data method requires the fields parameter as the second parameter. If you run the command without it, you will get the following error.

df, err = ek.get_data(['HOSURF1'])
get_data() missing 1 required positional argument: 'fields'

Therefore, you need to specify fields in the second parameter.

HOSURF1 is a chain RIC that contains child RICs.

First, you need to use the following code to gel all child RICs in HOSURF1.

#Define getUnderlying() function
def getUnderlying(baseRic):
    LONGNEXTLR = baseRic
    #For LONGLING1 to LONGLINK15 and LONGNEXTLR fields
    fields = ['LONGLINK{}'.format(x) for x in range(1, 15)]
    fields.append('LONGNEXTLR')
 
    all_underlying_rics = []
 
    #if LONGNEXTLR is not empty, try to retrieve the data fields
    while LONGNEXTLR!='':
        df,e = ek.get_data(LONGNEXTLR,fields)
        LONGNEXTLR = df.iloc[0]['LONGNEXTLR'] if pd.notnull(df.iloc[0]['LONGNEXTLR']) else ''
        
        #If LONGLINK<x> field is not null, append its value to all_underlying_rics list
        for x in range(1, 15):
            currentField = 'LONGLINK{}'.format(x)
            all_underlying_rics.append(df.iloc[0][currentField]) if pd.notnull(df.iloc[0][currentField]) else None
        #delay between each API call for 1 second
        time.sleep(1)
    return all_underlying_rics


rics = getUnderlying('HOSURF1')

I defined the getUnderlying method to get all child RICs and called the method with HOSURF1. The function returns a list of child RICs.

Then, I called the get_data method with the list of child RICs and fields.

df, err = ek.get_data(rics, ["GV4_DATE","GV4_TEXT","GEN_VAL1","PRIMACT_1"]);
df

The output is:

91976-1.png

You can use Eikon Quote to see available fields.

91976-2.png

You may need to refer to the Instrument Pricing Analytics - Volatility Surfaces and Curves article that shows how to use RDP to get Volatility Surfaces and Curves.


91976-1.png (23.9 KiB)
91976-2.png (82.1 KiB)
Comment
raksina.samasiri

People who like this

1 Show 1 · 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
REFINITIV
Richard.Willingham · Apr 01 at 01:38 PM 0
Share

@Jirapongse Thank you very much.

avatar image
REFINITIV
Answer by pf · Mar 31 at 05:25 PM

Hi @Richard.Willingham ,

It seems you're using get_data() function without providing fields parameter.

Could you share your code ?
Especially to detail which lib (eikon or refinitiv-dataplatform) you're using and which function ?

Comment

People who like this

0 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
REFINITIV
Answer by Richard.Willingham · Mar 31 at 05:29 PM

Yes this is Eikon for Commodities. Trying to pull this data through. RIC HOSURF1

Trying to pull from the Volatility Surface Calculator

Comment

People who like this

0 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
REFINITIV
Answer by Richard.Willingham · Mar 31 at 08:32 PM

@pf

Any thoughts?


Comment

People who like this

0 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 >
9 People are following this question.

Related Questions

refinitiv.dataplatform.errors.RDPError: Error code 1503| Backend request failed

Does not return calc dates when more than one ric in request get_data

I got an error code 413 when I run my code

Error Code 2504- Occurs at random times in code, how is this error caused and how is it solved?

Pulling TR.CLOSEPRICE weekly

  • 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
  • FX Venues
    • FX Trading – RFQ Maker
  • 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
  • Yield Book Analytics
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges