Default proxy port #9000 failed

Timeout access Eikon API from Phyton
API status works from web browser (http://localhost:9000/ping?all and http://localhost:9060/api/status)
Running sample code returns timeout error.
Code:
import eikon as ek
ek.set_log_level(1)
ek.set_app_key('<app key here>')
df,e = ek.get_data('REUTERS','TR.RIC')
Output:
[2022-10-27 11:06:11,797;s] - [INFO] - [log] - Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy...
[2022-10-27 11:06:11,805;s] - [DEBUG] - [log] - Request to http://127.0.0.1:9060/api/status
headers = {'x-tr-applicationid': '76a0963f007e46e3bf57b1ed35379e76e1e9c5df'}
params = None
[2022-10-27 11:06:26,955;s] - [Level 1] - [log] - TimeoutException on HTTP request: ReadTimeout('')
[2022-10-27 11:06:26,956;s] - [DEBUG] - [log] - Error on checking proxy url http://127.0.0.1:9060/api/status : ReadTimeout('')
[2022-10-27 11:06:26,957;s] - [INFO] - [log] - Retrieved port 9060 value from .portIntUse isn't valid.
[2022-10-27 11:06:26,958;s] - [INFO] - [log] - Warning: file .portInUse was not found. Try to fallback to default port number.
[2022-10-27 11:06:26,958;s] - [INFO] - [log] - Try defaulting to port 9000...
[2022-10-27 11:06:26,959;s] - [INFO] - [log] - Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy...
[2022-10-27 11:06:26,959;s] - [DEBUG] - [log] - Request to http://127.0.0.1:9000/api/status
headers = {'x-tr-applicationid': '76a0963f007e46e3bf57b1ed35379e76e1e9c5df'}
params = None
[2022-10-27 11:06:41,995;s] - [Level 1] - [log] - TimeoutException on HTTP request: ReadTimeout('')
[2022-10-27 11:06:41,996;s] - [DEBUG] - [log] - Error on checking proxy url http://127.0.0.1:9000/api/status : ReadTimeout('')
[2022-10-27 11:06:41,997;s] - [DEBUG] - [log] - Default proxy port #9000 failed
[2022-10-27 11:06:41,997;s] - [INFO] - [log] - Try defaulting to port 9060...
[2022-10-27 11:06:41,998;s] - [INFO] - [log] - Send GET request to http://127.0.0.1:9060/api/status to detect API Proxy...
[2022-10-27 11:06:41,999;s] - [DEBUG] - [log] - Request to http://127.0.0.1:9060/api/status
headers = {'x-tr-applicationid': '76a0963f007e46e3bf57b1ed35379e76e1e9c5df'}
params = None
[2022-10-27 11:06:57,017;s] - [Level 1] - [log] - TimeoutException on HTTP request: ReadTimeout('')
[2022-10-27 11:06:57,017;s] - [DEBUG] - [log] - Error on checking proxy url http://127.0.0.1:9060/api/status : ReadTimeout('')
[2022-10-27 11:06:57,019;s] - [DEBUG] - [log] - Default proxy port #9060 failed
[2022-10-27 11:06:57,020;s] - [ERROR] - [log] - Error: no proxy address identified.
Best Answer
-
Thank you so much for sharing your finding.
Eikon Data API supports a proxy setting via the Windows HTTP_PROXY variable. For example:
import os
os.environ['HTTP_PROXY']="http://127.0.0.1:8080"It looks like it requires a proxy to connect to the localhost. I assumed that a web browser also uses a proxy to connect to http://localhost:9060/api/status.
You may verify a proxy setting used by a web browser. It may have a security application that blocks a connection to the localhost.
0
Answers
-
confirmed that Eikon is running and has realtime and portInUse is 9060
0 -
Hi @kurt.dumangeng ,
For further investigation, could you detail your
- Eikon Desktop or Refinitiv Workspace application's version
- Python version
- Version of python libs below:
- eikon
- httpx
- nest-asynco
0 -
Sorry about the issue that you are facing.
Eikon Data API internally uses the httpx library to send HTTP requests so you need to check the version of those libraries mentioned by my colleague.
Moreover, you can try the following code to send an HTTP request to http://localhost:9060/api/status.
import httpx
session = httpx.AsyncClient(
headers={"Accept": "application/json"},
timeout=15,
)
response = await session.request("GET","http://localhost:9060/api/status")
response.contentThe output is:
I am using:
- Eikon Data API 1.1.16
- httpx 0.22.0
- nest_asyncio 1.5.1
I hope that this information is of help
0 -
Hi Dev team,
My libraries:
Eikon 1.1.16
Httpx 0.22.0
Nest_asyncio 1.5.4
Please check if below code is ok. I was getting an “await outside async function” error and updated the code:
import httpx
import asyncio
session = httpx.AsyncClient(
headers={"Accept": "application/json"},
timeout=15,
)
async def request():
response = await session.request("GET", 'http://localhost:9060/api/status')
response.content
asyncio.run(request())
I get this error :
raise mapped_exc(message) from exc
httpx.ReadTimeout
It looks like there is definitely something blocking between python and eikon? As using chrome to access http://localhost:9060/api/status works fine.
0 -
So I got it to work using this:
import requests
proxies = {
'http': 'http://localhost:9060',
}
r =requests.get('http://localhost:9060/api/status', timeout=30, proxies=proxies)
print(r.status_code)
print(r.text)
Output:
200
{"statusCode":"ST_PROXY_READY","version":"3.3.5-eikon4"}
Question: Is there a way to set the proxy within python using the Eikon library? Changing the Windows http_proxy variable works too, but I’d rather not use that solution.
0 -
Thank you so much! I have explained this to the IT and they will check it from their end. Thank you again
0
Categories
- All Categories
- 6 AHS
- 36 Alpha
- 166 App Studio
- 6 Block Chain
- 4 Bot Platform
- 18 Connected Risk APIs
- 47 Data Fusion
- 34 Data Model Discovery
- 684 Datastream
- 1.4K DSS
- 613 Eikon COM
- 5.2K Eikon Data APIs
- 10 Electronic Trading
- Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 248 ETA
- 552 WebSocket API
- 37 FX Venues
- 14 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 23 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 275 Open PermID
- 44 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 22 RDMS
- 1.9K Refinitiv Data Platform
- 632 Refinitiv Data Platform Libraries
- 4 LSEG Due Diligence
- LSEG Due Diligence Portal API
- 4 Refinitiv Due Dilligence Centre
- Rose's Space
- 1.2K Screening
- 18 Qual-ID API
- 13 Screening Deployed
- 23 Screening Online
- 12 World-Check Customer Risk Screener
- 1K World-Check One
- 46 World-Check One Zero Footprint
- 45 Side by Side Integration API
- 2 Test Space
- 3 Thomson One Smart
- 10 TR Knowledge Graph
- 151 Transactions
- 143 REDI API
- 1.8K TREP APIs
- 4 CAT
- 26 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 191 TREP Infrastructure
- 228 TRKD
- 915 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 85 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛