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.
0 -
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.
0 -
@Jirapongse, thanks for the API update !
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
- 685 Datastream
- 1.4K DSS
- 616 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
- 252 ETA
- 557 WebSocket API
- 38 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
- 653 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
- 27 DACS Station
- 121 Open DACS
- 1.1K RFA
- 104 UPA
- 193 TREP Infrastructure
- 229 TRKD
- 917 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 中文论坛