RDP API Connect Timeout
I am getting connect timeout from rdp api calls. This is more frequent since 2 weeks now.
ERROR!!! An error occurred while requesting URL('https://api.refinitiv.com/data/historical-pricing/v1/views/interday-summaries/CADZAR%3D?interval=P1D&start=2022-08-07&end=2023-08-08').
ConnectTimeout('')
TimeoutError
The above exception was the direct cause of the following exception:
File "C:\Users\U6082634\AppData\Local\Programs\Python\Python311\Lib\site-packages\httpx\_transports\default.py", line 83, in map_httpcore_exceptions
raise mapped_exc(message) from exc
httpx.ConnectTimeout
Best Answer
-
Hello @navtej.riyait
Sorry for the late reply.
Firstly, I am noticed that you are using the legacy Data Platform library. I highly recommend you upgrade the library to the strategic Data Library for Python (https://pypi.org/project/refinitiv-data/) aka RD Library - Python.
The RD Library is the newer version of Data Platform library. It contains all bug fixes, logging, configuration and more features than the Platform library with similar API interfaces. You can find more information from the following resources:
- RD Library - Python: Quick Start
- RD Library - Python: Tutorials
- RD Library - Python: GitHub with step-by-step tutorials
The equivalent code for you Platform library is as follows:
import refinitiv.data as rd
from refinitiv.data.content import historical_pricing
response = historical_pricing.summaries.Definition(
universe = 'JPY=',
interval=Intervals.ONE_MINUTE,
fields = ['BID','ASK'],
start = '2023-08-01 01:00:00',
end = '2023-08-02 01:00:00 '
).get_data()
response.data.df- Please be noticed that the start and end arguments are in ISO8601 string with UTC only
Result:
Secondly, you mentioned that you need to call the function multiple times. You may need to delay call (like put sleep for 1-2 seconds) between each call to not overload the requests.
Thirdly, You can try to increase the timeout value in the RD library configuration file (refinitiv-data.config.json), as shown below. The sample refinitiv-data.config.json is available on GitHub.
{
"http": {
"request-timeout": 60
},
"logs": {
...
}
...
}Otherwise, you can change the timeout value by using the following code.
import refinitiv.data as rd
rd.get_config()["http.request-timeout"] = 60
rd.open_session()0
Answers
-
Hello @navtej.riyait
Can you share the code that call the RDP historical-pricing endpoint? Are you using the Data Library (Python or C# or TypeScript) or the Python requests library?
0 -
import refinitiv.dataplatform as rdp
--------------------------
def get_historical_prices(ccy_pair, start_date, end_date):
#--------------------------------------------------------
print ('ccy pair: ' + ccy_pair)
file = pm.credentials_filename
with open(file) as f:
cr = js.load(f)
rdp.open_platform_session(
cr["app_key"],
rdp.GrantPassword(
cr["username"],
cr["password"]
)
)
#format = '%Y-%m-%d'
#start_date= start_date.strftime('%Y%m%d %H:%M:%S.%f')
#end_date = end_date.strftime('%Y%m%d %H:%M:%S.%f')
#print(start_date)
#print(end_date)
#sys.exit()
start_date_ts = start_date + timedelta(hours=1)
end_date_ts = end_date + timedelta(hours=1)
#start_date_ts = '20230801 01:00:00'
#end_date_ts = '20230802 01:00:00'
start_date_ts = start_date_ts.strftime('%Y%m%d %H:%M:%S.%f')
end_date_ts = end_date_ts.strftime('%Y%m%d %H:%M:%S.%f')
print(start_date_ts)
print(end_date_ts)
#sys.exit()
#ccy_pair ='HRK='
response = rdp.get_historical_price_summaries(
universe= ccy_pair,
interval=rdp.Intervals.ONE_MINUTE,
# Supported intervals: ONE_MINUTE, FIVE_MINUTES, TEN_MINUTES, THIRTY_MINUTES, ONE_HOUR
fields = ['BID','ASK'],
start=start_date_ts,
end=end_date_ts
)The only thing is that I am calling this function over a 100 times, once for each ccy pair. Really I need to call it once with the list of ccy pair to get market prices.
0 -
Hi
I am sourcing daily historical prices for a universe of RICs via RD API. In the response I am getting weekend dates and obviously blank prices. How can I onlt get dates/prices for business days.
0
Categories
- All Categories
- 6 AHS
- 39 Alpha
- 161 App Studio
- 4 Block Chain
- 4 Bot Platform
- 16 Connected Risk APIs
- 47 Data Fusion
- 30 Data Model Discovery
- 608 Datastream
- 1.3K DSS
- 577 Eikon COM
- 4.9K Eikon Data APIs
- 7 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- Trading API
- 2.7K Elektron
- 1.3K EMA
- 236 ETA
- 519 WebSocket API
- 33 FX Venues
- 10 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 20 Messenger Bot
- 2 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 59 Open Calais
- 264 Open PermID
- 39 Entity Search
- 2 Org ID
- PAM
- PAM - Logging
- 8.4K Private Comments
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 20 RDMS
- 1.4K Refinitiv Data Platform
- 367 Refinitiv Data Platform Libraries
- 3 Refinitiv Due Diligence
- LSEG Due Diligence Portal API
- 3 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.1K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 10 World-Check Customer Risk Screener
- 990 World-Check One
- 44 World-Check One Zero Footprint
- 45 Side by Side Integration API
- Test Space
- 3 Thomson One Smart
- 1.2K TR Internal
- Global Hackathon 2015
- 2 Specialists Who Code
- 10 TR Knowledge Graph
- 150 Transactions
- 142 REDI API
- 1.7K TREP APIs
- 4 CAT
- 21 DACS Station
- 117 Open DACS
- 1.1K RFA
- 103 UPA
- 172 TREP Infrastructure
- 224 TRKD
- 886 TRTH
- 5 Velocity Analytics
- 5 Wealth Management Web Services
- 60 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛