Timestamp in Tick History Historical Search API
Client ID: 9013472
Please let us know if the timestamp in result is local or UTC for the response First Date and Last Date.
I provide the code below:
RESTURL = https://selectapi.datascope.refinitiv.com/RestApi/v1/
BULKSEARCHURL = RESTURL + "Search/HistoricalBulkSearch"
headers = {
'Authorization': "Token " + _token,
'X-Client-Session-Id': _sessionid,
'Prefer': 'respond-async',
'Content-Type': 'application/json; odata=minimalmetadata'
}
content = json.dumps({
'Request': {
'Identifiers': identifier,
'Range': {
'Start': start,
'End': end
},
'ResultsBy': 'Ric'}
})
toLog("Validating RICs...")
resp = requests.post(BULKSEARCHURL, data = content, headers = headers)
Result:
Results {
Identifier: "HUH1V.HE"
IdentifierType: Ric
Key: "VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxIVUgxVi5IRXw"
Description: "Historical Instrument"
DomainCode: "6"
FirstDate {
seconds: 987465600 //2001-04-16 20:00:00.000
}
LastDate {
seconds: 1647907200 //2022-03-21 20:00:00.000
}
}
Also, Could you just let me know how to add the option to define response results to be GMT or not for the API request?
Is there a way to add it into the body.
Best Answer
-
Hello @Vinod A,
From my testing if I run the bulk search via API ( I test with Postman):
{{protocol}}{{host}}{{api}}Search/HistoricalBulkSearch
{
"Request": {
"Identifiers": [
{
"Identifier": "TRI.N",
"IdentifierType": "Ric",
"LineNumber": "0",
"Exchange": "",
"Currency": ""
},
{
"Identifier": "CA8849031056",
"IdentifierType": "Isin",
"LineNumber": "1",
"Exchange": "",
"Currency": ""
}
],
"Range": {
"Start": "2015-11-17T00:00:00.000Z",
"End": "2015-11-24T00:00:00.000Z"
}
}
}My result is:
{
"@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#DataScope.Select.Api.Search.HistoricalBulkSearchResult",
"Results": [
{
"Identifier": "TRI.N",
"IdentifierType": "Ric",
"Source": "",
"Key": "VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxUUkkuTnw",
"Description": "Historical Instrument",
"InstrumentType": "Unknown",
"Status": "Valid",
"DomainCode": "6",
"FirstDate": "1996-01-02T00:00:00.000Z",
"LastDate": "2022-03-23T00:00:00.000Z",
"History": []
},
...Where Z is the zone designator for the zero UTC offset.
Do you observe the same format of the results?
If I try to pass the format such as in the comment in the question:
"Range": {
"Start": "2001-04-16 20:00:00.000",
...this results in:
{
"error": {
"message": "Malformed request payload: Invalid DateTimeOffset format '2001-04-16 20:00:00.000Z' for property Start. Expected 'year \"-\" month \"-\" day \"T\" hour \":\" minute [ \":\" second [ \".\" fractionalSeconds ] ] ( \"Z\" / sign hour \":\" minute )'."
}
}Further, per HistoricalBulkSearch spec in REST API Reference Tree there is no option to specify a different request or result date time zone.
I believe I know what you refer to, with several of the extraction request types, an option to specify time zone for request and for result is included, but not for HistoricalBulkSearch.
Hope this information helps?
0
Answers
-
Hi @zoya faberov Thank you.
But wanted to how client was able to get the result without the GMT timezone. Below highlighted; is it considering his local time or User Preference.
Client Result:
Results {
Identifier: "HUH1V.HE"
IdentifierType: Ric
Key: "VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxIVUgxVi5IRXw"
Description: "Historical Instrument"
DomainCode: "6"
FirstDate {
seconds: 987465600 //2001-04-16 20:00:00.000
}
LastDate {
seconds: 1647907200 //2022-03-21 20:00:00.000
}
}0 -
Hello @Vinod A ,
More information from the client would be very helpful:
- The complete request being submitted
- Any non-default settings in their Datascope User Preferences
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
- 690 Datastream
- 1.5K DSS
- 629 Eikon COM
- 5.2K Eikon Data APIs
- 11 Electronic Trading
- 1 Generic FIX
- 7 Local Bank Node API
- 3 Trading API
- 2.9K Elektron
- 1.4K EMA
- 255 ETA
- 560 WebSocket API
- 39 FX Venues
- 15 FX Market Data
- 1 FX Post Trade
- 1 FX Trading - Matching
- 12 FX Trading – RFQ Maker
- 5 Intelligent Tagging
- 2 Legal One
- 25 Messenger Bot
- 3 Messenger Side by Side
- 9 ONESOURCE
- 7 Indirect Tax
- 60 Open Calais
- 281 Open PermID
- 46 Entity Search
- 2 Org ID
- 1 PAM
- PAM - Logging
- 6 Product Insight
- Project Tracking
- ProView
- ProView Internal
- 23 RDMS
- 2K Refinitiv Data Platform
- 724 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
- 106 UPA
- 194 TREP Infrastructure
- 229 TRKD
- 918 TRTH
- 5 Velocity Analytics
- 9 Wealth Management Web Services
- 95 Workspace SDK
- 11 Element Framework
- 5 Grid
- 19 World-Check Data File
- 1 Yield Book Analytics
- 48 中文论坛