question

Upvotes
Accepted
244 4 9 15

Can't download historical e-mini data from TRTH using REST API

When I request information for the December 2017 e-mini contract (ESZ7) from Oct. 2017 via the REST API in TRTHv2, it fails, telling me that the RIC is invalid. I'm well aware that the RIC was valid, and in fact retrieved it using the Historical Chain resolution in TRTHv2 itself! Retrieval via the website GUI works requesting the same RIC, but is completely impractical for the use case I'm dealing with.

My JSON query:

{ "ExtractionRequest": { "@odata.type": "TickHistoryRawExtractionRequest", "Condition": { "ReportDateRangeType": "Range", "DateRangeTimeZone": "UTC", "SortBy": "SingleByRic", "ExtractBy": "Ric", "MessageTimeStampIn": "LocalExchangeTime", "DomainCode": "MarketByPrice", "QueryStartDate": "2017-10-24T21:30:00.000000Z", "QueryEndDate": "2017-10-25T21:29:59.999000Z", "TimeRangeMode": "Inclusive", "DisplaySourceRIC": false }, "ContentFieldNames": [], "IdentifierList": { "@odata.type": "InstrumentIdentifierList", "InstrumentIdentifiers": [ { "Identifier": "ESZ7", "IdentifierType": "Ric" } ] } } }

The TRTH response:

{ "Notes": [ "All identifiers were invalid. No extraction performed." ], "IdentifierValidationErrors": [ { "Message": "Not found", "Identifier": { "@odata.type": "#ThomsonReuters.Dss.Api.Content.InstrumentIdentifier", "Source": "", "Identifier": "ESZ7", "IdentifierType": "Ric" } } ], "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#RawExtractionResults/$entity", "JobId": "0x06602e827a501287" }

Thanks very much for your help.

tick-history-rest-apihistorical
icon clock
10 |1500

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

1 Answer

Upvotes
Accepted
11.3k 25 8 13

Hi @davidk

The ESZ7 is historical instruments as it had been valid by 12/25/2017. To extract the historical instrument, you need to enable the AllowHistoricalInstruments validation options in the request message. Below is the sample of request.

{ 
	"ExtractionRequest": 
	{ "@odata.type": "TickHistoryRawExtractionRequest", 
		"Condition": { 
			"ReportDateRangeType": "Range", 
			"DateRangeTimeZone": "UTC", 
			"SortBy": "SingleByRic", 
			"ExtractBy": "Ric", 
			"MessageTimeStampIn": "LocalExchangeTime", 
			"DomainCode": "MarketByPrice", 
			"QueryStartDate": "2017-10-24T21:30:00.000000Z", 
			"QueryEndDate": "2017-10-25T21:29:59.999000Z", 
			"TimeRangeMode": "Inclusive", "DisplaySourceRIC": false }, 
			"ContentFieldNames": [], 
			"IdentifierList": { 
				"@odata.type": "InstrumentIdentifierList", 
				"InstrumentIdentifiers": 
				[ { "Identifier": "ESZ7", "IdentifierType": "Ric" } ],
				"ValidationOptions": 
				{
					"AllowHistoricalInstruments": true
				},
				"UseUserPreferencesForValidationOptions": false
		} 
	} 
}
icon clock
10 |1500

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

Click below to post an Idea Post Idea