Refinitiv.Data .NET library passes DateTime in incorrect format to interday-summaries endpoint

This is referring to my recent report:
I got an answer from the Historical Pricing API Support Team:After investigating the issue, we found that the problem arises because the request you are submitting is using an incorrect date format for start/end parameters – the correct date format is
yyyy-mm-dd
ex.
2024-12-03
. The API is currently unable to process the data correctly due to this format mismatch.
We are using the Refinitiv.Data .NET library which does the call under the hood. We are passing in a DateTime to Refinitiv.Data.Content.HistoricalPricing.SummariesDefinition.Start(DateTime date) method. Apparently this translates the given DateTime object into an incompatible string representation.
Answers
-
Thank you for reaching out to us.
I found that the Start and End parameters also accept a string.
Therefore, you can connect the DateTime to a compatible date string representation.
0 -
Yes this is actually already my current workaround. The library should still be changed so that it works as expected when using DateTime.
0 -
» We are passing in a DateTime to Refinitiv.Data.Content.HistoricalPricing.SummariesDefinition.Start(DateTime date) method. Apparently this translates the given DateTime object into an incompatible string representation.
Can you share the code you are using that defines the DateTime and the HistoricalPricing call you are making? For example, I just tried this interday monthly request using the following:
var start = new DateTime(2024, 1, 1);
var response = Summaries.Definition("VOD.L").Interval(Summaries.Interval.P1M)
.Fields("TRDPRC_1", "LOW_1", "HIGH_1")
.Start(start)
.GetData();0 -
Sure,
rdpRequest.Start(fromDateTime.Value.UtcDateTime.Date)
where fromDateTime is a (nullable) DateTimeOffset with Offset == Timespan.Zero. Note we are using the Date part only, which obviously is a DateTime with hours, mins, secs etc == 0.
By the way, you are using "P1M" in your posted example. We were using "P1D".
Also note that the upstream rest API does not always omit the daily bar at fromDate.0 -
I uses the LSEG Data Libaray for .NET and enable the Trace log.
Log.Level = NLog.LogLevel.Trace;
Log.Output = (loginfo, parms) => Console.WriteLine($"Application: {loginfo.Level} - {loginfo.FormattedMessage}"); using ISession session = Sessions.GetSession();
session.Open();
var response = Summaries.Definition("VOD.L").Interval(Summaries.Interval.P1D)
.Fields("DATE", "TRDPRC_1", "MKT_OPEN", "VWAP", "LOW_1", "HIGH_1")
.Start(new DateTime(2025, 03, 01))
.End(new DateTime(2025, 03, 03))
.GetData();The log shows that the start and end dates in the request message are correct.
0 -
- I cannot confirm this. It is consistently adding 0 time for me. This is from the activated log:
2025-03-14T10:50:53 Debug Refinitiv.Data.Delivery.Request.EndpointDefinition Preparing Endpoint GET request http://localhost:9060/api/rdp/data/historical-pricing/v1/views/interday-summaries/FDXZ2^2?fields=DATE,TRDPRC_1,OPEN_PRC,HIGH_1,LOW_1,ACVOL_UNS&interval=P1D&start=2022-09-16T00:00:00.0000000Z&end=2022-12-15T00:00:00.0000000&count=10000&sessions=normal
Method: GET, RequestUri: 'http://localhost:9060/api/rdp/data/historical-pricing/v1/views/interday-summaries/FDXZ2^2?fields=DATE,TRDPRC_1,OPEN_PRC,HIGH_1,LOW_1,ACVOL_UNS&interval=P1D&start=2022-09-16T00:00:00.0000000Z&end=2022-12-15T00:00:00.0000000&count=10000&sessions=normal', Version: 1.1, Content: <null>, Headers:
2025-03-14T10:50:53 Debug Refinitiv.Data.Delivery.Request.EndpointDefinition Preparing Endpoint GET request http://localhost:9060/api/rdp/data/historical-pricing/v1/views/interday-summaries/FDXZ2%255E2?fields=DATE,TRDPRC_1,OPEN_PRC,HIGH_1,LOW_1,ACVOL_UNS&interval=P1D&start=2022-09-16T00:00:00.0000000Z&end=2022-12-15T00:00:00.0000000&count=10000&sessions=normal
Method: GET, RequestUri: 'http://localhost:9060/api/rdp/data/historical-pricing/v1/views/interday-summaries/FDXZ2%255E2?fields=DATE,TRDPRC_1,OPEN_PRC,HIGH_1,LOW_1,ACVOL_UNS&interval=P1D&start=2022-09-16T00:00:00.0000000Z&end=2022-12-15T00:00:00.0000000&count=10000&sessions=normal', Version: 1.1, Content: <null>, Headers:
0 -
Can you share the full code?
0 -
I did, see my reply to Nick above
0 -
That is not the full code.
I can't run it.
It should be like this:
session.Open();
var response = Summaries.Definition("VOD.L").Interval(Summaries.Interval.P1D)
.Fields("DATE", "TRDPRC_1", "MKT_OPEN", "VWAP", "LOW_1", "HIGH_1")
.Start(new DateTime(2025, 03, 01))
.End(new DateTime(2025, 03, 03))
.GetData();0 -
var rdpRequest = Summaries.Definition(ric)
.Interval(request.BarInterval.Value)
.Count(requestCount)
.Sessions(ConvertSessions());
if (request.Fields?.Any() == true)
rdpRequest = rdpRequest.Fields(request.Fields);
if (request.FromDateTime.HasValue)
rdpRequest = rdpRequest.Start(request.FromDateTime.Value.UtcDateTime);
var maxDate = DateTime.UtcNow.Date.AddMonths(1);
if (request.ToDateTime.HasValue && request.ToDateTime.Value.UtcDateTime.Date < maxDate)
rdpRequest = rdpRequest.End(request.ToDateTime.Value.UtcDateTime);
IDataSetResponse response = await rdpRequest.GetDataAsync();0 -
I assume that you are using the old version of RD Library.
I tested with 1.0.0-beta1 and found that it sends this request.
Application: Trace - Sending HTTP request:
"Method: GET, RequestUri: 'http://localhost:9001/api/rdp//data/historical-pricing/v1/views/interday-summaries/FDXZ2^2?fields=DATE%2CTRDPRC_1%2COPEN_PRC%2CHIGH_1%2CLOW_1%2CACVOL_UNS&interval=P1D&start=2022-09-16T00%3A00%3A00.0000000Z&end=2022-12-15T00%3A00%3A00.0000000Z&count=10000&sessions=normal', Version: 1.1, Content: <null>, Headers:However, if I used 1.0.0-beta5, the request is:
Application: Debug - Preparing Endpoint GET request http://localhost:9001/api/rdp/data/historical-pricing/v1/views/interday-summaries/FDXZ2^2?fields=DATE%2CTRDPRC_1%2COPEN_PRC%2CHIGH_1%2CLOW_1%2CACVOL_UNS&interval=P1D&start=2022-09-16&end=2022-12-15&count=10000&sessions=normal
Application: Trace - Sending HTTP request:Please verify the version of the RD Library.
You may need to upgrade the application to use the LSEG Data Library fo .NET instead.
0 -
according to nuget package manager, we are on beta5
0 -
And what does this mean?
"You may need to upgrade the application to use the LSEG Data Library fo Python instead."
We are not using Python but .NET.0 -
Based on your description of 'fromDateTime', I created this little test example that I want you to try:
DateTimeOffset? fromDateTime = new DateTimeOffset(new DateTime(2022, 9, 16), TimeSpan.Zero);
var dt = fromDateTime.Value.UtcDateTime.Date;
Console.WriteLine(dt);
var test = Summaries.Definition("FDXZ2^2").Interval(Summaries.Interval.P1D)
.Fields("DATE", "TRDPRC_1", "OPEN_PRC", "HIGH_1", "LOW_1", "ACVOL_UNS")
.Start(dt)
.GetData();When I look within the logs, I see this:
'http://localhost:9001/api/rdp/data/historical-pricing/v1/views/interday-summaries/FDXZ2^2?fields=DATE%2CTRDPRC_1%2COPEN_PRC%2CHIGH_1%2CLOW_1%2CACVOL_UNS&interval=P1D&start=2022-09-16'
I'm using the production version of the library which was released last year as a result of our company requirements to rebrand to LSEG: NuGet Gallery | LSEG.Data 2.0.0Ideally, you should upgrade to the latest. In terms of changes, they are minimal. You can find details within the GitHub example package: LSEG-API-Samples/Example.DataLibrary.DotNet: Example projects demonstrating access to the Refinitiv Data Platform using the Refinitiv Data Library for .NET.
Refer to the bottom of the Readme (Migration).
0 -
Sorry. I meant LSEG Data Library for .NET.
I have edited the response.
0 -
2025-03-17T07:54:51 Trace Refinitiv.Data.Core.DesktopSessionCore Sending HTTP request:
Method: GET, RequestUri: 'http://localhost:9000/api/rdp/data/historical-pricing/v1/views/interday-summaries/FDXZ2^2?fields=DATE,TRDPRC_1,OPEN_PRC,HIGH_1,LOW_1,ACVOL_UNS&interval=P1D&start=2022-09-16', Version: 1.1, Content: <null>, Headers:0 -
Ok, with a bit of experimentation I can reproduce this now with this minimal repro:
var test = Summaries.Definition("FDXZ2^2")
.Interval(Summaries.Interval.P1D)
.Fields("TRDPRC_1", "LOW_1", "HIGH_1")
.Start(new DateTime(2022, 9, 16));
Debug.WriteLine(test.Properties); // ***
var testResponse = test.GetData();
Debug.WriteLine(test.Properties);When commenting out the line marked ***, it will work as expected.
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
- 615 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
- 556 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
- 650 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
- 228 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 中文论坛