Python Eikon Data API 503 error

Basically, I want to try the following python command
import eikon as ek
ek.set_log_level(1)
ek.set_app_key("key")
print(ek.__version__)
data = ek.get_timeseries('AAPL.O', # the RIC for Apple, Inc.
fields='*', # all fields
start_date='2023-01-01', # start date
end_date='2023-07-01') # end date
But I'm having this log at the `ek.set_app_key("key")` line
[2023-08-03 10:41:22,642;s] - [INFO] - [log] - Send GET request to http://127.0.0.1:9000/api/status to detect API Proxy...
[2023-08-03 10:41:22,642;s] - [DEBUG] - [log] - Request to http://127.0.0.1:9000/api/status
headers = {'x-tr-applicationid': 'key'}
params = None
[2023-08-03 10:41:22,648;s] - [Level 1] - [log] - Send request with headers [(b'Host', b'127.0.0.1:9000'), (b'Accept-Encoding', b'gzip, deflate'), (b'Connection', b'keep-alive'), (b'User-Agent', b'python-httpx/0.24.1'), (b'Accept', b'application/json'), (b'x-tr-applicationid', key')] and cookies None
[2023-08-03 10:41:22,650;s] - [Level 1] - [log] - HTTP request response 503:
<html><head>
Funny thing is if I try the following code, it works
import requests
requests.get("http://127.0.0.1:9000/api/status")
with 200 response
Can you help me use Eikon DATA API?
my python eikon package version is 1.1.17 and running REFINITIV WORKSPACE version is DESKTOP 1.22.303 (or running REFINITIV EIKON version is Desktop 4.0.62(4.0.62015)
Best Answer
-
It may relate to the proxy (squid).
You may try to set the NO_PROXY environment variable, as mentioned in this discussion.
import os
os.environ['NO_PROXY'] = 'localhost'
os.environ['NO_PROXY'] = '127.0.0.1'0
Answers
-
Thank you for reaching out to us.
Please share the full HTML content retrieved in the response.
We may see something in this HTML.
0 -
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2016 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--
/*
* Copyright (C) 1996-2016 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/*
Stylesheet for Squid Error pages
Adapted from design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/
/* Page basics */
* {
font-family: verdana, sans-serif;
}
html body {
margin: 0;
padding: 0;
background: #efefef;
font-size: 12px;
color: #1e1e1e;
}
/* Page displayed title area */
#titles {
margin-left: 15px;
padding: 10px;
padding-left: 100px;
background: url('/squid-internal-static/icons/SN.png') no-repeat left;
}
/* initial title */
#titles h1 {
color: #000000;
}
#titles h2 {
color: #000000;
}
/* special event: FTP success page titles */
#titles ftpsuccess {
background-color:#00ff00;
width:100%;
}
/* Page displayed body content area */
#content {
padding: 10px;
background: #ffffff;
}
/* General text */
p {
}
/* error brief description */
#error p {
}
/* some data which may have caused the problem */
#data {
}
/* the error message received from the system or other software */
#sysmsg {
}
pre {
font-family:sans-serif;
}
/* special event: FTP / Gopher directory listing */
#dirmsg {
font-family: courier;
color: black;
font-size: 10pt;
}
#dirlisting {
margin-left: 2%;
margin-right: 2%;
}
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {
border-bottom: groove;
}
#dirlisting td.size {
width: 50px;
text-align: right;
padding-right: 5px;
}
/* horizontal lines */
hr {
margin: 0;
}
/* page displayed footer area */
#footer {
font-size: 9px;
padding-left: 10px;
}
body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id="ERR_CONNECT_FAIL">
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://127.0.0.1:9000/api/status">http://127.0.0.1:9000/api/status</a></p>
<blockquote id="error">
<p><b>Connection to 127.0.0.1 failed.</b></p>
</blockquote>
<p id="sysmsg">The system returned: <i>(111) Connection refused</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
<p>Your cache administrator is <a href="mailto:COMPANY_MAIL?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20AEOFFVMPROXY01%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(111)%20Connection%20refused%0D%0ATimeStamp%3A%20Thu,%2003%20Aug%202023%2006%3A41%3A22%20GMT%0D%0A%0D%0AClientIP%3A%2010.97.120.4%0D%0AServerIP%3A%20127.0.0.1%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fapi%2Fstatus%20HTTP%2F1.1%0AAccept-Encoding%3A%20gzip,%20deflate%0D%0AConnection%3A%20keep-alive%0D%0AUser-Agent%3A%20python-httpx%2F0.24.1%0D%0AAccept%3A%20application%2Fjson%0D%0Ax-tr-applicationid%3A%20f261cd8230cf4bf69684d93bd18571d6f8dac89d%0D%0AHost%3A%20127.0.0.1%3A9000%0D%0A%0D%0A%0D%0A">COMPANY_MAIL</a>.</p>
<br>
</div>
<hr>
<div id="footer">
<p>Generated Thu, 03 Aug 2023 06:41:22 GMT by COMPANY_MACINHE (squid/5.7-20221209-r9d0b81efb)</p>
<!-- ERR_CONNECT_FAIL -->
</div>
</body></html>
I'm working behind our company firewall and using company-wise proxy server also. Should we allow some connection to use it? If so, can I get some ip or any information we need to allow connection?
BTW, then how the following works?
import requests requests.get("http://127.0.0.1:9000/api/status")
with 200 response
0 -
<html><head>
<meta type="copyright" content="Copyright (C) 1996-2016 The Squid Software Foundation and contributors">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>ERROR: The requested URL could not be retrieved</title>
<style type="text/css"><!--
/*
* Copyright (C) 1996-2016 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Please see the COPYING and CONTRIBUTORS files for details.
*/
/*
Stylesheet for Squid Error pages
Adapted from design by Free CSS Templates
http://www.freecsstemplates.org
Released for free under a Creative Commons Attribution 2.5 License
*/
/* Page basics */
* {
font-family: verdana, sans-serif;
}
html body {
margin: 0;
padding: 0;
background: #efefef;
font-size: 12px;
color: #1e1e1e;
}
/* Page displayed title area */
#titles {
margin-left: 15px;
padding: 10px;
padding-left: 100px;
background: url('/squid-internal-static/icons/SN.png') no-repeat left;
}
/* initial title */
#titles h1 {
color: #000000;
}
#titles h2 {
color: #000000;
}
/* special event: FTP success page titles */
#titles ftpsuccess {
background-color:#00ff00;
width:100%;
}
/* Page displayed body content area */
#content {
padding: 10px;
background: #ffffff;
}
/* General text */
p {
}
/* error brief description */
#error p {
}
/* some data which may have caused the problem */
#data {
}
/* the error message received from the system or other software */
#sysmsg {
}
pre {
font-family:sans-serif;
}
/* special event: FTP / Gopher directory listing */
#dirmsg {
font-family: courier;
color: black;
font-size: 10pt;
}
#dirlisting {
margin-left: 2%;
margin-right: 2%;
}
#dirlisting tr.entry td.icon,td.filename,td.size,td.date {
border-bottom: groove;
}
#dirlisting td.size {
width: 50px;
text-align: right;
padding-right: 5px;
}
/* horizontal lines */
hr {
margin: 0;
}
/* page displayed footer area */
#footer {
font-size: 9px;
padding-left: 10px;
}
body
:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }
:lang(he) { direction: rtl; }
--></style>
</head><body id="ERR_CONNECT_FAIL">
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://127.0.0.1:9000/api/status">http://127.0.0.1:9000/api/status</a></p>
<blockquote id="error">
<p><b>Connection to 127.0.0.1 failed.</b></p>
</blockquote>
<p id="sysmsg">The system returned: <i>(111) Connection refused</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
<p>Your cache administrator is <a href="mailto:COMPANY_MAIL?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20AEOFFVMPROXY01%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(111)%20Connection%20refused%0D%0ATimeStamp%3A%20Thu,%2003%20Aug%202023%2006%3A41%3A22%20GMT%0D%0A%0D%0AClientIP%3A%2010.97.120.4%0D%0AServerIP%3A%20127.0.0.1%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fapi%2Fstatus%20HTTP%2F1.1%0AAccept-Encoding%3A%20gzip,%20deflate%0D%0AConnection%3A%20keep-alive%0D%0AUser-Agent%3A%20python-httpx%2F0.24.1%0D%0AAccept%3A%20application%2Fjson%0D%0Ax-tr-applicationid%3A%20f261cd8230cf4bf69684d93bd18571d6f8dac89d%0D%0AHost%3A%20127.0.0.1%3A9000%0D%0A%0D%0A%0D%0A">COMPANY_MAIL</a>.</p>
<br>
</div>
<hr>
<div id="footer">
<p>Generated Thu, 03 Aug 2023 06:41:22 GMT by COMPANY_MACINHE (squid/5.7-20221209-r9d0b81efb)</p>
<!-- ERR_CONNECT_FAIL -->
</div>
</body></html>
I'm working behind our company firewall and using company-wise proxy server also. Should we allow some connection to use it? If so, can I get some ip or any information we need to allow connection?
BTW, then how the following works?
import requests requests.get("http://127.0.0.1:9000/api/status")
with 200 response
0 -
</head><body id="ERR_CONNECT_FAIL">
<div id="titles">
<h1>ERROR</h1>
<h2>The requested URL could not be retrieved</h2>
</div>
<hr>
<div id="content">
<p>The following error was encountered while trying to retrieve the URL: <a href="http://127.0.0.1:9000/api/status">http://127.0.0.1:9000/api/status</a></p>
<blockquote id="error">
<p><b>Connection to 127.0.0.1 failed.</b></p>
</blockquote>
<p id="sysmsg">The system returned: <i>(111) Connection refused</i></p>
<p>The remote host or network may be down. Please try the request again.</p>
<p>Your cache administrator is <a href="mailto:COMPANY_MAIL?subject=CacheErrorInfo%20-%20ERR_CONNECT_FAIL&body=CacheHost%3A%20AEOFFVMPROXY01%0D%0AErrPage%3A%20ERR_CONNECT_FAIL%0D%0AErr%3A%20(111)%20Connection%20refused%0D%0ATimeStamp%3A%20Thu,%2003%20Aug%202023%2006%3A41%3A22%20GMT%0D%0A%0D%0AClientIP%3A%2010.97.120.4%0D%0AServerIP%3A%20127.0.0.1%0D%0A%0D%0AHTTP%20Request%3A%0D%0AGET%20%2Fapi%2Fstatus%20HTTP%2F1.1%0AAccept-Encoding%3A%20gzip,%20deflate%0D%0AConnection%3A%20keep-alive%0D%0AUser-Agent%3A%20python-httpx%2F0.24.1%0D%0AAccept%3A%20application%2Fjson%0D%0Ax-tr-applicationid%3A%20f261cd8230cf4bf69684d93bd18571d6f8dac89d%0D%0AHost%3A%20127.0.0.1%3A9000%0D%0A%0D%0A%0D%0A">COMPANY_MAIL</a>.</p>
<br>
</div>
<hr>
<div id="footer">
<p>Generated Thu, 03 Aug 2023 06:41:22 GMT by COMPANY_MACHINE (squid/5.7-20221209-r9d0b81efb)</p>
<!-- ERR_CONNECT_FAIL -->
</div>
</body></html>
I'm behind the company firewall and using company-wise proxy server together. Should my company allow some connection? If so, any ip or information which we should allow?
Thanks
0 -
0
Categories
- All Categories
- 3 Polls
- 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
- 614 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
- 640 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
- 90 Workspace SDK
- 11 Element Framework
- 5 Grid
- 18 World-Check Data File
- 1 Yield Book Analytics
- 46 中文论坛