Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Refinitiv Data Platform /
  • Refinitiv Data Platform Libraries /
avatar image
REFINITIV
Question by katarzyna.olenycz · Apr 20, 2021 at 09:36 AM · pythonrdp-apirefinitiv-data-platformrefinitiv-data-platform-libraries

Empty DF returned using async RDP library with multiple RICs and platform session

Hi,

When pulling prices for all index components using async RDP library part of results are returned empty, it happens only with platform session which I need for calculator I am creating, whereas with desktop session it is significantly slower but all results are returned correctly. Could you confirm why it is happening, is there any limit that I am hitting and how can I bypass this to get all instruments queried?

Sample results:

0#.FTSE first run - 37 RICs missing, rest returned correctly

No CLOSE for 35 RIC(s): ['BLND.L', 'SKG.L', 'BP.L', 'ADML.L', 'SBRY.L', 'PHNX.L', 'FLTRF.L', 'IHG.L', 'BT.L', 'MNDI.L', 'CRH.L', 'SPX.L', 'PSN.L', 'RIO.L', 'RDSb.L', 'CCH.L', 'RSA.L', 'RR.L', 'BMEB.L', 'SSE.L', 'LLOY.L', 'NWG.L', 'NXT.L', 'ITRK.L', 'BDEV.L', 'AVV.L', 'RDSa.L', 'FERG.L', 'ICP.L', 'BAES.L', 'DCC.L', 'ULVR.L', 'OCDO.L', 'TSCO.L', 'LGEN.L'].

0#.FTSE second run 15 RICs missing, rest returned correctly

No CLOSE for 15 RIC(s): ['MNDI.L', 'BATS.L', 'SPX.L', 'CCH.L', 'SSE.L', 'SMT.L', 'POLYP.L', 'GLEN.L', 'BARC.L', 'BAES.L', 'DCC.L', 'ULVR.L', 'LSEG.L', 'TSCO.L', 'LGEN.L'].

0#.SPX 139 RICs missing, rest returned correctly

No 139 RIC(s): ['AMAT.OQ', 'FCX.N', 'MAS.N', 'UAA.N', 'PVH.N', 'CBRE.N', 'CINF.OQ', 'SEE.N', 'WMB.N', 'EA.OQ', 'TMUS.OQ', 'CB.N', 'MDLZ.OQ', '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MT.N', 'PSX.N', 'FLIR.OQ', 'SCHW.N', 'DXC.N', 'SNPS.OQ', 'J.N', 'SIVB.OQ'].

Code used:

import refinitiv.dataplatform as rdp
import asyncio
import pandas as pd

# session = rdp.open_desktop_session('')

session = rdp.open_platform_session(
    '', 
    rdp.GrantPassword(
        username = '', 
        password = ''
    )
)
session.open()


default_df = rdp.get_data('0#.FTSE',
              fields = ['TR.AssetCategoryCode']
              )


async def pull_raw_data():

            df = pd.DataFrame()
            tasks = []
            responses = []
            for ric in default_df.instrument:
                task = asyncio.ensure_future(rdp.HistoricalPricing.get_summaries_async(universe = ric, start = '04/20/2020, 00:00:00', end = '04/20/2021, 00:00:00', interval = 'P1D', fields = ['TRDPRC_1']))
                tasks.append(task)
            responses = await asyncio.gather(*tasks)
            remaining_instruments = []
            for i in range(len(default_df)):
                ts = responses[i].data.df  
                if ts is not None:
                        ts.rename(columns = {'TRDPRC_1': default_df.instrument[i]}, inplace = True)
                        df = pd.concat([df, ts], axis=1)
                else:
                    remaining_instruments.append(default_df.instrument[i])          
           
            if len(remaining_instruments):
                print(f"No {str(len(remaining_instruments))} RIC(s): {str(remaining_instruments)}.")
            display(df)
await pull_raw_data()



@marcin.bunkowski, @David Sobolewski

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 Gurpreet · Apr 20, 2021 at 10:44 PM

Hi @katarzyna.olenycz,

You are mixing up the call from platform and desktop session, so your posted code does not work. Either way, I have found out the reason of the failure - it is too many data requests.

Please refer to the Rate limit section for the historical pricing service in the API playground. It does not specify the actual limit, but does mention that if the rate is exceeded, then the application will receive HTTP-429.

Here is the actual message I received for one of the missing data instrument, using your code and FTSE 100 index:

HTTP/1.1 429 Too Many Requests

{
  "error": {
    "id": "47828f29-454c-4423-aa73-3059b59d6e0c",
    "code": "gw.userLimit",
    "message": "too many requests for /data/historical-pricing/v1/views/intraday-summaries/{universe} [GET]",
    "status": "Too Many Requests"
  }
}


You will have to pace out the requests to not breach this limit.

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 Gurpreet · Apr 20, 2021 at 11:26 PM

You can also check the error response in the failed instrument, by modifying your code like:

for i in range(len(default_df)):
    ts = responses[i].data.df  
    if ts is not None:
        ts.rename(columns = {'TRDPRC_1': default_df.instrument[i]}, inplace = True)
        df = pd.concat([df, ts], axis=1)
    else:
        display(responses[i].data.raw)
        remaining_instruments.append(default_df.instrument[i])          

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

How do I retrieve index constituents in RDP/Python

Python RDP get_historical_price_summaries

Python RDP StreamingPrices returns no data

RDP in Python not connecting despite valid App Key

Refinitiv Data Platform library version on pip vs EIKON codebook

  • 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