Error code 404 in Python
Today I can not retrieve EOD price of yesterday.
I use python and get error like this
Python worked for a years, but the last 2 days have not work
.
Error code 404 | Client Error: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/v1/data</pre>
</body>
</html>
Traceback (most recent call last):
File "C:\Users\Administrator\Desktop\py\daily_price_insert.py", line 61, in <module>
df, e = ek.get_data(screener_exp,fields=field2, parameters=parameter)
File "C:\Python\Python37\lib\site-packages\eikon\data_grid.py", line 186, in get_data
result = eikon.json_requests.send_json_request(_endpoint, payload, debug=debug)
File "C:\Python\Python37\lib\site-packages\eikon\json_requests.py", line 121, in send_json_request
_raise_for_status(response)
File "C:\Python\Python37\lib\site-packages\eikon\json_requests.py", line 244, in _raise_for_status
raise EikonError(response.status_code, error_msg)
eikon.eikonError.EikonError: Error code 404 | Client Error: <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>Cannot POST /api/v1/data</pre>
</body>
</html>
Best Answer
-
Hi @tanin,
The first step with any error is to activate debug traces and check log files.
As this log file contains personal info related to your user account (app_key, user login, ...), it's recommended to verify what you'll post.
About your case, we need more information, at least the log file. You can send it to customer support, they'll forward us.
Did you check basic steps from Eikon Data API(Python) Troubleshooting | Refinitiv ?
Especially, did you check that the session was opened successfully ? (some permission may have been changed)0
Answers
-
Hi @FrancesGale.Sulam ,
For internal support on Python libs, please send an email to dataapispythonsupport@lseg.com
0 -
Hi Team, This is not for me. I submitted this for an external client0
-
I use this code for a years but last 2 days it shows error
.
Error code 404 | Client Error: <!DOCTYPE html>
.
how to solve this?0 -
This is an urgent issue, so please help
0 -
Moreover because this is not a technical issue within the API but something specific to the client and it'll need to share user info that shouldn't be published on this site.
0 -
hi @tanin and @FrancesGale.Sulam ,
Could you please try restarting your machine and relogging into Eikon and check if the issue still persists?
If so, please try step no. 7 in this article, Eikon Data API(Python) Troubleshooting | Refinitiv and check if you have API endpoint enabled or not. Then please let us know the result for further investigation.
0 -
Hi pf
I'm in Thailand and every morning I use python and can retrieve data everyday, but last 2 days it can not retrieve in morning (8am) but can retrieve in the afternoon (2pm), so I think no problem in python code
0 -
hi @tanin ,
Sorry to hear that the issue occurs. However, for further investigation, could you please provide the log of when the error occurred and when the code ran successfully, and the code snippet used?
Then the log and code are going to be checked what's going on during that specific run (when the error occurred and when it ran successfully) and used to reproduce the issue.
0 -
import eikon as ek
import pandas as pd
#!/usr/bin/python
from pandas.io import sqlek.set_app_key('xxxxxxxxx')
screener_exp ='SCREEN(U(IN(Equity(active,public,primary))), IN(TR.ExchangeCountryCode,TH))'
field1= ['TR.CommonName','TR.TickerSymbol','TR.ExchangeMarketIdCode','TR.PriceCloseDate',
'TR.PriceOpen','TR.PriceHigh','TR.PriceLow','TR.CLOSEPRICE']field2 = ['TR.TickerSymbol','TR.PriceCloseDate','TR.PriceOpen','TR.PriceHigh','TR.PriceLow','TR.CLOSEPRICE','TR.Volume','TR.TSVWAP']
parameter={'SDate':0, 'EDate':0, 'Frq' : 'D' }df = pd.DataFrame()
df, e = ek.get_data(screener_exp,fields=field2, parameters=parameter)
.
and got error Error code 404 | Client Error: <!DOCTYPE html>0 -
but today it's work !!! so I think python code is not problem but maybe data pipeline has something wrong0
-
today it's work, no problem like last 2 days.0
-
hi @tanin ,
I also can not reproduce the error. Could you please get the log based on the article mentioned above and provide it for investigation if the issue persists again next time?
I'm really sorry for this inconvinient.
0 -
Yes, the problem occurred for a short 2-days period, at that time if we reproduced it, we will always see it. But now the issue is gone by itself. With the same code, we either couldn't reproduce it. We think there could be something in Refinitiv's data server/feed triggered it.
Next time, if we face this same issue again, we will enable the log and get the log to you.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 中文论坛