Python Eikon API - Insufficient Data
Hello,
I also see this issue when inside the codebook.
WARNING:pyeikon:Error with FXDKWEUR17=NPX: Insufficient data
ERROR:pyeikon:FXDKWEUR17=NPX: Insufficient data |
The weird thing is that there is actually no error, i can see the data inside the date frame. Any idea why it is coming up?
Best Answer
-
Hello @Moody ,
I have run your code several times, in CodeBook, I have reproduced the issue twice, for different instruments.
I suspect that the issue is not a specific content issue, as was identified and discussed in the previous discussion thread, but with the tight loop hitting 5 requests per second limit, from time to time, please see Eikon Data API Usage and Limits Guideline for the complete details.
I have introduced a brief pause after every 4 requests:
import datetime as dt
import pytz
import time
npast = 20
sdate = (pd.datetime.now()+pd.DateOffset(days=-npast, normalize=True)).strftime("%Y-%m-%d")
allHist = pd.DataFrame()
ricbase = "FXDKWEUR"
ricend = "=NPX"
for i in range(1,25):
ric = ricbase + str(i).zfill(2) + ricend
print(ric)
try:
data = ek.get_timeseries([ric], start_date= sdate, fields="CLOSE").reset_index()
except:
print(f"failed for {ric}")
hour = i-1 #str(i -1)
dataF = data.rename({"CLOSE": hour}, axis=1)
dataF_m = dataF.melt(id_vars = ["Date"], var_name = "hour")
allHist = pd.concat([allHist, dataF_m])
if (i % 4) == 0:
print('Sleep 2')
time.sleep(2)On my side, I have tested a couple of times and I am not hitting the issue anymore.
Please test- let us know how this works for you?
0
Answers
-
Hello @Moody ,
Thank you.
To verify, inside CodeBook I run:
ek.get_timeseries(['FXDKWEUR17=NPX'], start_date = '2020-04-24', end_date = '2020-09-11')
My result was:
I was not able to reproduce this way -
Is this the exact same request that you run inside CodeBook? Is the error consistent on your side?
Next, with regard to this related discussion thread, as recommended by @pierre.faurel, if the same issue is reproducible in Eikon Excel, it will need to be approached and addressed, as content issue.
0 -
hello,
please try this script:
import refinitiv.data as rd
rd.open_session()
rd.get_history(universe=["FXSE4EUR16=NPX"],
fields="TRDPRC_1",
interval="1D",
start="2021-05-12", end="2022-05-01")
0 -
import datetime as dt
import pytz
npast = 20
sdate = (pd.datetime.now()+pd.DateOffset(days=-npast, normalize=True)).strftime("%Y-%m-%d")
allHist = pd.DataFrame()
ricbase = "FXDKWEUR"
ricend = "=NPX"
for i in range(1,25):
ric = ricbase + str(i).zfill(2) + ricend
print(ric)
try:
data = ek.get_timeseries([ric], start_date= sdate, fields="CLOSE").reset_index()
except:
print(f"failed for {ric}")
hour = i-1 #str(i -1)
dataF = data.rename({"CLOSE": hour}, axis=1)
dataF_m = dataF.melt(id_vars = ["Date"], var_name = "hour")
allHist = pd.concat([allHist, dataF_m])hello,
could you please test this script inside your codebook. You will see an error run here:
WARNING:pyeikon:Error with FXDKWEUR17=NPX: Insufficient data
ERROR:pyeikon:FXDKWEUR17=NPX: Insufficient data |However the data is in the dateframe.
0 -
thank you - that works !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
- 370 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 中文论坛