An error occurred while requesting URL('http://localhost:9060/api/rdp/discovery/search/v1/'). ReadTi
Currently struggling with obtaining data via the refinitiv.data API for Python, receiving the error message displayed in the title. The code, which worked until this morning looks like this:
import refinitiv.data as rd
rd.open_session()
data = rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10000,
filter = "((DbType eq 'GOVT' or DbType eq 'CORP' or DbType eq 'AGNC' or DbType eq 'OMUN' or DbType eq 'OTHR') and RCSAssetCategory eq 'A:J' and IsActive eq true and (RCSBondGradeLeaf eq 'Investment Grade' or RCSBondGradeLeaf eq 'High Yield' or RCSBondGradeLeaf ne 'Investment Grade' and RCSBondGradeLeaf ne 'High Yield') and MaturityDate ge 2024-07-24 and (DenominationMinimum le 1000 and FaceOutstanding ge 100000000 and RCSCouponTypeGenealogy eq 'M:1EU\A:C1\A:25' and IsPrivatePlacement eq false and RCSCouponCurrencyLeaf xeq 'Euro' and IsExchangeListed eq true and RCSCurrencyLeaf eq 'Euro' and (SukukExchangeName xeq 'FRANKFURT STOCK EXCHANGE' or SukukExchangeName xeq 'STUTTGART STOCK EXCHANGE' or SukukExchangeName xeq 'MUNICH STOCK EXCHANGE' or SukukExchangeName xeq 'BERLIN STOCK EXCHANGE' or SukukExchangeName xeq 'DUSSELDORF STOCK EXCHANGE' or SukukExchangeName xeq 'TRADEGATE EXCHANGE' or SukukExchangeName xeq 'HAMBURG STOCK EXCHANGE' or SukukExchangeName xeq 'HANNOVER STOCK EXCHANGE' or SukukExchangeName xeq 'BORSA ITALIANA S.P.A.' or SukukExchangeName xeq 'LUXEMBOURG STOCK EXCHANGE' or SukukExchangeName xeq 'LONDON STOCK EXCHANGE PLC' or SukukExchangeName xeq 'WIENER BOERSE AG' or SukukExchangeName xeq 'EURONEXT PARIS' or SukukExchangeName xeq 'SIX SWISS EXCHANGE')))",
select = "DTSubjectName,MaturityDate,ISIN,DbTypeDescription"
)
(The eikon API and the respective app key were set as well for later on)
Any help would be greatly appreciated!
Best Answer
-
Thank you for all your help! It does indeed seem to be some kind of network problem on my end.
0
Answers
-
Additional Info:
When trying to request data using the eikon API in Python I receive data without any problem.
My Refinitiv build looks like this:
0 -
Thank you for reaching out to us.
It may relate to the HTTP timeout. 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.
rd.get_config()["http.request-timeout"] = 60
0 -
Hi @benedikt-luka.antic ,
This seems to be related to the HTTP time out as Jirapongse answered in this question as below
You can try to increase the HTTP Request Timeout by changing its value in the Refinitiv Data Library configuration file (refinitiv-data.config.json).
{
"http": {
"request-timeout": 60
},
"logs": {
"level": "debug",
"transports": {
"console": {
"enabled": false
},
"file": {
"enabled": false,
"name": "refinitiv-data-lib.log"
}
}
},
"sessions": {
"default": "desktop.workspace",
...To load the configuration file, please refer to the example on GitHub.
Please let me know in case there's any further questions
0 -
Thank you both for your answer! I have increased the http timeout as shown above (rd.get_config()["http.request-timeout"] = 60), however I still get the same error after a couple of seconds. I think it is related to 'httpx', since the timeout reads 'httpx.ReadTimeout: timed out'.
I tried to find a way to increase the or disable the timeout of httpx, but was not succesful.
Any help would be greatly appreciated!0 -
Please try to set it before calling the open_session.
import refinitiv.data as rd
rd.get_config()["http.request-timeout"] = 60
rd.open_session()
data = rd.discovery.search(
view = rd.discovery.Views.GOV_CORP_INSTRUMENTS,
top = 10000,
filter = "((DbType eq 'GOVT' or DbType eq 'CORP' or DbType eq 'AGNC' or DbType eq 'OMUN' or DbType eq 'OTHR') and RCSAssetCategory eq 'A:J' and IsActive eq true and (RCSBondGradeLeaf eq 'Investment Grade' or RCSBondGradeLeaf eq 'High Yield' or RCSBondGradeLeaf ne 'Investment Grade' and RCSBondGradeLeaf ne 'High Yield') and MaturityDate ge 2024-07-24 and (DenominationMinimum le 1000 and FaceOutstanding ge 100000000 and RCSCouponTypeGenealogy eq 'M:1EU\A:C1\A:25' and IsPrivatePlacement eq false and RCSCouponCurrencyLeaf xeq 'Euro' and IsExchangeListed eq true and RCSCurrencyLeaf eq 'Euro' and (SukukExchangeName xeq 'FRANKFURT STOCK EXCHANGE' or SukukExchangeName xeq 'STUTTGART STOCK EXCHANGE' or SukukExchangeName xeq 'MUNICH STOCK EXCHANGE' or SukukExchangeName xeq 'BERLIN STOCK EXCHANGE' or SukukExchangeName xeq 'DUSSELDORF STOCK EXCHANGE' or SukukExchangeName xeq 'TRADEGATE EXCHANGE' or SukukExchangeName xeq 'HAMBURG STOCK EXCHANGE' or SukukExchangeName xeq 'HANNOVER STOCK EXCHANGE' or SukukExchangeName xeq 'BORSA ITALIANA S.P.A.' or SukukExchangeName xeq 'LUXEMBOURG STOCK EXCHANGE' or SukukExchangeName xeq 'LONDON STOCK EXCHANGE PLC' or SukukExchangeName xeq 'WIENER BOERSE AG' or SukukExchangeName xeq 'EURONEXT PARIS' or SukukExchangeName xeq 'SIX SWISS EXCHANGE')))",
select = "DTSubjectName,MaturityDate,ISIN,DbTypeDescription"
)
dataYou may check the version of RD Library. I am using 1.3.0.
rd.__version__
0 -
My mistake was not closing the session, so the timeout did not increase. Now, the timeout is increased, however now after waiting a while I receive the following error
httpx.RemoteProtocolError: Server disconnected without sending a response.
My version of the RD Library is 1.3.0 as well
0 -
It looks like to be a network issue.
Did you change anything on the application or system, such as python libraries or network settings?
You can enable logging in the API by using the following code.
import refinitiv.data as rd
rd.get_config()["http.request-timeout"] = 60
rd.get_config()["logs.level"] = "debug"
rd.get_config()["logs.transports.file.enabled"] = True
rd.get_config()["logs.transports.file.name"] = "refinitiv-data-lib.log"
rd.open_session()The refinitiv-data-lib.log file will be created. We may be able to see unexpected behaviors in the log file.
1 -
I followed the steps outlined above twice, the second time setting
rd.get_config()["http.request-timeout"] = 300
The first time I received a timeout, the second time I received
httpx.RemoteProtocolError: Server disconnected without sending a response.
The log file is as follows: 20230727-1449-22656-refinitiv-data-lib.zip
I have not changed any network settings or libraries in the last two days (since this started happening) and I can still get data using the 'eikon' package in Python without any issue.
0 -
Did the log-files give you any insight into what the problem might be? The issue still persists0
-
Please run the following command in Powershell to verify the connection.
(Invoke-WebRequest -Method POST -Header (@{"Authorization"="bearer 124563";"x-tr-applicationid"="DEFAULT_WORKSPACE_APP_KEY"}) -Body (@{"View"="GovCorpInstruments";"Query"="IBM";"Select"="DTSubjectName,InstrumentTypeDescription";"Top"=10000}|ConvertTo-Json) -Uri http://localhost:9060/api/rdp/discovery/search/v1/ -ContentType application/json)
The output looks like this:
0
Categories
- All Categories
- 6 AHS
- 37 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
- 59 Workspace SDK
- 9 Element Framework
- 5 Grid
- 13 World-Check Data File
- Yield Book Analytics
- 46 中文论坛