Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • TRTH /
avatar image
Question by johan.lundquist · Nov 27, 2018 at 07:23 AM · tick-history-rest-apihistoricalrest-api

HistoricalCriteriaSearch how to limit result from the request

Hi,

I have read the documentation but still looking for answers.

I need to limit the result, by example for below POST request it takes 439680 ms to a size of 9.86 MB.


POST /RestApi/v1/Search/HistoricalCriteriaSearch HTTP/1.1
Host: select.datascopeapi.extranet.reuters.biz
Content-Type: application/json
Authorization: Basic OTAxODEwMDpMYWgzNjcwIWY4RDU=
cache-control: no-cache
Postman-Token: 0532c3cc-e48d-4244-a8bd-f033b4ced528
{
"Request": {
"RicPattern": "SEK",
"Range": {
"Start": "2018-11-20T00:00:00.000Z",
"End": "2018-11-21T00:00:00.000Z" } }}

Results as:

"Identifier": "#####T#SEKAB6SFM"

And a lot more noise.

I wish to specify additional parameters in the request such as: "Status" and "IdentifierType". Or similar in order to narrow the result to less noise.

Also I don't understand what "Start" in "Range" is expected to provide? My above request returns by example:

"FirstDate": "2011-06-10T00:00:00.000Z",
"LastDate": "2018-11-27T00:00:00.000Z",

Even if I specified 2018-11-20 to 2018-11-21?

Kind regards,

Johan

People who like this

0 Show 0
Comment
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

2 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by Christiaan Meihsl · Nov 27, 2018 at 08:55 AM

@johan.lundquist,

Your request

It specifies only 2 criteria:

RicPattern - Return all RIC names that contain the string "SEK".

Range - Return all instruments that were active during that time period.

So your query returns all instruments that were active on 20th November 2018, where the RIC contains "SEK". That will deliver many results, hence the long extraction time you observe.

The returned FirstDate / LastDate are the first / last dates where each instrument was active.

Filtering results

You cannot define:

  • The IdentifierType. But results will only contain "Ric" and "ChainRic", nothing else.
  • The instrument "Status". That said, you will only receive instruments that were active in the range you specified. I believe (not 100% sure, I'm not a data specialist) that the returned Status should always be "Valid".

That said, there is a whole set of criteria you can use to limit results:

RicPattern, BondTypeCodes, ContributorIds, CountryCodes, CurrencyCodes, DomainCodes, ExchangeCodes, FutureMonthCodes, InstrumentTypeCodes, OptionMonthCodes, OptionTypeCodes, CouponRate, StrikePrice, ExpiryDate, MaturityDate.

A few comments on these filters:

  • InstrumentTypeCodes can limit results to specific types, like Forex Cash Options (by setting InstrumentTypeCodes to value 211) for instance.
  • CurencyCodes uses a number for each currency, not a string. You can find the numbers using a GET to endpoint /RestApi/v1/Search/GetHistoricalCurrencies. For SEK the number is 752.
  • ExchangeCodes behaves in a similar way, you can find the numbers using a GET to endpoint /RestApi/v1/Search/GetHistoricalExchanges.

Note on the RicPattern regular expression

As per this thread, historical criteria search currently supports only the following regular expression patterns:

  • Begin with: ^ e.g. ^IBM // Begin with ‘IBM’
  • End with: $ e.g. =RR$ // End with ‘=RR’
  • Contain: string e.g. EUR // Contain ‘EUR’

You can escape special characters using a double slash, i.e. "\\"

Example: If you want to use a "." as a literal dot (and not as "any character"), then you need to escape it with , like in "\\.N$" to select any RIC that ends with ".N".

Example query

Retrieve Energy Market Statistics instruments containing "RED" in the RIC, in Danish or Swedish krona:

{
  "Request": {
    "RicPattern": "RED",
    "BondTypeCodes": null,
    "ContributorIds": null,
    "CountryCodes": null,
    "CurrencyCodes": [ "208", "752" ],
    "DomainCodes": null,
    "ExchangeCodes": null,
    "FutureMonthCodes": null,
    "InstrumentTypeCodes": [ "133" ],
    "OptionMonthCodes": null,
    "OptionTypeCodes": null,
    "CouponRate": null,
    "StrikePrice": null,
    "ExpiryDate": null,
    "MaturityDate": null,
    "Range": {
      "Start": "2018-11-20T00:00:00.000Z",
      "End": "2018-11-21T00:00:00.000Z"
    }
  }
}

For more information

The TRTH REST API Tutorial 14 and the REST API Reference tree provide information you might find useful.

Hope this helps.

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

avatar image
Answer by johan.lundquist · Nov 28, 2018 at 05:03 AM

Thank you Christiaan for the extensive answer,

I will try write a logic using regular expressions and share result in case of success, for my specific use case. Which is big lists of trades with none- to limited static data in first instance. Where we want to avoid develop too much logic towards internal golden source copies.

Kind regards,

Johan

Comment

People who like this

0 Show 0 · Share
10 |1500 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

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

Watch this question

Add to watch list
Add to your watch list to receive emailed updates for this question. Too many emails? Change your settings >
9 People are following this question.

Related Questions

Get prices in USD for instruments in TRTH

Historical Reference for RIC identifier: All identifier invalid. No Extraction performed

Intraday extraction does not return data for FX instruments

Historical RIC not linked

Historical price at 17:00 series for a stock through the Tick History REST API

  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Connected Risk APIs
  • DSS
  • Data Fusion
  • Data Model Discovery
  • Datastream
  • Eikon COM
  • Eikon Data APIs
  • Electronic Trading
    • Generic FIX
    • Local Bank Node API
    • Trading API
  • Elektron
    • EMA
    • ETA
    • WebSocket API
  • Intelligent Tagging
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open Calais
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • RDMS
  • Refinitiv Data Platform
    • Refinitiv Data Platform Libraries
  • Rose's Space
  • Screening
    • Qual-ID API
    • Screening Deployed
    • Screening Online
    • World-Check One
    • World-Check One Zero Footprint
  • Side by Side Integration API
  • TR Knowledge Graph
  • TREP APIs
    • CAT
    • DACS Station
    • Open DACS
    • RFA
    • UPA
  • TREP Infrastructure
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • Workspace SDK
    • Element Framework
    • Grid
  • World-Check Data File
  • 中文论坛
  • Explore
  • Tags
  • Questions
  • Badges