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 Mehdi · Mar 05 at 05:07 PM · trth api

futures expiry date in TRTH python

Hi there,

I have 2 questions please:

1 I am trying to retrieve the expiry date of a specify contract through the TRTH Python API. I use "Expiration Date" as the file in ContentFieldNames section of the json file. It works for some products but does not for others. For example, when trying to retrieve the expiry date of FCEK1, the extract does not any entry whereas the code works perfectly for others.

2 Is there also a way to simply retrieve all the expiry dates of a future chain like in the Eikon API by using a ric chain like 0#FCE:

I also tried to use this in the query but it does not work.


Thank you for your help

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.

4 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by zoya.farberov · Mar 09 at 10:01 PM

Hello @Mehdi,

Check out the attached example of the two "chained" searches, it is not a fully polished example, but hope it helps:

TRTH_OnDemand_Search.zip


trth-ondemand-search.zip (1.4 KiB)
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
REFINITIV
Answer by zoya.farberov · Mar 05 at 07:10 PM

Hello @Mehdi,

I think FuturesAndOptionsSearch may be suitable:

{ {protocol}}{ {host}}{ {api}}Search/FuturesAndOptionsSearch

{
    "SearchRequest": {
        "FileCodes": null,
        "CurrencyCodes": null,
        "ExchangeCodes": null,
        "IdentifierType": "Ric",
        "Identifier": "FCEK1"
    }
}

resulting in:

{
    "@odata.context": "https://hosted.datascopeapi.reuters.com/RestApi/v1/$metadata#Collection(ThomsonReuters.Dss.Api.Search.FuturesAndOptionsSearchResult)",
    "value": [
        {
            "Identifier": "FCEK1",
            "IdentifierType": "Ric",
            "Source": "MNP",
            "Key": "VjF8MHgwMDEwMGIwMDI2YTljMzEzfDB4MDAxMDBiMDAyNmFjMDY2NnxNTlB8RFZRVXxERVJWfEZVVHxEfHxGQ0VLMXw1MDM2",
            "Description": "CAC 40 MAY1",
            "InstrumentType": "DerivativeQuote",
            "Status": "Valid",
            "ExchangeCode": "MNP",
            "CurrencyCode": "EUR",
            "FuturesAndOptionsType": "Futures",
            "PutCallCode": "",
            "ExpirationDate": "2021-05-21T00:00:00.000Z",
            "AssetStatus": "Active"
        }
    ]
}

It does not support chainRIC as identifier, so you have to find expand the chain:

{ {protocol}}{ {host}}{ {api}}Search/HistoricalChainResolution

{
  "Request": {
          "ChainRics": ["0#FCE:"],
      "Range": {
          "Start": "2020-06-12T00:00:00.000Z",
          "End": "2021-06-12T00:00:00.000Z"
      }
  }
}

And then look up expiration dates of the relevant RICs using FuturesAndOptionsSearch



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 Mehdi · Mar 09 at 05:02 PM

Hi Zova,

I tried your query in the Python API, but it does not work. The ExtractRaw method returns:

Status Code = 400

XXX lineno: 94, opcode: 0

Do you think this should work even in the Python TRTH API? would you have a small piece of Python code to share that i could try because i could not find any documentation about this type of json file to be called in Python?

Thank you again

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
REFINITIV
Answer by zoya.farberov · Mar 09 at 08:35 PM

Hello @Mehdi,

ExtractRaw is not the right request type/endpoint to use.

My suggested approach included two Searches:

{ {protocol}}{ {host}}{ {api}}Search/FuturesAndOptionsSearch

and

{ {protocol}}{ {host}}{ {api}}Search/HistoricalChainResolution

Please see REST API Reference Tree with the complete spec to use.

I have tested the "naked" requests in Postman, so they will work the same in any language that supports HTTP REST interface, including Python.

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 >
11 People are following this question.

Related Questions

Dates fields​

TRTH REST API - ExtractRaw

Is there any ways to add multiple selected fids in the raw data extraction code?

Is there any other way to identify RICs for Fix Income instruments via TRTH v2 API?

No extractions associated

  • Feedback
  • Copyright
  • Cookie Policy
  • Privacy Statement
  • Terms of Use
  • Careers
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Alpha
  • App Studio
  • Block Chain
  • Bot Platform
  • Calais
  • 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
  • Legal One
  • Messenger Bot
  • Messenger Side by Side
  • ONESOURCE
    • Indirect Tax
  • Open PermID
    • Entity Search
  • Org ID
  • PAM
    • PAM - Logging
  • ProView
  • ProView Internal
  • Product Insight
  • Project Tracking
  • 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
  • TRIT
  • TRKD
  • TRTH
  • Thomson One Smart
  • Transactions
    • REDI API
  • Velocity Analytics
  • Wealth Management Web Services
  • World-Check Data File
  • Explore
  • Tags
  • Questions
  • Badges