question

Upvotes
Accepted
36 1 3 6

Using the example code DSS2HistoricalSearchTRTH.java, the returned History is always empty regardless of the date range I use? Does anyone know why this might be the case?

tick-history-rest-apihistorical
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
Accepted
13.7k 26 8 12

@chris.garvin, I added the output of the original request in my 1st answer, to help you understand its structure.

From your 2nd post I see you changed the query instrument, so the number of results will differ. The Java sample uses an ISIN, which delivers several RICs. Your request is obviously for Ric EUR=, which is equivalent to changing this part of the Java code:

.put("IdentifierType", "Ric")
.put("Identifier", "EUR=")

That results in a response containing 1 single record, which is exactly what you have:

{
"@odata.context":
"https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.HistoricalSearchResult)",
"value":
[
{"Status":"Valid","LastDate":"2017-08-11T00:00:00.000Z","Identifier":"EUR=","Description":"Historical Instrument","DomainCode":"6","FirstDate":"1997-07-16T00:00:00.000Z","InstrumentType":"Unknown","History":[],"IdentifierType":"Ric","Source":"","Key":"VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxFVVI9fA"}
]
}

Hope this 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
13.7k 26 8 12

@chris.garvin, I just retested the sample. Out of the box, it delivers results. This is the original request body:

JSONObject searchJSONObject = new JSONObject()
    .put("Request", new JSONObject()
        .put("IdentifierType", "Isin")
        .put("Identifier", "US4592001014")
        .put("Range", new JSONObject()
            .put("Start", "2008-01-01T00:00:00.000Z")
            .put("End", "2008-01-01T00:00:00.000Z")));

Did you change anything in the code, or the instrument (apart from the date range) ?

This is the response (part of the results were removed, as there are many):

{
"@odata.context":
"http://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.HistoricalSearchResult)",
"value":
[
{"Status":"Valid","LastDate":"2017-08-11T00:00:00.000Z","Identifier":"IBM","Description":"Historical Instrument","DomainCode":"6","FirstDate":"1996-01-02T00:00:00.000Z","InstrumentType":"Unknown","History":[],"IdentifierType":"Ric","Source":"","Key":"VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxJQk18"},
"Status":"Valid","LastDate":"2017-08-11T00:00:00.000Z","Identifier":"IBM.C","Description":"Historical Instrument","DomainCode":"6","FirstDate":"1996-01-02T00:00:00.000Z","InstrumentType":"Unknown","History":[],"IdentifierType":"Ric","Source":"","Key":"VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxJQk0uQ3w"},
... etc ...
{"Status":"Valid","LastDate":"2008-11-03T00:00:00.000Z","Identifier":"IBMs.INS","Description":"Historical Instrument","DomainCode":"6","FirstDate":"2006-11-01T00:00:00.000Z","InstrumentType":"Unknown","History":[],"IdentifierType":"Ric","Source":"","Key":"VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxJQk1zLklOU3w"}
]
}
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 1 3 6

OK. I'll have to dig further. I'm actually processing the response in MATLAB so it may be something about the Java calls I'm making there but the response looks like the following. I'm losing something in the History field when it gets processed.

response.Body.Data

ans = struct with fields: x_odata_context: 'http://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.HistoricalSearchResult)' value: [1×1 struct]

response.Body.Data.value

ans =

struct with fields:

Identifier: 'EUR='

IdentifierType: 'Ric'

Source: ''

Key: 'VjF8MHgzMDAwMDAwMDAwMDAwMDAwfDB4MzAwMDAwMDAwMDAwMDAwMHx8fHx8fHxFVVI9fA'

Description: 'Historical Instrument'

InstrumentType: 'Unknown'

Status: 'Valid'

DomainCode: '6'

FirstDate: '1997-07-16T00:00:00.000Z'

LastDate: '2017-08-10T00:00:00.000Z'

History: []

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 1 3 6


Thanks Christiaan. I'm getting these results so it's behaving as expected. Is there example code of making a historical request to return end of day closing prices for example?

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.

@chris.garvin, welcome, and glad it is now working as expected.

The existing Java samples are listed in this document. For On Demand requests there is one for IntradayBars and one for Ticks. It is not difficult to modify one of those for End of Day.

Important note: data requests have a workflow, it is no longer a simple request/response like the search we just discussed. For On Demand data requests (i.e. on the fly requests), see REST API Tutorial 3 for a description of the workflow.

You could also use scheduled requests. See here to understand the difference between the 2 workflows.

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.