Eikon API - Missing Data (vs Excel/Desktop Application)
Hi,
import pandas as pd
import eikon as ek
start_date = '2022-07-22'
end_date = '2022-07-22'
api_key = <API KEY>
id_list = ["US06654DAG25"]
ek.set_app_key(api_key)
if isinstance(id_list, str):
id_list =[id_list]
fields = ['TR.BIDPRICE', 'TR.ASKPRICE', 'TR.ASKPRICE.calcdate', 'TR.FiCurrency']
parameters = {'Frq': 'D', 'Sdate': start_date, 'Edate': end_date}
df, _ = ek.get_data(instruments = id_list, fields = fields, parameters = parameters)
Output:
However, using it from Excel:
=@TR("06654DAG2=","TR.BIDPRICE;TR.ASKPRICE","SDate=2022-07-22 CH=Fd RH=IN",B2)
Would appreciate any help as to why NA is being returned.
Thanks.
Best Answer
-
Hello @wesley.ng and all,
Conveying the resolution from the support team:
"...Have you tried restarting your computer to refresh your system?
=========
Client replied confirming it's now working. case good to close"
0
Answers
-
I can run it properly.
You may need to check the error returned from the get_data method.
df, err = ek.get_data(instruments = id_list, fields = fields, parameters = parameters)
errAre you using "import eikon as ek" or "import refinitiv.dataplatform.eikon as ek"?
0 -
Using
import eikon as ek
Have updated the original post accordingly.
Here is the error:
0 -
Please set the log_level to one and share the request and response log.
import eikon as ek
ek.set_log_level(1)For example:
2022-08-05 16:50:32,075 P[24780] [MainThread 39764] entity: DataGrid_StandardAsync
2022-08-05 16:50:32,076 P[24780] [MainThread 39764] payload: {'requests': [{'instruments': ['US06654DAG25'], 'fields': [{'name': 'TR.BIDPRICE'}, {'name': 'TR.ASKPRICE'}, {'name': 'TR.ASKPRICE.calcdate'}, {'name': 'TR.FiCurrency'}], 'parameters': {'Frq': 'D', 'Sdate': '2022-07-22', 'Edate': '2022-07-22'}}]}
2022-08-05 16:50:32,079 P[24780] [MainThread 39764] Request:{'Entity': {'E': 'DataGrid_StandardAsync', 'W': {'requests': [{'instruments': ['US06654DAG25'], 'fields': [{'name': 'TR.BIDPRICE'}, {'name': 'TR.ASKPRICE'}, {'name': 'TR.ASKPRICE.calcdate'}, {'name': 'TR.FiCurrency'}], 'parameters': {'Frq': 'D', 'Sdate': '2022-07-22', 'Edate': '2022-07-22'}}]}}}
2022-08-05 16:50:32,080 P[24780] [MainThread 39764] Request to http://127.0.0.1:9001/api/v1/data
headers = {'Content-Type': 'application/json', 'x-tr-applicationid': '...', 'Authorization': 'Bearer ...'}
params = None
2022-08-05 16:50:33,509 P[24780] [MainThread 39764] Send request with headers [(b'Host', b'127.0.0.1:9001'), (b'Accept', b'application/json'), (b'Accept-Encoding', b'gzip, deflate'), (b'Connection', b'keep-alive'), (b'User-Agent', b'python-httpx/0.21.3'), (b'Content-Type', b'application/json'), (b'x-tr-applicationid', b'...'), (b'Content-Length', b'296')] and cookies None
2022-08-05 16:50:33,510 P[24780] [MainThread 39764] HTTP request response 200: {"responses":[{"columnHeadersCount":1,"data":[["US06654DAG25",79.684,79.932,"2022-07-22","USD"]],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"Bid Price","field":"TR.BIDPRICE"},{"displayName":"Ask Price","field":"TR.ASKPRICE"},{"displayName":"Calc Date","field":"TR.ASKPRICE.calcdate"},{"displayName":"Currency","field":"TR.FICURRENCY"}]],"rowHeadersCount":1,"totalColumnsCount":5,"totalRowsCount":2}]}
2022-08-05 16:50:33,512 P[24780] [MainThread 39764] HTTP Response code: 200
2022-08-05 16:50:33,513 P[24780] [MainThread 39764] HTTP Response: {"responses":[{"columnHeadersCount":1,"data":[["US06654DAG25",79.684,79.932,"2022-07-22","USD"]],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"Bid Price","field":"TR.BIDPRICE"},{"displayName":"Ask Price","field":"TR.ASKPRICE"},{"displayName":"Calc Date","field":"TR.ASKPRICE.calcdate"},{"displayName":"Currency","field":"TR.FICURRENCY"}]],"rowHeadersCount":1,"totalColumnsCount":5,"totalRowsCount":2}]}
2022-08-05 16:50:33,514 P[24780] [MainThread 39764] Response size: 530You may try to use id_list = ["06654DAG2="] instead.
start_date = '2022-07-22'
end_date = '2022-07-22'
id_list = ["06654DAG2="]
if isinstance(id_list, str):
id_list =[id_list]
fields = ['TR.BIDPRICE', 'TR.ASKPRICE', 'TR.ASKPRICE.calcdate', 'TR.FiCurrency']
parameters = {'Frq': 'D', 'Sdate': start_date, 'Edate': end_date}
df, err = ek.get_data(instruments = id_list, fields = fields, parameters = parameters)
df0 -
I can't use the RIC instead of the ISIN due to the existing process I've set up - this is one ISIN out of hundreds that is failing - the rest work fine.
Log response:
2022-08-05 17:58:03,609 P[31436] [MainThread 18388] entity: DataGrid_StandardAsync
2022-08-05 17:58:03,612 P[31436] [MainThread 18388] payload: {'requests': [{'instruments': ['US06654DAG25'], 'fields': [{'name': 'TR.BIDPRICE'}, {'name': 'TR.ASKPRICE'}, {'name': 'TR.ASKPRICE.calcdate'}, {'name': 'TR.FiCurrency'}], 'parameters': {'Frq': 'D', 'Sdate': '2022-07-22', 'Edate': '2022-07-22'}}]}
2022-08-05 17:58:03,615 P[31436] [MainThread 18388] Request:{'Entity': {'E': 'DataGrid_StandardAsync', 'W': {'requests': [{'instruments': ['US06654DAG25'], 'fields': [{'name': 'TR.BIDPRICE'}, {'name': 'TR.ASKPRICE'}, {'name': 'TR.ASKPRICE.calcdate'}, {'name': 'TR.FiCurrency'}], 'parameters': {'Frq': 'D', 'Sdate': '2022-07-22', 'Edate': '2022-07-22'}}]}}}
2022-08-05 17:58:03,618 P[31436] [MainThread 18388] Request to http://127.0.0.1:9060/api/v1/data
headers = {'Content-Type': 'application/json', 'x-tr-applicationid': '...', 'Authorization': 'Bearer...'}
params = None
2022-08-05 17:58:05,646 P[31436] [MainThread 18388] HTTP request response 200: {"responses":[{"columnHeadersCount":1,"data":[["US06654DAG25",null,null,null,"USD"]],"error":[{"code":416,"col":1,"message":"Unable to collect data for the field 'TR.BIDPRICE' and some specific identifier(s).","row":0},{"code":416,"col":2,"message":"Unable to collect data for the field 'TR.ASKPRICE' and some specific identifier(s).","row":0},{"code":416,"col":3,"message":"Unable to collect data for the field 'TR.ASKPRICE.calcdate' and some specific identifier(s).","row":0}],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"Bid Price","field":"TR.BIDPRICE"},{"displayName":"Ask Price","field":"TR.ASKPRICE"},{"displayName":"Calc Date","field":"TR.ASKPRICE.calcdate"},{"displayName":"Currency","field":"TR.FICURRENCY"}]],"rowHeadersCount":1,"totalColumnsCount":5,"totalRowsCount":2}]}
2022-08-05 17:58:05,650 P[31436] [MainThread 18388] HTTP Response code: 200
2022-08-05 17:58:05,652 P[31436] [MainThread 18388] HTTP Response: {"responses":[{"columnHeadersCount":1,"data":[["US06654DAG25",null,null,null,"USD"]],"error":[{"code":416,"col":1,"message":"Unable to collect data for the field 'TR.BIDPRICE' and some specific identifier(s).","row":0},{"code":416,"col":2,"message":"Unable to collect data for the field 'TR.ASKPRICE' and some specific identifier(s).","row":0},{"code":416,"col":3,"message":"Unable to collect data for the field 'TR.ASKPRICE.calcdate' and some specific identifier(s).","row":0}],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"Bid Price","field":"TR.BIDPRICE"},{"displayName":"Ask Price","field":"TR.ASKPRICE"},{"displayName":"Calc Date","field":"TR.ASKPRICE.calcdate"},{"displayName":"Currency","field":"TR.FICURRENCY"}]],"rowHeadersCount":1,"totalColumnsCount":5,"totalRowsCount":2}]}
2022-08-05 17:58:05,662 P[31436] [MainThread 18388] Response size: 9370 -
The request messages are similar but the responses are different. It could be a permission issue.
I have submitted a new case on your behalf to the Eikon support team to verify what the problem is. The case number is 11481934. The Eikon support team will contact you directly to investigate the issue.
0 -
Thanks Jirapongse, have a good weekend.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 中文论坛