Beruflich Dokumente
Kultur Dokumente
TICK HISTORY
CONTENTS
API User Guide 1
Thomson Reuters THApi is a single security request-retrieve web service that provides access to a wide range of
Thomson Reuters Tick History content. The TRTHApi Data Web Services (DataServices) consists of operations for
build data dictionary constructs, searching for instruments, and requesting intra-day market data. This web service is
both language and platform independent, allowing flexibility and easy integration of Reuters market data into your own
internal systems.
The Thomson Reuters THApi is available to customers via either Internet or BT MPLS delivery.
If you are unable to find the information you need in the online Help please contact us using Contact Us information in
the Thomson Reuters Tick History Help or from the Thomson Reuters Customer Zone (http://customers.reuters.com).
When a new release of the API is made the previous release will be maintained for 3 months to allow migration to the
latest version.
ExpandChain Expand a Chain instrument to its RIC constituents for a given date
and time range
RICSymbology Return a list of instruments that changed RIC symbol code from or
to the given instrument over a date range
VerifyRICs Verify the existence of a RIC and returns its reference data
SetFTPDetails Defines the FTP server details used for delivery by the
SubmitFTPRequest method
SubmitRequest Submit a data request for a single instrument for a single day for
batch processing
CancelRequest Cancels and removes the results file for a request (either a normal
API request or an FTP request)
Data Dictionary
RDTH Data
Services
2 3
Retrieve Request
Results
Step 1: Data Dictionary – request data items that can be used in other requests
Use the data dictionary operations to construct lists for reference data, e.g. Currency lists, Instrument lists, etc. Items
from these lists are typically used as search criteria in the SearchRICs operation to search for the instruments in the
TRTH database.
Please note that the SearchRICs function only returns the first 50,000 instruments that meet the search criteria.
The SubmitFTPRequests allows requests of up to 30,000 instruments at a time with no restrictions on the date range;
all requests are limited to a maximum of 2.5 million RIC/days where one RIC for one day is defined as a RIC day. The
results will either be pushed to the clients FTP server or will be available for download from the TRTH FTP server
depending on whether the Push or Pull preference has been selected.
What is the address of the FTP server used to send the FTP files?
The FTP files are sent from the following IP address and hostname 59.154.55.4 (TRTHApi.
thomsonreuters.com). To receive files using FTP it may be necessary to enter this information into your firewall.
Is it possible to increase the timeout value for commands sent from the TRTH API?
Yes it is, to increase the timeout value in the Java sample code provided (see Apache AXIS Reference Guide below)
locate the line of code:
((org.apache.axis.client.Stub)service).setTimeout(1800000);
C++
https://customers.reuters.com/a/support/paz/pazDocs.aspx?dId=399775
C#
https://customers.reuters.com/a/support/paz/pazDocs.aspx?dId=253330
JAVA
https://customers.reuters.com/a/support/paz/pazDocs.aspx?dId=346004
Envelope Element
The required Envelope element defines the XML document as a SOAP message. It is uniquely identified with the
namespace: http://schemas.xmlsoap.org/soap/envelope. The Envelop element is a SOAP standard, as in this
sample:
<?xml version=”1.0” encoding=”utf-8”?>
<soap:Envelope
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
...
</soap:Header>
<soap:Body>
...
</soap:Body>
</soap:Envelope>
Header Element
All TRTHApi DataServices operations require a Header element that is the first child element of the Envelope
element, as in this sample:
<soap:Header>
<CredentialsHeader xmlns="http://types.webservice.tickhistory.thomsonreuters.com">
<username>string</username>
<password>string</password>
<tokenId>string</tokenId>
</CredentialsHeader>
</soap:Header>
…
…
</soap:Envelope>
Authentication is done by embedding the login information into the SOAP header, as per the TRTH method.
The Header element contains a CredentialsHeader element. In the initial request to the API, the tokenId field is left
empty. When programming with the TRTHApi, you should replace the string placeholders with your actual TRTH API
username and password. Use the same username and password that is provided to you for accessing the TRTH UI.
After authenticating on the servlet, the tokenId is inserted and given to the client in the response, to be used in
subsequent calls to the API.
Sample C# client code:
// the body element :- will authenticate and create a session before processing request
Instruments[] rics = TRTH.SearchRICs(parameters...);
Body Element
The required Body element contains the DataServices operation that defines the actual SOAP Request and
Response messages. The elements contained in this section are TRTHApi specific and are not part of the SOAP
standard.
GETASSETDOMAINS
Data[] GetAssetDomains()
Purpose
Returns a list of supported Asset Domains – an asset domain represents market segmentation, e.g. Equities,
Futures, Options or Indices.
Request
<GetAssetDomains/>
Response
<GetAssetDomainsResponse>
<domainList>
<data>
<type>Text</type>
<field>Domain</field>
<value>OPT</value>
<longName>Options</longName>
</data>
<data>
<type>Text</type>
<field>Domain</field>
<value>EQU</value>
<longName>Equities</longName>
</data>
...
</domainList>
</GetAssetDomainsResponse>
Possible Errors
None
GETINSTRUMENTTYPES
Data[] GetInstrumentTypes(Data[] domains)
Purpose
Returns a list of supported Instrument Types for a given list of Asset Domains - an instrument type is a sub
class of a domain, e.g. Equity-linked or Grain and Oilseed Commodities.
Request
<GetInstrumentTypes>
<data>
<value>OPT</value>
</data>
...
</GetInstrumentTypes>
Response
<GetInstrumentTypesResponse>
<instrumentTypeList>
<data>
<type>Numeric</type>
<field>InstrumentType</field>
<value>19</value>
<longName>Cash - Cross market</longName>
</data>
<data>
<type>Numeric</type>
<field>InstrumentType</field>
<value>20</value>
<longName>Futures - Cross Market</longName>
</data>
</instrumentTypeList>
</GetInstrumentTypesResponse>
Possible Errors
GETCOUNTRIES
Data[] GetCountries()
Purpose
Returns a list of supported Country codes; this is the list of all countries support for the money market,
foreign exchange and Economic Indicator domains.
Request
<GetCountries/>
Response
<GetCountriesResponse>
<countryList>
<data>
<type>Text</type>
<field>Country</field>
<value>Afghanistan</value>
<longName>Afghanistan</longName>
</data>
<data>
<type>Text</type>
<field>Country</field>
<value>Albania</value>
<longName>Albania</longName>
</data>
</countryList>
...
</GetCountriesResult>
Possible Errors
None
GETEXCHANGES
Data[] GetExchanges(Data[] domains)
Purpose
Returns a list of supported exchange codes for a given list of Asset Domains.
Request
<GetExchanges>
<domainList>
<data>
<value>EQU</value>
</data>
...
</domainList>
</GetExchanges>
Response
<GetExchangesResponse>
<exchangeList>
<data>
<type>Text</type>
<field>Exchange</field>
<value>ADF</value>
<longName>NASD Alt Display Facility Large Cap</longName>
</data>
<data>
<type>Text</type>
<field>Exchange</field>
<value>ADS</value>
<longName>NASD Alt Display Facility Capital Market</longName>
</data>
...
</exchangeList>
</GetExchangesResponse>
Possible Errors
GETCURRENCIES
GetCurrencies(Data[] countries)
Purpose
Returns a list of supported currency codes for a given list of country codes
Request
<GetCurrencies>
<countryList>
<data>
<value>United Kingdom</value>
</data>
...
</countryList>
</GetCurrencies>
Response
<GetCurrenciesResponse>
<currencyList>
<data>
<type>Text</type>
<field>Currency</field>
<value>EUR</value>
<longName>The Euro</longName>
</data>
<data>
<type>Text</type>
<field>Currency</field>
<value>GBP</value>
<longName>UK pound sterling</longName>
</data>
...
</currencyList>
</GetCurrenciesResponse>
Possible Errors
GETBONDTYPES
Data[] GetBondTypes()
Purpose
Returns a list of bond type codes applicable to instruments from the fixed income domain.
Request
<GetBondTypes/>
Response
<GetBondTypesResponse>
<bondTypeList>
<data>
<type>Text</type>
<field>BondType</field>
<value>1</value>
<longName>[FRN] floating rate note</longName>
</data>
<data>
<type>Text</type>
<field>BondType</field>
<value>2</value>
<longName>[STR] straights</longName>
</data>
...
</bondTypeList>
</GetBondTypesResponse>
Possible Errors
None
GETFUTURESDELIVERYMONTHS
Data[] GetFuturesDeliveryMonths()
Purpose
Returns a list of delivery month codes for instruments from the Futures domain.
Request
<GetFuturesDeliveryMonths/>
Response
<GetFuturesDeliveryMonthsResponse>
<monthList>
<data>
<type>Text</type>
<field>FutureMonth</field>
<value>F</value>
<longName>January</longName>
</data>
<data>
<type>Text</type>
<field>FutureMonth</field>
<value>G</value>
<longName>February</longName>
</data>
...
</monthList>
</GetFuturesDeliveryMonthsResponse>
Possible Errors
None
GETOPTIONEXPIRYMONTHS
Data[] GetOptionExpiryMonths();
Purpose
Returns a list of option expiry Month codes for instruments from the Options domain.
Request
<GetOptionExpiryMonths/>
Response
<GetOptionExpiryMonthsResponse>
<monthList>
<data>
<type>Text</type>
<field>OptionMonth</field>
<value>AM</value>
<longName>January</longName>
</data>
<data>
<type>Text</type>
<field>OptionMonth</field>
<value>BN</value>
<longName>February</longName>
</data>
...
</monthList>
</GetOptionExpiryMonthsResponse>
Possible Errors
None
GETCREDITRATINGS
Data[] GetCreditRatings()
Purpose
Returns a list of credit Rating codes applicable to instruments from the fixed income domain.
Request
<GetCreditRatings/>
Response
<GetCreditRatingsResponse>
<creditRatingList>
<data>
<type>Text</type>
<field>CreditRating</field>
<value>1</value>
<longName>[AAA] repay principal is extremely strong</longName>
</data>
<data>
<type>Text</type>
<field>CreditRating</field>
<value>2</value>
<longName>[AA+] very strong capacity to pay</longName>
</data>
...
</creditRatingList>
</GetCreditRatingsResponse>
Possible Errors
None
GETRESTRICTEDPES
Data[] GetRestrictedPEs()
Purpose
Returns the list of restricted RDS PE codes for the service.
Request
<GetRestrictedPEs/>
Response
<GetRestrictedPEsResponse>
<restrictedPEList>
<data>
<type>Numeric</type>
<field>PECode</field>
<value>0</value>
<longName>Reuters - Internal Information</longName>
</data>
<data>
<type>Numeric</type>
<field>PECode</field>
<value>19</value>
<longName>IQT Inhouse test pe</longName>
</data>
</restrictedPEList>
</GetRestrictedPEsResponse>
Possible Errors
None
GETMESSAGETYPES
MessageType[]GetMessageTypes(Data[] domains, RequestType type)
Purpose
Return a list of supported message types for a given list of Asset Domains and request type. The
GetMessageTypes operation is unique in that it returns an array of <MessageTypes> instead of the generic
<Data> elements.
Element definitions
Request
<GetMessageTypes>
<domainList>
<data>
<value>EQU</value>
</data>
...
</domainList>
<requestType>TimeAndSales</requestType>
</GetMessageTypes>
Response
<GetMessageTypesResponse>
<messageTypeList>
<messageType>
<name>Trade</name>
<fieldList>
<string>Price</string>
<string>Volume</string>
...
</fieldList>
</messageType>
<messageType>
<name>Quote</name>
<fieldList>
<string>Bid Price</string>
<string>Bid Size</string>
...
</fieldList>
</messageType>
...
</messageTypeList>
</GetMessageTypesResponse>
Possible Errors
VERIFYRICS
InstrumentList [] VerifyRICs(DateRange dateRange, Instrument[] rics, bool refData)
Purpose
Query the validity of an instrument and/or return its reference data.
Element definitions
<refData> Boolean Flag to fill in the reference data for the instrument.
Request
<VerifyRICs>
<dateRange>
<start>2006-07-01</start>
<end>2006-07-31</end>
</dateRange>
<instrumentList>
<instrument>
<code>BHP.AX</code>
</instrument>
<instrument>
<code>BLAH</code>
</instrument>
...
</instrumentList>
<refData>true</refData>
</VerifyRICs>
Response
<VerifyRICsResponse>
<verifyRICsResult>
<verifiedList>
<instrument>
<code>BHP.AX</code>
<dateRange>
<start>1996-01-01</start>
<end>2007-08-10</end>
</dateRange>
<name>
<string>BROKEN HILL PTY</string>
<string>BHP LTD</string>
<string>BHP BILLITON</string>
</name>
<status>Verified</status>
<statusInfo></statusInfo>
<exchange>
<string>ASX</string>
</exchange>
<type>
<string>113</string>
</type>
<currency>
<string>AUD</string>
</currency>
</instrument>
</verifiedList>
<nonVerifiedList>
<instrument>
<code>A_w.N</code>
<status>NotAccessible</status>
<statusInfo>225/NYS</statusInfo>
</instrument>
</nonVerifiedList>
</verifyRICsResult>
</VerifyRICsResponse>
Possible Errors
No Instruments
Specified
SEARCHRICS
InstrumentList [] SearchRICs(DateRange dateRange, Data[] criteria, bool refData)
Purpose
Search the reference data by date range and search criteria and return a list of instruments that match that
criteria; multiple search criteria may defined;
Request
<SearchRICs>
<dateRange>
<start>2000-01-01</start>
<end>2006-12-31</end>
</dateRange>
<criteria>
<data>
<field>Domain</field>
<value>EQU</value>
</data>
<data>
<field>Exchange</field>
<value>NMS</value>
</data>
<data>
<field>RICRegex</field>
<value>^MSFT</value>
</data>
</criteria>
<refData>false</refData>
</SearchRICs>
Response
<SearchRICsResponse>
<SearchRICsResult>
<instrument>
<code>MSFT.G</code>
<dateRange>
<start>2001-04-09</start>
<end>2003-03-29</end>
</dateRange>
<status>Unknown</status>
</instrument>
<instrument>
<code>MSFT.O</code>
<dateRange>
<start>1996-01-01</start>
<end>2007-08-10</end>
</dateRange>
<status>Unknown</status>
</instrument>
</SearchRICsResult>
</SearchRICsResponse>
Possible Errors
EXPANDCHAIN
InstrumentList[]ExpandChain(Instrument ric, DateRange dateRange, TimeRange timeRange, bool requestInGMT)
Purpose
Expand a chain RIC to its instrument constituents over a date range or an instance in time (in this case the
start and end dates are the same); a list of instruments is returned.
Request
<ExpandChain>
<instrument>
<code>0#.DJI</code>
</instrument>
<dateRange>
<start>2006-07-01</start>
<end>2006-07-31</end>
</dateRange>
<timeRange>
<start>0:00</start>
<end>23:59:59.999</end>
</timeRange>
<requestInGMT>true</requestInGMT>
</ExpandChain>
Response
<ExpandChainResponse>
<instrumentList>
<instrument>
<code>AA.N</code>
</instrument>
<instrument>
<code>GE.N</code>
</instrument>
...
</instrumentList>
</ExpandChainResponse>
Possible Errors
GETRICSYMBOLOGY
InstrumentList[]GetRICSymbology(Instrument ric, DateRange dateRange)
Purpose
Search the reference database over the date range for any symbol name changed for the given instrument; the
given instrument as well as any other instruments for which this instrument was named from or to are
returned.
Request
<GetRICSymbology>
<instrument>
<code>RIO.AX</code>
</instrument>
<dateRange>
<start>1996-01-01</start>
<end>2006-12-31</end>
</dateRange>
</GetRICSymbology>
Response
<GetRICSymbologyResponse>
<instrumentList>
<instrument>
<code>CRA.AX</code>
<dateRange>
<start>1996-01-01</start>
<end>1997-06-03</end>
</dateRange>
</instrument>
<instrument>
<code>RIO.AX</code>
<dateRange>
<start>1997-06-03</start>
<end>2006-12-31</end>
</dateRange>
</instrument>
...
</instrumentList>
</GetRICSymbologyResponse>
Possible Errors
GETREQUESTRESULT
RequestStatus GetRequestResult(String requestID)
Purpose
To poll a previously submitted request by its unique identifier to determine its status. If the request is
complete the result data is returned
Request
<GetRequestResult>
<requestID>USERNAME-FRIENDLY_NAME-TIMESTAMP</requestID>
</GetRequestResult>
Response
<GetRequestResultResponse>
<result>
<status>Complete</status>
<data>H4sIANq41EYAA+2dy6okyZae5/0amp527...</data>
<queuePosition>0</queuePosition>
</result>
</GetRequestResultResponse>
Explanation of elements
Possible Errors:
Purpose
This method sets the FTP preferences on the API server for this user.
Request
<SetFTPDetails>
<hostname>ftp.server.com</hostname>
<user>ftpuser</user>
<password>ftppass</password>
<path>/path/to/data</path>
</SetFTPDetails>
Response
<SetFTPDetailsResponse/>
Explanation of elements
<path> String The path on your FTP server where you want the
result files to be uploaded to.
Possible Errors
None. Use TestFTP() to verify the correctness of your parameters.
TESTFTP
TestFTP()
Purpose
This operation uploads a small test file using the parameters provided by the SetFTPDetails() call. No
parameters are required for input and output - an exception is thrown if the test fails.
Request
<TestFTP/>
Response
<TestFTPResponse/>
Explanation of elements
None.
Possible Errors
SUBMITFTPREQUEST
string requestID SubmitFTPRequest(LargeRequestSpec req)
Purpose
This operation submits a large request to be delivered via FTP push to the server specified by the
SetFTPDetails operation, or via FTP pull. FTP Pull stores the results on the TRTH FTPS server and the data
can be retrieved either from the FTPS server or HTTP Pull server, once GetRequestResult indicates the status
is “Complete”. Please refer to the TRTH Technical Guide and the HTTP-Pull guide for information on
retrieving result files from these servers.
Request
<SubmitFTPRequest>
<request>
<friendlyName>FRIENDLY_NAME</friendlyName>
<requestType>Intraday</requestType>
<instrumentList>
<instrument>
<code>BHP.AX</code>
</instrument>
<instrument>
<code>IBM</code>
</instrument>
...
</instrumentList>
<dateRange>
<start>2007-01-01</start>
<end>2007-12-31</end>
</dateRange>
<timeRange>
<start>0:00</start>
<end>23:59:59.999</end>
</timeRange>
<messageTypeList>
<messageType>
<name>Intraday 1Hour</name>
<fieldList>
<string>Open</string>
<string>Close</string>
...
</fieldList>
</messageType>
<messageType>
<name>Stock Split</name>
<fieldList>
<string>Split Factor</string>
</fieldList>
</messageType>
...
</messageTypeList>
<requestInGMT>true</requestInGMT>
<displayInGMT>true</displayInGMT>
<marketDepth>0</marketDepth>
<splitSize>50</splitSize>
<delivery>Pull</delivery>
<sortType>RICSequence</sortType>
<fileFormat>Single</fileFormat>
<dateFormat>YYYYMMDD</dateFormat>
<disableDataPersistence>false</disableDataPersistence>
<includeCurrentRIC>false</includeCurrentRIC>
<applyCorrections>false</applyCorrections>
</request>
</SubmitFTPRequest>
Response
<SubmitFTPRequestResponse>
<requestID>USER-FRIENDLY_NAME-ID</requestID>
</SubmitFTPRequestResponse><SetFTPDetailsResponse/>
Explanation of elements
<requestInGMT> Boolean Set to true if the provided Date and TimeRange are
in GMT; false for local times
<displayInGMT> Boolean Set to true if the result data should output GMT
date/timestamp; false for local date/timestamp fields
(default)
RTCEMarketDepth
<splitSize> Numeric The size to split result files into (in Mb)
Possible Errors
Illegal transaction
'<Transaction Name>'
Name>’ from
transaction=<Transact
ion Name>
Outstanding request
limit reached
CANCELREQUEST
CancelRequest(string requestID)
Purpose
This operations cancels and removes the results file for a request. This can be either a small API request
or an FTP request.
Request
<CancelRequest>
<requestID>USER-FRIENDLY_NAME-ID</requestID>
</CancelRequest>
Response
<CancelRequestResponse/>
Explanation of elements
Possible Errors
Purpose
To request data for an instrument for a particular request day; the request will return a unique request id;
the operation GetRequestResult can be used to retrieve the data or query the status of the request.
Request
<SubmitRequest>
<request>
<friendlyName>FRIENDLY_NAME</friendlyName>
<requestType>TimeAndSales</requestType>
<instrument>
<code>BHP.AX</code>
</instrument>
<date>2006-10-10</date>
<timeRange>
<start>0:00</start>
<end>23:59:59.999</end>
</timeRange>
<messageTypeList>
<messageType>
<name>Trade</name>
<fieldList>
<string>Price</string>
<string>Volume</string>
</fieldList>
</messageType>
<messageType>
<name>Quote</name>
<fieldList>
<string>Bid Price</string>
<string>Ask Price</string>
</fieldList>
</messageType>
</messageTypeList>
<requestInGMT>true</requestInGMT>
<displayInGMT>true</displayInGMT>
<disableHeader>false</disableHeader>
<marketDepth>0</marketDepth>
<dateFormat>YYYYMMDD</dateFormat>
<disableDataPersistence>false</disableDataPersistence>
<includeCurrentRIC>false</includeCurrentRIC>
<applyCorrections>false</applyCorrections>
</request>
</SubmitRequest>
Response
<SubmitRequestResult>
<requestID>USER-FRIENDLY_NAME-TIMESTAMP</requestID>
</SubmitRequestResult>
Explanation of elements
<requestInGMT> Boolean Set to true if the provided Date and TimeRange are
in GMT; false for local times
<displayInGMT> Boolean Set to true if the result data should output GMT
date/timestamp; false for local date/timestamp fields
(default)
Possible Errors
Illegal transaction
'<Transaction Name>'
Outstanding request
limit reached
No instruments
specified
GetInflightStatus
InflightStatus GetInflightStatus()
Purpose
InflightStatus provides information on number of actively running requests (in-flight) as well as the
request IDs of all the jobs that have completed and are ready to download. This saves the user from
continuously polling for many request IDs using GetRequestResult. The user should use this method over
GetRequestResult where possible. The in-flight limit should be respected, and the user should stop
submitting any more requests when the number of active request reaches the limit.
Request
<GetInflightStatus/>
Response
<GetInflightStatusResponse>
<status>
<active>37</active>
<limit>20</limit>
<completed>
<string>requestID-1</string>
<string>requestID-2</string>
</completed>
</status>
</GetInflightStatusResponse>
Explanation of elements
<completed> Container A list of Request IDs that have completed and are
ready to be downloaded via GetRequestResult
CleanUp
void CleanUp()
Purpose
The CleanUp call aborts all queued and running non-FTP requests, and also removes complete non-FTP requests
that have not been downloaded. The operation allows users to start the API with a clean slate. This should
be called at the start of your programs.
Note that the CleanUp call does have any impact on FTP (push or pull) requests, it will not clean up the
results files generated by FTP requests and will not abort running FTP requests.
Request
<CleanUp/>
Response
<CleanUpResponse/>
GetQuota
Quota q = GetQuota()
Purpose
The GetQuota call returns the RIC quota type of the user, the number of RICs used, the maximum number of
RICs allowed, and whether the user is allowed to exceed the maximum (up to a hard limit).
Request
<GetQuota/>
Response
<GetQuotaResponse
<result>
<type>Cumulative</type>
<used>1040</used>
<total>1000</total>
<exceedable>true</exceedable>
</result>
</GetQuotaResponse>
Sample C# client code – Search for all RICs starting with the string « IBM » from the Equity domain
over the date range: 1st August 2006 to 31st August 2006.
// create the authentication header
CredentialsHeader header = new CredentialsHeader();
header.username = "user_email_address";
header.password = "your_password";
header.tokenId = string.Empty;
// create the API access object and assign the authentication header to it
TRTHApiService TRTH = new TRTHAPIService();
TRTH.Timeout = -1;
TRTH.CredentialsHeaderValue = header;
// define the regular expression search in RICs – match RICS starting with the string IBM”
criteria[1] = new Data();
criteria[1].field = FieldType.RICRegex;
criteria[1].value = “^IBM”;
The following error conditions are reported by the TRTHApi. Errors are reported in the form:
"Error category --> error detail"
"java.lang.NumberFormatException: <detail>"
or
"java.lang.IllegalArgumentException: argument type mismatch"
Error Codes
Illegal transaction
'<Transaction Name>'
No instruments
specified
Outstanding request
limit reached