question

Upvotes
Accepted
36 4 6 10

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.


@Vinod A @Beera.Rajesh

trth-rest-api
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

<AHS>

ZF- looking

@Vinod A

Hi,

Thank you for your participation in the forum.

Are any of the replies below satisfactory in resolving your query?

If yes please click the 'Accept' text next to the most appropriate reply. This will guide all community members who have a similar question.

Otherwise please post again offering further insight into your question.

Thanks,

AHS

@Vinod A

Hi,

Please be informed that a reply has been verified as correct in answering the question, and marked as such.

Thanks,

AHS

Upvote
Accepted
32.2k 40 11 20

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?



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
36 4 6 10

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

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Upvotes
32.2k 40 11 20

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



icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Hi @Vinod A,

Can you please share the above-requested information to further assist with this?


Thanks,

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.