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 pchauveau · Mar 11, 2019 at 04:09 PM · eikoneikon-data-apiworkspacepythonworkspace-data-apirefinitiv-dataplatform-eikondatatime-series

20 years of total returns

Hi, i need to get 20 year of montly total returns from a little over 5000 Sedols. Right now i'm using this method with the Python API:

aux, err = ek.get_data(list, ['TR.TotalReturn.Date','TR.TotalReturn'], parameters={"Frq": "M",'SDate':'1998-12-31', 'EDate':'2018-12-31'})

but i keep getting this error message:

"headers = [header['displayName'] for header in data_dict['headers'][0]]"

I tried partitioning the the quering on batches of 200, 100 and 50 Sedols, but i still get the same error. Retrying would get more or less iterations randomly (ie, with 100 on my first try i got the first 500 and on the second over a 2000).

Any thoughts?

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 marcin.bunkowski · Mar 12, 2019 at 07:00 AM

Hi @pchauveau

I have tried with the code below and got the outputs

instruments, e = ek.get_data('0#.GDAXI', ['Instrument']) 
instruments=instruments['Instrument'].tolist() 
for ric in instruments: 
	tmp_df = ek.get_data(ric, ['TR.TotalReturn.Date','TR.TotalReturn'], parameters={"Frq": "M",'SDate':'1998-12-31', 'EDate':'2018-12-31'})[0] 
df = tmp_df.append(df) 
df 
Comment

People who like this

0 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
pchauveau · Mar 12, 2019 at 01:03 PM 0
Share

Thanks for your solution. I had to add ignore_index=True to the append statement to avoid some issues. :D

avatar image
REFINITIV
Answer by Alex Putkov.1 · Mar 12, 2019 at 10:46 AM

This is a known issue where the Web service provides an empty response when the backend takes "too long" to process the request. The problem is acknowledged and is being worked on. In the meantime as a workaround the suggestion is to split your list into even smaller chunks (submitting the request of say 20 Sedols at a time), and also resending the same request if and when you receive an empty response.

Comment

People who like this

0 Show 2 · 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
pchauveau · Mar 12, 2019 at 01:04 PM 0
Share

Thanks for your comment, it is a shame that this issue isnt solved yet. I did lower the number of sedols, but even with 20 or 10 i had the same problem. I had to run one at the time...

avatar image
REFINITIV
Alex Putkov.1 ♦♦ · Jul 10, 2019 at 06:08 PM 0
Share

The issue with the Web service returning empty response or "Backend error. 400 Bad Request" has been addressed with the release of Eikon Data APIs library for Python v1.0.1 available on PyPI. This does not mean that with Eikon Data APIs library for Python v1.0.1 one can never receive "Bad request" error or that the service can now provide unlimited data downloads. But one should no longer experience random and frequent empty responses or "Backend error. 400 Bad Request" forcing one to resubmit the same requests in a loop until the data is returned.

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

Related Questions

How to use get_data with RIC, date combinations?

Requesting TR time series data for listed and delisted rics.

Total Returns and Price Returns over specific periods

reshape dataframe with pd.pivot_table - missing data

Pulling GDP time series for country

  • 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