Discover Refinitiv
MyRefinitiv Refinitiv Perspectives Careers
Created with Sketch.
All APIs Questions & Answers  Register |  Login
Ask a question
  • Questions
  • Tags
  • Badges
  • Unanswered
Search:
  • Home /
  • DSS /

For a deeper look into our DataScope Select REST API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

avatar image
Question by atsmus900 · Dec 21, 2021 at 09:38 AM · historical

How to get list of options of SPX for historical expiration month via REST API?

Hello,
How to get list of options of SPX for historical expiration month via REST API?

I have success to receive current active options only.

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.

5 Replies

  • Sort: 
avatar image
REFINITIV
Best Answer
Answer by zoya faberov · Dec 23, 2021 at 09:14 PM

Hello @atsmus900 ,

Looking again into this, I believe I know what is happening. FuturesAndOptionsSearch is intended for the currently active instruments. Active and Inactive AssetStatus, in reference to FuturesAndOptionsSearch only means activity of the instrument, i.e. currently trading, and historical instruments, i.e. inactive ones, are not included in the results.

If you are permissioned, you may wish to look into HistoricalCriteriaSearch request for historical instrument selection:

{
                {protocol}}{
                {host}}{
                {api}}Search/HistoricalCriteriaSearch 
{
  "Request": {
    "BondTypeCodes": null,
    "ContributorIds": null,
    "CountryCodes": null,
    "CurrencyCodes": null,
    "ExchangeCodes": null,
    "FutureMonthCodes": null,
    "InstrumentTypeCodes": [115],
    "OptionMonthCodes": null,
    "OptionTypeCodes": null,
    "RicPattern": "^SPX",
    "ExpiryDate":      {
            "Start": "2018-01-01T00:00:00.000Z",
            "End": "2021-12-31T00:00:00.000Z"
      },
      "Range": {
      "Start": "2015-09-30T00:00:00.000Z",
      "End": "2021-12-31T23:59:59.999Z"
    }
  }
}

For the complete reference spec please refer to REST API Reference Tree -> Search -> Historical Criteria Search.

InstrumentTypeCode I have included (115) is one of several types of option instrument code, but may not be the right option for your requirement, please lookup the available InstrumentTypeCode values to select the Option code you are looking for, from the dropdown list; or you can enlist the help of Refinitiv content experts via Refinitiv Helpdesk Online -> Content -> RTH to help you select the correct content per your content requirement.



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 faberov · Dec 21, 2021 at 06:01 PM

Hello @atsmus900 ,

I can not be sure without seeing your entire request, however, usually, in order to obtain historic instruments you would use ValidationOptions, for example:

{
  "ExtractionRequest": {
    "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.PriceHistoryExtractionRequest",
    "ContentFieldNames": [
      "File Code",
      "RIC",
      "Trade Date",
      "Last Trade Price",
      "Universal Close Price",
      "Alternate Close Price",
      "High Price",
      "Low Price",
      "Open Price",
      "Volume Weighted Average Price",
      "Turnover",
      "Volume",
      "Accumulated Volume Unscaled",
      "Bid Price",
      "Asset Type",
      "Quote ID",
      "Bid Yield",
      "Exchange Code",
      "Currency Code"          
    ],
    "IdentifierList": {
      "@odata.type": "#DataScope.Select.Api.Extractions.ExtractionRequests.InstrumentIdentifierList",  
      "InstrumentIdentifiers": [
        { "Identifier": "CPI", "IdentifierType": "Ric" },
      { "Identifier": "GDP", "IdentifierType": "Ric" }
      ],
      "ValidationOptions": { "AllowHistoricalInstruments": true },
      "UseUserPreferencesForValidationOptions": false
    },
    "Condition": {
      "AdjustedPrices": true,
      "QueryStartDate": "2006-05-24T00:00:00.000Z",
      "QueryEndDate": "2006-07-31T00:00:00.000Z"
    }
  }
}

if this does not help, please include the complete request you issue for the valid options, so we can look at the same request

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 atsmus900 · Dec 22, 2021 at 10:30 AM

Hello @zoya farberov ,

Thank you for your response,

I'd like to download history tick data of all options (call & put from all the strikes) of SPX for specific day in the past.

I had success to download historical tick data for specific option by specified the RIC of the option (e.g. SPXl162215750.U)

my question is about the way to get the a list of these options?

The number of options can be hundreds and thousands.

I tried to use the below API but it return the list on all the options that currently active (about 30K options)

{
    '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': "2018-01-01T00:00:00.000Z"
      },
    }
}


Thank you.


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 faberov · Dec 22, 2021 at 05:21 PM

Hello @atsmus900 ,

Having run the same request on my side, and I see both valid and expired options in the result. For example:

{
    "@odata.context": "https://selectapi.datascope.refinitiv.com/RestApi/v1/$metadata#Collection(DataScope.Select.Api.Search.FuturesAndOptionsSearchResult)",
    "value": [
        {
            "Identifier": "SPXx172116500.U^L21",
            "IdentifierType": "Ric",
            "Source": "OPQ",
            "Key": "VjF8MHgwMDEwMGIwMDFiMDg4NGVlfDB4MDAxMDBiMDAxYjA4NDcyZXxPUFF8RFZRVXxERVJWfE9QVHxEfHxTUFh4MTcyMTE2NTAwLlVeTDIxfDcxNjk",
            "Description": "SPX Dec1 1650.0P",
            "InstrumentType": "DerivativeQuote",
            "Status": "Valid",
            "ExchangeCode": "OPQ",
            "CurrencyCode": "USD",

Any option that has "^" in the symbol I believe to be expired.

Please refer to REST API Reference Tree -> Search-> FuturesAndOptionsSearch for the complete request specification.

We can search for all options, or select active options or inactive instruments only, for example:

{
    "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": "2018-01-01T00:00:00.000Z"
      }
      
    }
}
...
"@odata.nextlink": "https://selectapi.datascope.refinitiv.com/RestApi/v1/Search/FuturesAndOptionsSearch?$skiptoken='MjUw'"

This will result in inactive options only. Please note the next link at the end, this allows to paginate through the rest of the result.

However, if this is not the content that you are looking for, you may need in-depth content expertise.

This forum is of most help with questions on API usage. For question on content, I suggest to contact Refinitiv content experts directly via Refinitiv Helpdesk Online -> Content -> DSS or dialing local Refinitiv helpdesk number.



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 atsmus900 · Dec 22, 2021 at 07:31 PM

Hello @zoya faberov

Thank you.

yours example has the same problem,

expiration day of "SPXx172116500.U^L21" is current month (Dec 2021)

the query is to get all options from 1/1/2018 but the result includes options with expiration day is this month and later, nothing before that.
1640201399035.png


1640201399035.png (11.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 >
14 People are following this question.

Related Questions

Delay Request using DSS

How i can get historical data of IDRxClosing to Excel

Extract SPX members Intraday bars

Problem requesting Intraday Summary data for Historical Identifiers using .NET

How to get the historical changes of constituents of a RIC chain, via DSS (or 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