question

Upvotes
Accepted
11 2 2 5

Getting a list of all RIC codes for Equity Index Options

Hello Developers,

Notes: I'm using the python API and have access to Refinitiv Tickhistory.

Getting a list of all option RIC codes (with expiration date and strike price) for S&P 500, current + historical.

Right now, I am using the following:

UnderlyingRIC = '.SPX' for S&P 500

request_header = { 'Prefer':'respond-async;odata.maxpagesize=25000',
                  'Content-Type':'application/json',
                  'Authorization': 'token {}'.format(auth_token)
                 }

request_body = { 'SearchRequest': { '@odata.context': 'http://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#DataScope.Select.Api.Search.FuturesAndOptionsSearchRequest',
                                   'FuturesAndOptionsType': 'Options',
                                   'UnderlyingRic': '.SPX',
                                   'ExpirationDate': {'@odata.type': '#DataScope.Select.Api.Search.DateValueComparison',
                                                      'ComparisonOperator': 'GreaterThanEquals',
                                                      'Value': '1995-01-01'
                                                     }
                                  }
               }


data_request = requests.post('https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/FuturesAndOptionsSearch',
                             json = request_body, headers = request_header)

It gives me the option meta data for all live contracts + historical contracts from October 2017 (which I guess implies a 5 year rule). However, I want this information for all options on S&P 500 since 1996 (which is when we're told TRTH starts) can you please help?

1664396199629.png

I saw previous questions here:

https://community.developers.refinitiv.com/questions/51893/need-details-regarding-options-ric-construction.html including something I had asked earlier https://community.developers.refinitiv.com/questions/95314/getting-information-for-ric-code-of-an-option-via.html, but I am looking for all expired contracts because I do not know the specific contracts available. I understand how option Option RICs are constructed, but my understanding is that there are conflicts since the number of bits reserved for strike price is not well-defined (XXXXX20000) can mean a strike of 200 or 2000 depending on the context. Which is why we need specific RIC codes - Expiration dates - Strike Price mappings.

The code above works fine for futures (in that it gives me a list of all futures RIC on SPX, etc) but for options only returns last 5 years. Lastly, I am mindful of the fact that the data is stored in chunks and I run queries sequentially until the '@odata.nextlink' flag exists and so this is all there exists.

Thank you very much!

Best,

Neel.

python apitrth-rest-api
1664396199629.png (265.5 KiB)
icon clock
10 |1500

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

Upvotes
Accepted
32.2k 39 11 19

Hello @ns3481 ,

Thank you for the clarification. To better understand the results, I have run some verifications via DSS GUI.

First, run the same search, and sorted the results on Expiration Date:

dssgui1.gif

the contents start with 2017.

However, the default result size via GUI is just 2000. So I have further run the following request to verify if any results are available prior to 2017:

dssgui2.gif

Consequently, I believe this content to be available starting from 2017.

However, I suggest to additionally verify this content availability with Refinitiv content experts directly at Refinitiv Helpdesk Online -> Content -> DSS.

Hope that this information is of help


dssgui1.gif (126.6 KiB)
dssgui2.gif (90.3 KiB)
icon clock
10 |1500

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

Thanks Zoya. I'll reach out to the team as you suggest.


Best,

Neel.

Upvotes
32.2k 39 11 19

Hello @ns3481 ,

Please try this request on your side:

{
                {protocol}}{
                {host}}{
                {api}}Search/FuturesAndOptionsSearch
{
    "SearchRequest": {
      "@odata.context": "http://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#DataScope.Select.Api.Search.FuturesAndOptionsSearchRequest",
      "FuturesAndOptionsType": "Options",
      "UnderlyingRic": ".SPX",
      "AssetStatus":"Inactive",
       "ExpirationDate": {"@odata.type": "#DataScope.Select.Api.Search.DateValueComparison",
         "ComparisonOperator": "GreaterThanEquals",
         "Value": "1995-01-01"
        }
     }
}

perhaps this is what you are looking for?


icon clock
10 |1500

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

Hello @zoya faberov,


Thank you very much for your quick response. I had tried this earlier. The problem is with the inactive flag, I get only the inactive contracts on S&P 500 (from October 2017-Sept 2022), but not before. I need information on all historical contracts from 1996-.

Thank you very much.

Best,

Neel.