question

Upvotes
Accepted
1 0 0 1

API Code to Filter data using Exchange Code

Hello,

My client is using TRTH REST API, with the below code he is trying to extract Historical Reference Data using SEDOL, he would like to further filter his result to only to a specific exchange.

Could you please help me with the filtering option.

{ "ExtractionRequest": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.HistoricalReferenceExtractionRequest", "ContentFieldNames": [ "RIC", "Asset Category", "Primary Trading RIC", "CUSIP", "SEDOL", "ISIN", "Issuer OrgID", "Exchange Code", "Currency Code", "Change Date" ], "IdentifierList": { "@odata.type": "#ThomsonReuters.Dss.Api.Extractions.ExtractionRequests.InstrumentIdentifierList", "InstrumentIdentifiers": [ { "Identifier": "6456403", "IdentifierType": "Sedol" } ], "ValidationOptions": {"AllowHistoricalInstruments": true}, "UseUserPreferencesForValidationOptions": false }, "Condition": { "ReportDateRangeType": "Range", "QueryStartDate": "1996-01-01", "QueryEndDate": "2018-12-31" } } }

Thanks,

Praveen Rangaiah

tick-history-rest-apihistoricalrest-apiexchange-codes
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
13.7k 26 8 12

@Praveen.Rangaiah,

The historical reference API call does not allow filtering by exchange.

Potential solutions

  1. Programmatically filter the results, to keep only those where the Exchange Code field has the desired value. This is straightforward and fairly easy.
  2. Depending on the use case, maybe your customer could use a T&C (Terms and Conditions) request, which allows filtering on an exchange by using the Source field for the identifier:
{ "Identifier": "6456403", "IdentifierType": "Sedol", "Source": "TYO" }

Warning: there are several caveats to the T&C approach:

  • A T&C request only delivers the current mapping for the primary RIC, whereas the Historical Reference call delivers historical mappings.
  • For a T&C request field Change Date does not exist, but there is a Last Change Date field. All the other fields of your request are available.
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.

@Christiaan Meihsl Thanks a lot for the API code.

So, this code works only for T&C template and not for Historical Reference. Is there no option for client to filter using Exchange code for Historical Reference template.

@Praveen.Rangaiah, as stated, the historical reference API call does not allow filtering by exchange. If you want to use that call then you will have to programmatically filter the results (which is fairly easy).

Click below to post an Idea Post Idea