EikonDataAPI for .NET issue : data not received
Hi,
I have the following initialization code in F#:
open EikonDataAPI
let eikon =
try
let eikon = Eikon.CreateDataAPI()
eikon.SetAppKey("...")
eikon
with
_ -> invalidArg "Eikon" "Eikon could not be started"
First issue comes with the sample below :
let sd = DateTime(2022, 1, 1)
let ed = DateTime.Now
eikon.GetTimeSeries("EURRUBFIX=CBRF", sd, ed, interval=Interval.daily, fields=[TimeSeriesField.TIMESTAMP]) ;;
Will ont return data beyond January 25 while the fixings are available in Eikon. Thus, any request with a start date in April 2022 (for instance) will fail.
Second issue comes with GetData when fetching CF_LAST:
let scaling = eikon.GetData("EUR=", "SCALING", null).Rows //works OK, returns a result
let lastPrice = eikon.GetData("EUR=", "CF_LAST", null).Rows //raises an exception : Index was outside the bounds of the array.
What's going on with EikonDataAPI ? Are there some new data restrictions ?
Best Answer
-
Thank you for sharing. I can replicate the issue by changing the decimal symbol to ','.
A solution could be enclosing a string that has comma characters in double quotation marks.
Therefore, CSV content looks like this:
Instrument,CF_LAST
IBM.N,"138,32"With this method, the data type of the CF_LAST is still a number.
InstrumentCF_LAST
IBM.N 138,32
System.SingleI have published EikonDataAPI 0.4.9 to fix this issue.
0
Answers
-
I can retrieve the data properly, as shown below. I am using EikonDataAPI -Version 0.4.8.
The last data was available on 2022-03-23.
You can use the GetTimeSeriesRaw or GetDataRow methods instead to verify retrieved data. Otherwise, you can also enable logging in the API. Please refer to the Logging section in the .NET Libraries for Eikon Data APIs Quick Start article.
1 -
Hi,
I am linking : ..../.nuget/packages/eikondataapi/0.4.8/lib/net5.0/EikonDataAPI.dll
I set the debugging level and called GetData and GetdataRaw. In both cases, it seems the data is fetched (s we can se ethe last price in the data that is received), but GetData seems to raise an unexpected exception.
GetDataRaw seems to be ok :
vs. the exception with GetData (despite the info being there) :
Any idea what could be wrong ?
Thanks
0 -
I am compiling to net 6.0 (and have an "open Micorsoft.Data.Analysis" statement at the top), if that info is of any use...
0 -
Here is the notebook view
0 -
That is strange. I can run it properly.
I am using VS 2022 with NET 6.0.
The raw response is:
"{"responses":[{"columnHeadersCount":1,"data":[["EUR=",1.0816]],"headerOrientation":"horizontal","headers":[[{"displayName":"Instrument"},{"displayName":"CF_LAST","field":"CF_LAST"}]],"rowHeadersCount":1,"totalColumnsCount":2,"totalRowsCount":2}]}"
Are you using these versions?
0 -
Hi,
I am using VS 2019 (but it shouldn't change anything since I tried the code both in Jupyter and in F# script interactive, which are both independent) and .net 6
There is a discrepancy for NewtonsoftJson
I have tried downgrading to 12.0.3, but to no effect.
Any chance I could send you the minimal F# project that doesn't work to see if it works on your end ?
0 -
Is it macOS or Windows?0
-
There's little doubt the issue comes form the parsing of the request.
The data itself is indeed fetched, see for instance with python (same app key)
0 -
Hi,
I have found where the issue comes form.
In the EikonDataAPI, It comes from :
stringBuilder.AppendLine(string.Join(",", datum.Select((JValue value) => value.Value)));in CreateCSVFromDataResponse(DataResponse response)
In particular, it comes form the call to String.Join, which apparently does not use the InvariantCulture, resulting in a change of format of numbers. See below for a concrete example :
The conversion results in having multiple commas in the string before Microsoft.Data.Analysis tries to load the csv string, see here :
As a result, it raises an exception.
Any chance to raise a ticket to update the code and ensure the code is added with something like :
open System.Globalization
String.Format(CultureInfo.InvariantCulture,"{0}", value.Value)
Meanwhile, using :
CultureInfo.CurrentCulture <- CultureInfo.InvariantCulture
works as a workaround... but it has to be added in all projects, which is less than ideal.
1 -
@Jirapongse, thanks for the API update !
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 中文论坛