Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • Refinitiv Data Platform /
avatar image
REFINITIV
Question by samuel.schwalm · Jan 19 at 08:45 AM · searchoptionsrefinitiv data platform

how to retrieve the list of live option contracts for a given equity or equity index.

Hello,

I'm looking for a code sample, using Refinitiv Data Platform APIs, preferably in python, that would show how to retrieve the list of live option contracts for a given equity or equity index.

I have seen the great article on search (https://developers.refinitiv.com/en/article-catalog/article/building-search-into-your-application-workflow) but wondering if a code snippet illustrating the above question exists.


Many thanks.

Samuel

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 nick.zincone.1 · Jan 21 at 04:30 PM

Hi @leszek.lubecki,

Yes, the more we look at the results, the more we will filter - search will always be iterative :-).

Good point about the date check - when applying the expiryDate filter, this resulted in ~100 fewer hits for the '.VIX' symbol. Regarding the inability of the UnderlyingQuoteRIC not being able to support the exact match capability, you can always apply a little trickery to force exact matching, i.e.

                
  1. ric = "'.VIX'"
  2. rdp.search(
  3.     view = rdp.SearchViews.EquityDerivativeQuotes,
  4.     filter = "AssetState eq 'AC' and \
  5.               startswith(UnderlyingQuoteRIC, " + ric + ") and \
  6.               endswith(UnderlyingQuoteRIC," + ric + ") and \
  7.               RCSAssetClass eq 'OPT' and IsChain eq false and \
  8.               ExpiryDate ge " + dt.datetime.today().strftime('%Y-%m-%d'),
  9.     select = "DocumentTitle, RIC, ExpiryDate, CallPutOption, StrikePrice",
  10.     top = 10000
  11. )

It may not be as clean but should help avoid getting hits for things like 'AAPL.OQ'

Comment

People who like this

0 Show 1 · 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
samuel.schwalm · Feb 08 at 02:22 PM 0
Share

Many thanks. work fine for me.

avatar image
REFINITIV
Answer by marcin.bunkowski · Jan 20 at 02:57 PM

Hi @samuel.schwalm

I see that field UnderlyingNDAQuoteRICcontains information about underlying instrument but is not "searchable". Here is what I was able to get using PermID of an instrument

permid = rdp.convert_symbols(
    symbols = ['IBM'], 
    to_symbol_types = [rdp.SymbolTypes.OAPermID] )

rdp.search(view = rdp.SearchViews.EquityDerivativeQuotes,
    filter = "AssetState eq 'AC' and UnderlyingIssuerOAPermID eq '" + permid['IssuerOAPermID'][0] + "'  and DerivedCategory eq 'OPTION'",
    select = 'RIC',
    top=10000
)


Comment

People who like this

0 Show 1 · 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
samuel.schwalm · Jan 20 at 03:17 PM 0
Share

Thanks a lot @marcin.bunkowski, Can you share the samples as may not have the right rdp lib instantiated.


cheers

Samuel

avatar image
REFINITIV
Answer by nick.zincone.1 · Jan 20 at 06:17 PM

Hi @samuel.schwalm,

Try this:

rdp.search(
    view = rdp.SearchViews.EquityDerivativeQuotes,
    filter = "AssetState eq 'AC' and UnderlyingQuoteRIC eq 'IBM' and \
              RCSAssetClass eq 'OPT' and IsChain eq false",
    select = "DocumentTitle, RIC, ExpiryDate, CallPutOption, StrikePrice",
    top = 10000
)

I don't know what you were expecting back in terms of rows, but we could possibly narrow down the result set if you see some items in the list that shouldn't be there. For example, the last one in the screenshot below may be something that you want to ignore.


1611166509628.png (140.8 KiB)
Comment

People who like this

0 Show 1 · 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
marcin.bunkowski · Jan 21 at 07:53 AM 0
Share

@nick.zincone.1 I think that your solution is more convenient. When I did try UnderlyingQuoteRIC as well but without an additional filter on RCSAssetClass you get plenty not relevant RIC codes. I did try on "VOD.L".

avatar image
REFINITIV
Answer by leszek.lubecki · Jan 21 at 09:39 AM

@nick.zincone.1 @samuel.schwalm

Hey,

Given how the search is structure I think using the expiry date for filtering might be a good way to go to exclude non-viable RICs (or drop anything from the dataframe that doesn't have one)


rdp.search(
    view = rdp.SearchViews.EquityDerivativeQuotes,
    filter = "AssetState eq 'AC' and UnderlyingQuoteRIC eq 'IBM' and \
              RCSAssetClass eq 'OPT' and IsChain eq false and \
              ExpiryDate ge " + date.today().strftime('%Y-%m-%d'),
    select = "DocumentTitle, RIC, ExpiryDate, CallPutOption, StrikePrice",
    top = 10000
)



On the "live" part; in my experience it's best to use the ExpiryDate to filter for live options, I've seen on occasion a delay between an option contract expiring and being removed from the real time feeds, and actually being tagged as inactive and being removed from search like here for the first couple here (expired yesterday, no longer retrievable but still in search):


Something to be aware of re UnderlyingQuoteRIC as criterion. It uses an exact match to produce results. I.e. you need the specific listing that the options are listed for. Especially for US options this might prove a problem from a user perspective, as they may be looking at specific exchange listing like NYSE (IBM.N), or Nasdaq (AAPL.OQ) whereas the options themselves have the consolidated listings as underlyings (IBM, AAPL.O). So possibly the approach @marcin.bunkowski suggested might be valid.


1611221700307.png (36.2 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.

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

History Adjustments

Can I one ownload historical stock price data using API for a list of ISINs contain in a CSV file?

Error "certificate verify failed" Python

Cannot query non 'TR.XXX' fields using /data/datagrid/beta1/ API

Failed to get access token 400

  • 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
  • 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