Timestamp in Tick History Historical Search API

Options

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.


@Vinod A @Beera.Rajesh

Tagged:

Best Answer

  • zoya faberov
    zoya faberov ✭✭✭✭✭
    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?



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
    }
    }

  • zoya faberov
    zoya faberov ✭✭✭✭✭

    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