Class: Intrinio::OptionsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/intrinio-sdk/api/options_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OptionsApi

Returns a new instance of OptionsApi.



19
20
21
# File 'lib/intrinio-sdk/api/options_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/intrinio-sdk/api/options_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_all_options_tickers(opts = {}) ⇒ ApiResponseOptionsTickers

Options Tickers Returns all tickers that have existing options contracts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :use_underlying_symbols (BOOLEAN)

    Use underlying symbol vs contract symbol (default to false)

Returns:



28
29
30
31
# File 'lib/intrinio-sdk/api/options_api.rb', line 28

def get_all_options_tickers(opts = {})
  data, _status_code, _headers = get_all_options_tickers_with_http_info(opts)
  return data
end

#get_all_options_tickers_with_http_info(opts = {}) ⇒ Array<(ApiResponseOptionsTickers, Fixnum, Hash)>

Options Tickers Returns all tickers that have existing options contracts.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :use_underlying_symbols (BOOLEAN)

    Use underlying symbol vs contract symbol

Returns:

  • (Array<(ApiResponseOptionsTickers, Fixnum, Hash)>)

    ApiResponseOptionsTickers data, response status code and response headers



38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/intrinio-sdk/api/options_api.rb', line 38

def get_all_options_tickers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_all_options_tickers ..."
  end
  # resource path
  local_var_path = "/options/tickers"

  # query parameters
  query_params = {}
  query_params[:'use_underlying_symbols'] = opts[:'use_underlying_symbols'] if !opts[:'use_underlying_symbols'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsTickers')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_all_options_tickers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_option_aggregates(opts = {}) ⇒ ApiResponseOptionsAggregates

Total open interest and volume aggregated by ticker Returns total open interest and volume by ticker

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Object)

    Return aggregated data for this date

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



80
81
82
83
# File 'lib/intrinio-sdk/api/options_api.rb', line 80

def get_option_aggregates(opts = {})
  data, _status_code, _headers = get_option_aggregates_with_http_info(opts)
  return data
end

#get_option_aggregates_with_http_info(opts = {}) ⇒ Array<(ApiResponseOptionsAggregates, Fixnum, Hash)>

Total open interest and volume aggregated by ticker Returns total open interest and volume by ticker

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Object)

    Return aggregated data for this date

  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/intrinio-sdk/api/options_api.rb', line 92

def get_option_aggregates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_option_aggregates ..."
  end
  # resource path
  local_var_path = "/options/aggregates"

  # query parameters
  query_params = {}
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsAggregates')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_option_aggregates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_option_expirations_realtime(symbol, opts = {}) ⇒ ApiResponseOptionsExpirations

Options Expirations Returns a list of all current and upcoming option contract expiration dates for a particular symbol.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    Return option contract expiration dates after this date.

  • :before (String)

    Return option contract expiration dates before this date.

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



138
139
140
141
# File 'lib/intrinio-sdk/api/options_api.rb', line 138

def get_option_expirations_realtime(symbol, opts = {})
  data, _status_code, _headers = get_option_expirations_realtime_with_http_info(symbol, opts)
  return data
end

#get_option_expirations_realtime_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsExpirations, Fixnum, Hash)>

Options Expirations Returns a list of all current and upcoming option contract expiration dates for a particular symbol.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    Return option contract expiration dates after this date.

  • :before (String)

    Return option contract expiration dates before this date.

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# File 'lib/intrinio-sdk/api/options_api.rb', line 152

def get_option_expirations_realtime_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_option_expirations_realtime ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_option_expirations_realtime"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/expirations/{symbol}/realtime".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'include_related_symbols'] = opts[:'include_related_symbols'] if !opts[:'include_related_symbols'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsExpirations')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_option_expirations_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_option_strikes_realtime(symbol, strike, opts = {}) ⇒ ApiResponseOptionsChainRealtime

Option Strikes Realtime Returns a list of the latest top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all call/put contracts that match the strike and symbol specified.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • strike

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or delayed.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



208
209
210
211
# File 'lib/intrinio-sdk/api/options_api.rb', line 208

def get_option_strikes_realtime(symbol, strike, opts = {})
  data, _status_code, _headers = get_option_strikes_realtime_with_http_info(symbol, strike, opts)
  return data
end

#get_option_strikes_realtime_with_http_info(symbol, strike, opts = {}) ⇒ Array<(ApiResponseOptionsChainRealtime, Fixnum, Hash)>

Option Strikes Realtime Returns a list of the latest top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all call/put contracts that match the strike and symbol specified.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • strike

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or delayed.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# File 'lib/intrinio-sdk/api/options_api.rb', line 224

def get_option_strikes_realtime_with_http_info(symbol, strike, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_option_strikes_realtime ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_option_strikes_realtime"
  end
  # verify the required parameter 'strike' is set
  if @api_client.config.client_side_validation && strike.nil?
    fail ArgumentError, "Missing the required parameter 'strike' when calling OptionsApi.get_option_strikes_realtime"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'delayed_sip', 'utp_delayed', 'otc_delayed', 'cta_a_delayed', 'cta_b_delayed', 'nasdaq_basic', 'cboe_one_delayed', 'iex_delayed'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, delayed_sip, utp_delayed, otc_delayed, cta_a_delayed, cta_b_delayed, nasdaq_basic, cboe_one_delayed, iex_delayed'
  end
  if @api_client.config.client_side_validation && opts[:'model'] && !['black_scholes', 'bjerk'].include?(opts[:'model'])
    fail ArgumentError, 'invalid value for "model", must be one of black_scholes, bjerk'
  end
  # resource path
  local_var_path = "/options/strikes/{symbol}/{strike}/realtime".sub('{' + 'symbol' + '}', symbol.to_s).sub('{' + 'strike' + '}', strike.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
  query_params[:'show_extended_price'] = opts[:'show_extended_price'] if !opts[:'show_extended_price'].nil?
  query_params[:'include_related_symbols'] = opts[:'include_related_symbols'] if !opts[:'include_related_symbols'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsChainRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_option_strikes_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_option_trades(opts = {}) ⇒ OptionTradesResult

Option Trades Returns all trades between start time and end time, up to seven days ago for the specified source.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The specific source of the data being requested.

  • :start_date (Date)

    The start date for the data being requested.

  • :start_time (String)

    The start time for the data being requested.

  • :end_date (Date)

    The end date for the data being requested.

  • :end_time (String)

    The end time for the data being requested.

  • :timezone (String)

    The timezone the start and end date/times use. (default to UTC)

  • :page_size (Integer)

    The maximum number of results to return per page. (default to 100)

  • :min_size (Integer)

    Trades must be larger or equal to this size.

  • :security (String)

    The ticker symbol for which trades are being requested.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



294
295
296
297
# File 'lib/intrinio-sdk/api/options_api.rb', line 294

def get_option_trades(opts = {})
  data, _status_code, _headers = get_option_trades_with_http_info(opts)
  return data
end

#get_option_trades_by_contract(identifier, opts = {}) ⇒ OptionTradesResult

Option Trades By Contract Returns all trades for a contract between start time and end time, up to seven days ago for the specified source.

Parameters:

  • identifier

    The option contract for which trades are being requested.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The specific source of the data being requested.

  • :start_date (Date)

    The start date for the data being requested.

  • :start_time (String)

    The start time for the data being requested.

  • :end_date (Date)

    The end date for the data being requested.

  • :end_time (String)

    The end time for the data being requested.

  • :timezone (String)

    The timezone the start and end date/times use. (default to UTC)

  • :page_size (Integer)

    The maximum number of results to return per page. (default to 100)

  • :min_size (Integer)

    Trades must be larger or equal to this size.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



381
382
383
384
# File 'lib/intrinio-sdk/api/options_api.rb', line 381

def get_option_trades_by_contract(identifier, opts = {})
  data, _status_code, _headers = get_option_trades_by_contract_with_http_info(identifier, opts)
  return data
end

#get_option_trades_by_contract_with_http_info(identifier, opts = {}) ⇒ Array<(OptionTradesResult, Fixnum, Hash)>

Option Trades By Contract Returns all trades for a contract between start time and end time, up to seven days ago for the specified source.

Parameters:

  • identifier

    The option contract for which trades are being requested.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The specific source of the data being requested.

  • :start_date (Date)

    The start date for the data being requested.

  • :start_time (String)

    The start time for the data being requested.

  • :end_date (Date)

    The end date for the data being requested.

  • :end_time (String)

    The end time for the data being requested.

  • :timezone (String)

    The timezone the start and end date/times use.

  • :page_size (Integer)

    The maximum number of results to return per page.

  • :min_size (Integer)

    Trades must be larger or equal to this size.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(OptionTradesResult, Fixnum, Hash)>)

    OptionTradesResult data, response status code and response headers



400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
# File 'lib/intrinio-sdk/api/options_api.rb', line 400

def get_option_trades_by_contract_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_option_trades_by_contract ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_option_trades_by_contract"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'timezone'] && !['Africa/Algiers', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Monrovia', 'Africa/Nairobi', 'America/Argentina/Buenos_Aires', 'America/Bogota', 'America/Caracas', 'America/Chicago', 'America/Chihuahua', 'America/Denver', 'America/Godthab', 'America/Guatemala', 'America/Guyana', 'America/Halifax', 'America/Indiana/Indianapolis', 'America/Juneau', 'America/La_Paz', 'America/Lima', 'America/Lima', 'America/Los_Angeles', 'America/Mazatlan', 'America/Mexico_City', 'America/Mexico_City', 'America/Monterrey', 'America/Montevideo', 'America/New_York', 'America/Phoenix', 'America/Regina', 'America/Santiago', 'America/Sao_Paulo', 'America/St_Johns', 'America/Tijuana', 'Asia/Almaty', 'Asia/Baghdad', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Bangkok', 'Asia/Chongqing', 'Asia/Colombo', 'Asia/Dhaka', 'Asia/Dhaka', 'Asia/Hong_Kong', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuwait', 'Asia/Magadan', 'Asia/Muscat', 'Asia/Muscat', 'Asia/Novosibirsk', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Cape_Verde', 'Atlantic/South_Georgia', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Darwin', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Etc/UTC', 'UTC', 'Europe/Amsterdam', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Helsinki', 'Europe/Istanbul', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/London', 'Europe/Madrid', 'Europe/Minsk', 'Europe/Moscow', 'Europe/Moscow', 'Europe/Paris', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/Sarajevo', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Auckland', 'Pacific/Chatham', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Majuro', 'Pacific/Midway', 'Pacific/Midway', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Port_Moresby', 'Pacific/Tongatapu'].include?(opts[:'timezone'])
    fail ArgumentError, 'invalid value for "timezone", must be one of Africa/Algiers, Africa/Cairo, Africa/Casablanca, Africa/Harare, Africa/Johannesburg, Africa/Monrovia, Africa/Nairobi, America/Argentina/Buenos_Aires, America/Bogota, America/Caracas, America/Chicago, America/Chihuahua, America/Denver, America/Godthab, America/Guatemala, America/Guyana, America/Halifax, America/Indiana/Indianapolis, America/Juneau, America/La_Paz, America/Lima, America/Lima, America/Los_Angeles, America/Mazatlan, America/Mexico_City, America/Mexico_City, America/Monterrey, America/Montevideo, America/New_York, America/Phoenix, America/Regina, America/Santiago, America/Sao_Paulo, America/St_Johns, America/Tijuana, Asia/Almaty, Asia/Baghdad, Asia/Baku, Asia/Bangkok, Asia/Bangkok, Asia/Chongqing, Asia/Colombo, Asia/Dhaka, Asia/Dhaka, Asia/Hong_Kong, Asia/Irkutsk, Asia/Jakarta, Asia/Jerusalem, Asia/Kabul, Asia/Kamchatka, Asia/Karachi, Asia/Karachi, Asia/Kathmandu, Asia/Kolkata, Asia/Kolkata, Asia/Kolkata, Asia/Kolkata, Asia/Krasnoyarsk, Asia/Kuala_Lumpur, Asia/Kuwait, Asia/Magadan, Asia/Muscat, Asia/Muscat, Asia/Novosibirsk, Asia/Rangoon, Asia/Riyadh, Asia/Seoul, Asia/Shanghai, Asia/Singapore, Asia/Srednekolymsk, Asia/Taipei, Asia/Tashkent, Asia/Tbilisi, Asia/Tehran, Asia/Tokyo, Asia/Tokyo, Asia/Tokyo, Asia/Ulaanbaatar, Asia/Urumqi, Asia/Vladivostok, Asia/Yakutsk, Asia/Yekaterinburg, Asia/Yerevan, Atlantic/Azores, Atlantic/Cape_Verde, Atlantic/South_Georgia, Australia/Adelaide, Australia/Brisbane, Australia/Darwin, Australia/Hobart, Australia/Melbourne, Australia/Melbourne, Australia/Perth, Australia/Sydney, Etc/UTC, UTC, Europe/Amsterdam, Europe/Athens, Europe/Belgrade, Europe/Berlin, Europe/Berlin, Europe/Bratislava, Europe/Brussels, Europe/Bucharest, Europe/Budapest, Europe/Copenhagen, Europe/Dublin, Europe/Helsinki, Europe/Istanbul, Europe/Kaliningrad, Europe/Kiev, Europe/Lisbon, Europe/Ljubljana, Europe/London, Europe/London, Europe/Madrid, Europe/Minsk, Europe/Moscow, Europe/Moscow, Europe/Paris, Europe/Prague, Europe/Riga, Europe/Rome, Europe/Samara, Europe/Sarajevo, Europe/Skopje, Europe/Sofia, Europe/Stockholm, Europe/Tallinn, Europe/Vienna, Europe/Vilnius, Europe/Volgograd, Europe/Warsaw, Europe/Zagreb, Pacific/Apia, Pacific/Auckland, Pacific/Auckland, Pacific/Chatham, Pacific/Fakaofo, Pacific/Fiji, Pacific/Guadalcanal, Pacific/Guam, Pacific/Honolulu, Pacific/Majuro, Pacific/Midway, Pacific/Midway, Pacific/Noumea, Pacific/Pago_Pago, Pacific/Port_Moresby, Pacific/Tongatapu'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_option_trades_by_contract, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = "/options/{identifier}/trades".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'start_time'] = opts[:'start_time'] if !opts[:'start_time'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'timezone'] = opts[:'timezone'] if !opts[:'timezone'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'min_size'] = opts[:'min_size'] if !opts[:'min_size'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OptionTradesResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_option_trades_by_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_option_trades_with_http_info(opts = {}) ⇒ Array<(OptionTradesResult, Fixnum, Hash)>

Option Trades Returns all trades between start time and end time, up to seven days ago for the specified source.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The specific source of the data being requested.

  • :start_date (Date)

    The start date for the data being requested.

  • :start_time (String)

    The start time for the data being requested.

  • :end_date (Date)

    The end date for the data being requested.

  • :end_time (String)

    The end time for the data being requested.

  • :timezone (String)

    The timezone the start and end date/times use.

  • :page_size (Integer)

    The maximum number of results to return per page.

  • :min_size (Integer)

    Trades must be larger or equal to this size.

  • :security (String)

    The ticker symbol for which trades are being requested.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(OptionTradesResult, Fixnum, Hash)>)

    OptionTradesResult data, response status code and response headers



313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
# File 'lib/intrinio-sdk/api/options_api.rb', line 313

def get_option_trades_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_option_trades ..."
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'timezone'] && !['Africa/Algiers', 'Africa/Cairo', 'Africa/Casablanca', 'Africa/Harare', 'Africa/Johannesburg', 'Africa/Monrovia', 'Africa/Nairobi', 'America/Argentina/Buenos_Aires', 'America/Bogota', 'America/Caracas', 'America/Chicago', 'America/Chihuahua', 'America/Denver', 'America/Godthab', 'America/Guatemala', 'America/Guyana', 'America/Halifax', 'America/Indiana/Indianapolis', 'America/Juneau', 'America/La_Paz', 'America/Lima', 'America/Lima', 'America/Los_Angeles', 'America/Mazatlan', 'America/Mexico_City', 'America/Mexico_City', 'America/Monterrey', 'America/Montevideo', 'America/New_York', 'America/Phoenix', 'America/Regina', 'America/Santiago', 'America/Sao_Paulo', 'America/St_Johns', 'America/Tijuana', 'Asia/Almaty', 'Asia/Baghdad', 'Asia/Baku', 'Asia/Bangkok', 'Asia/Bangkok', 'Asia/Chongqing', 'Asia/Colombo', 'Asia/Dhaka', 'Asia/Dhaka', 'Asia/Hong_Kong', 'Asia/Irkutsk', 'Asia/Jakarta', 'Asia/Jerusalem', 'Asia/Kabul', 'Asia/Kamchatka', 'Asia/Karachi', 'Asia/Karachi', 'Asia/Kathmandu', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Kolkata', 'Asia/Krasnoyarsk', 'Asia/Kuala_Lumpur', 'Asia/Kuwait', 'Asia/Magadan', 'Asia/Muscat', 'Asia/Muscat', 'Asia/Novosibirsk', 'Asia/Rangoon', 'Asia/Riyadh', 'Asia/Seoul', 'Asia/Shanghai', 'Asia/Singapore', 'Asia/Srednekolymsk', 'Asia/Taipei', 'Asia/Tashkent', 'Asia/Tbilisi', 'Asia/Tehran', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Tokyo', 'Asia/Ulaanbaatar', 'Asia/Urumqi', 'Asia/Vladivostok', 'Asia/Yakutsk', 'Asia/Yekaterinburg', 'Asia/Yerevan', 'Atlantic/Azores', 'Atlantic/Cape_Verde', 'Atlantic/South_Georgia', 'Australia/Adelaide', 'Australia/Brisbane', 'Australia/Darwin', 'Australia/Hobart', 'Australia/Melbourne', 'Australia/Melbourne', 'Australia/Perth', 'Australia/Sydney', 'Etc/UTC', 'UTC', 'Europe/Amsterdam', 'Europe/Athens', 'Europe/Belgrade', 'Europe/Berlin', 'Europe/Berlin', 'Europe/Bratislava', 'Europe/Brussels', 'Europe/Bucharest', 'Europe/Budapest', 'Europe/Copenhagen', 'Europe/Dublin', 'Europe/Helsinki', 'Europe/Istanbul', 'Europe/Kaliningrad', 'Europe/Kiev', 'Europe/Lisbon', 'Europe/Ljubljana', 'Europe/London', 'Europe/London', 'Europe/Madrid', 'Europe/Minsk', 'Europe/Moscow', 'Europe/Moscow', 'Europe/Paris', 'Europe/Prague', 'Europe/Riga', 'Europe/Rome', 'Europe/Samara', 'Europe/Sarajevo', 'Europe/Skopje', 'Europe/Sofia', 'Europe/Stockholm', 'Europe/Tallinn', 'Europe/Vienna', 'Europe/Vilnius', 'Europe/Volgograd', 'Europe/Warsaw', 'Europe/Zagreb', 'Pacific/Apia', 'Pacific/Auckland', 'Pacific/Auckland', 'Pacific/Chatham', 'Pacific/Fakaofo', 'Pacific/Fiji', 'Pacific/Guadalcanal', 'Pacific/Guam', 'Pacific/Honolulu', 'Pacific/Majuro', 'Pacific/Midway', 'Pacific/Midway', 'Pacific/Noumea', 'Pacific/Pago_Pago', 'Pacific/Port_Moresby', 'Pacific/Tongatapu'].include?(opts[:'timezone'])
    fail ArgumentError, 'invalid value for "timezone", must be one of Africa/Algiers, Africa/Cairo, Africa/Casablanca, Africa/Harare, Africa/Johannesburg, Africa/Monrovia, Africa/Nairobi, America/Argentina/Buenos_Aires, America/Bogota, America/Caracas, America/Chicago, America/Chihuahua, America/Denver, America/Godthab, America/Guatemala, America/Guyana, America/Halifax, America/Indiana/Indianapolis, America/Juneau, America/La_Paz, America/Lima, America/Lima, America/Los_Angeles, America/Mazatlan, America/Mexico_City, America/Mexico_City, America/Monterrey, America/Montevideo, America/New_York, America/Phoenix, America/Regina, America/Santiago, America/Sao_Paulo, America/St_Johns, America/Tijuana, Asia/Almaty, Asia/Baghdad, Asia/Baku, Asia/Bangkok, Asia/Bangkok, Asia/Chongqing, Asia/Colombo, Asia/Dhaka, Asia/Dhaka, Asia/Hong_Kong, Asia/Irkutsk, Asia/Jakarta, Asia/Jerusalem, Asia/Kabul, Asia/Kamchatka, Asia/Karachi, Asia/Karachi, Asia/Kathmandu, Asia/Kolkata, Asia/Kolkata, Asia/Kolkata, Asia/Kolkata, Asia/Krasnoyarsk, Asia/Kuala_Lumpur, Asia/Kuwait, Asia/Magadan, Asia/Muscat, Asia/Muscat, Asia/Novosibirsk, Asia/Rangoon, Asia/Riyadh, Asia/Seoul, Asia/Shanghai, Asia/Singapore, Asia/Srednekolymsk, Asia/Taipei, Asia/Tashkent, Asia/Tbilisi, Asia/Tehran, Asia/Tokyo, Asia/Tokyo, Asia/Tokyo, Asia/Ulaanbaatar, Asia/Urumqi, Asia/Vladivostok, Asia/Yakutsk, Asia/Yekaterinburg, Asia/Yerevan, Atlantic/Azores, Atlantic/Cape_Verde, Atlantic/South_Georgia, Australia/Adelaide, Australia/Brisbane, Australia/Darwin, Australia/Hobart, Australia/Melbourne, Australia/Melbourne, Australia/Perth, Australia/Sydney, Etc/UTC, UTC, Europe/Amsterdam, Europe/Athens, Europe/Belgrade, Europe/Berlin, Europe/Berlin, Europe/Bratislava, Europe/Brussels, Europe/Bucharest, Europe/Budapest, Europe/Copenhagen, Europe/Dublin, Europe/Helsinki, Europe/Istanbul, Europe/Kaliningrad, Europe/Kiev, Europe/Lisbon, Europe/Ljubljana, Europe/London, Europe/London, Europe/Madrid, Europe/Minsk, Europe/Moscow, Europe/Moscow, Europe/Paris, Europe/Prague, Europe/Riga, Europe/Rome, Europe/Samara, Europe/Sarajevo, Europe/Skopje, Europe/Sofia, Europe/Stockholm, Europe/Tallinn, Europe/Vienna, Europe/Vilnius, Europe/Volgograd, Europe/Warsaw, Europe/Zagreb, Pacific/Apia, Pacific/Auckland, Pacific/Auckland, Pacific/Chatham, Pacific/Fakaofo, Pacific/Fiji, Pacific/Guadalcanal, Pacific/Guam, Pacific/Honolulu, Pacific/Majuro, Pacific/Midway, Pacific/Midway, Pacific/Noumea, Pacific/Pago_Pago, Pacific/Port_Moresby, Pacific/Tongatapu'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_option_trades, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = "/options/trades"

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'start_time'] = opts[:'start_time'] if !opts[:'start_time'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?
  query_params[:'timezone'] = opts[:'timezone'] if !opts[:'timezone'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'min_size'] = opts[:'min_size'] if !opts[:'min_size'].nil?
  query_params[:'security'] = opts[:'security'] if !opts[:'security'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OptionTradesResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_option_trades\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options(symbol, opts = {}) ⇒ ApiResponseOptions

Options Returns a list of all securities that have options listed and are tradable on a US market exchange. Useful to retrieve the entire universe. Available via a 3rd party, contact sales for a trial.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :expiration (String)

    The expiration date of the option contract. This will return options contracts with expiration dates on this date.

  • :expiration_after (String)

    The expiration date of the option contract. This will return options contracts with expiration dates after this date.

  • :expiration_before (String)

    The expiration date of the option contract. This will return options contracts with expiration dates before this date.

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



471
472
473
474
# File 'lib/intrinio-sdk/api/options_api.rb', line 471

def get_options(symbol, opts = {})
  data, _status_code, _headers = get_options_with_http_info(symbol, opts)
  return data
end

#get_options_by_symbol_realtime(symbol, opts = {}) ⇒ ApiResponseOptionsRealtime

Options by Symbol Realtime Returns a list of all securities that have options listed and are tradable on a US market exchange. Useful to retrieve the entire universe.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :expiration (String)

    The expiration date of the option contract. This will return options contracts with expiration dates on this date.

  • :expiration_after (String)

    The expiration date of the option contract. This will return options contracts with expiration dates after this date.

  • :expiration_before (String)

    The expiration date of the option contract. This will return options contracts with expiration dates before this date.

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



558
559
560
561
# File 'lib/intrinio-sdk/api/options_api.rb', line 558

def get_options_by_symbol_realtime(symbol, opts = {})
  data, _status_code, _headers = get_options_by_symbol_realtime_with_http_info(symbol, opts)
  return data
end

#get_options_by_symbol_realtime_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsRealtime, Fixnum, Hash)>

Options by Symbol Realtime Returns a list of all securities that have options listed and are tradable on a US market exchange. Useful to retrieve the entire universe.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :expiration (String)

    The expiration date of the option contract. This will return options contracts with expiration dates on this date.

  • :expiration_after (String)

    The expiration date of the option contract. This will return options contracts with expiration dates after this date.

  • :expiration_before (String)

    The expiration date of the option contract. This will return options contracts with expiration dates before this date.

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:

  • (Array<(ApiResponseOptionsRealtime, Fixnum, Hash)>)

    ApiResponseOptionsRealtime data, response status code and response headers



577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
# File 'lib/intrinio-sdk/api/options_api.rb', line 577

def get_options_by_symbol_realtime_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_by_symbol_realtime ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_by_symbol_realtime"
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of call, put'
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/{symbol}/realtime".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil?
  query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil?
  query_params[:'expiration'] = opts[:'expiration'] if !opts[:'expiration'].nil?
  query_params[:'expiration_after'] = opts[:'expiration_after'] if !opts[:'expiration_after'].nil?
  query_params[:'expiration_before'] = opts[:'expiration_before'] if !opts[:'expiration_before'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'include_related_symbols'] = opts[:'include_related_symbols'] if !opts[:'include_related_symbols'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_by_symbol_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_chain(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChain

Options Chain Returns a list of the historical end-of-day top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all option contracts currently associated with the option chain. Available via a 3rd party, contact sales for a trial.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • expiration

    The expiration date of the options contract

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date of the option price. Returns option prices on this date.

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :moneyness (String)

    The moneyness of the options contracts to return. &#39;all&#39; will return all options contracts. &#39;in_the_money&#39; will return options contracts that are in the money (call options with strike prices below the current price, put options with strike prices above the current price). &#39;out_of_they_money&#39; will return options contracts that are out of the money (call options with strike prices above the current price, put options with strike prices below the current price). &#39;near_the_money&#39; will return options contracts that are $0.50 or less away from being in the money.

  • :page_size (Integer)

    The number of results to return (default to 100)

Returns:



643
644
645
646
# File 'lib/intrinio-sdk/api/options_api.rb', line 643

def get_options_chain(symbol, expiration, opts = {})
  data, _status_code, _headers = get_options_chain_with_http_info(symbol, expiration, opts)
  return data
end

#get_options_chain_eod(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChainEod

Options Chain EOD Returns all EOD options contracts and their prices for the given symbol and expiration date.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • expiration

    The expiration date of the options contract

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :date (Date)

    The date to retrieve prices for

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



732
733
734
735
# File 'lib/intrinio-sdk/api/options_api.rb', line 732

def get_options_chain_eod(symbol, expiration, opts = {})
  data, _status_code, _headers = get_options_chain_eod_with_http_info(symbol, expiration, opts)
  return data
end

#get_options_chain_eod_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChainEod, Fixnum, Hash)>

Options Chain EOD Returns all EOD options contracts and their prices for the given symbol and expiration date.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • expiration

    The expiration date of the options contract

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :date (Date)

    The date to retrieve prices for

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:

  • (Array<(ApiResponseOptionsChainEod, Fixnum, Hash)>)

    ApiResponseOptionsChainEod data, response status code and response headers



749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
# File 'lib/intrinio-sdk/api/options_api.rb', line 749

def get_options_chain_eod_with_http_info(symbol, expiration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_chain_eod ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_chain_eod"
  end
  # verify the required parameter 'expiration' is set
  if @api_client.config.client_side_validation && expiration.nil?
    fail ArgumentError, "Missing the required parameter 'expiration' when calling OptionsApi.get_options_chain_eod"
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of call, put'
  end
  # resource path
  local_var_path = "/options/chain/{symbol}/{expiration}/eod".sub('{' + 'symbol' + '}', symbol.to_s).sub('{' + 'expiration' + '}', expiration.to_s)

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil?
  query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil?
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'include_related_symbols'] = opts[:'include_related_symbols'] if !opts[:'include_related_symbols'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsChainEod')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_chain_eod\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_chain_realtime(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChainRealtime

Options Chain Realtime Returns a list of the latest National Best Bid & Offer (NBBO) top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all option contracts currently associated with the option chain.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • expiration

    The expiration date of the options contract

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :volume_greater_than (Float)

    The volume of the option contract. This will return options contracts with volumes greater than this amount.

  • :volume_less_than (Float)

    The volume of the option contract. This will return options contracts with volumes less than this amout.

  • :open_interest_greater_than (Float)

    The open interest of the option contract. This will return options contracts with open interest greater than this amount.

  • :open_interest_less_than (Float)

    The open interest of the option contract. This will return options contracts with open interest less than this amount.

  • :moneyness (String)

    The moneyness of the options contracts to return. &#39;all&#39; will return all options contracts. &#39;in_the_money&#39; will return options contracts that are in the money (call options with strike prices below the current price, put options with strike prices above the current price). &#39;out_of_they_money&#39; will return options contracts that are out of the money (call options with strike prices above the current price, put options with strike prices below the current price). &#39;near_the_money&#39; will return options contracts that are $0.50 or less away from being in the money. Requires subscription to realtime stock price data.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

  • :show_stats (BOOLEAN)

    Whether to include Greek calculations or not.

Returns:



821
822
823
824
# File 'lib/intrinio-sdk/api/options_api.rb', line 821

def get_options_chain_realtime(symbol, expiration, opts = {})
  data, _status_code, _headers = get_options_chain_realtime_with_http_info(symbol, expiration, opts)
  return data
end

#get_options_chain_realtime_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChainRealtime, Fixnum, Hash)>

Options Chain Realtime Returns a list of the latest National Best Bid &amp; Offer (NBBO) top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all option contracts currently associated with the option chain.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • expiration

    The expiration date of the options contract

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :volume_greater_than (Float)

    The volume of the option contract. This will return options contracts with volumes greater than this amount.

  • :volume_less_than (Float)

    The volume of the option contract. This will return options contracts with volumes less than this amout.

  • :open_interest_greater_than (Float)

    The open interest of the option contract. This will return options contracts with open interest greater than this amount.

  • :open_interest_less_than (Float)

    The open interest of the option contract. This will return options contracts with open interest less than this amount.

  • :moneyness (String)

    The moneyness of the options contracts to return. &#39;all&#39; will return all options contracts. &#39;in_the_money&#39; will return options contracts that are in the money (call options with strike prices below the current price, put options with strike prices above the current price). &#39;out_of_they_money&#39; will return options contracts that are out of the money (call options with strike prices above the current price, put options with strike prices below the current price). &#39;near_the_money&#39; will return options contracts that are $0.50 or less away from being in the money. Requires subscription to realtime stock price data.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

  • :show_stats (BOOLEAN)

    Whether to include Greek calculations or not.

Returns:



847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
# File 'lib/intrinio-sdk/api/options_api.rb', line 847

def get_options_chain_realtime_with_http_info(symbol, expiration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_chain_realtime ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_chain_realtime"
  end
  # verify the required parameter 'expiration' is set
  if @api_client.config.client_side_validation && expiration.nil?
    fail ArgumentError, "Missing the required parameter 'expiration' when calling OptionsApi.get_options_chain_realtime"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of call, put'
  end
  if @api_client.config.client_side_validation && opts[:'moneyness'] && !['all', 'in_the_money', 'out_of_the_money', 'near_the_money'].include?(opts[:'moneyness'])
    fail ArgumentError, 'invalid value for "moneyness", must be one of all, in_the_money, out_of_the_money, near_the_money'
  end
  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'delayed_sip', 'utp_delayed', 'otc_delayed', 'cta_a_delayed', 'cta_b_delayed', 'nasdaq_basic', 'cboe_one_delayed', 'iex_delayed'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, delayed_sip, utp_delayed, otc_delayed, cta_a_delayed, cta_b_delayed, nasdaq_basic, cboe_one_delayed, iex_delayed'
  end
  if @api_client.config.client_side_validation && opts[:'model'] && !['black_scholes', 'bjerk'].include?(opts[:'model'])
    fail ArgumentError, 'invalid value for "model", must be one of black_scholes, bjerk'
  end
  # resource path
  local_var_path = "/options/chain/{symbol}/{expiration}/realtime".sub('{' + 'symbol' + '}', symbol.to_s).sub('{' + 'expiration' + '}', expiration.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil?
  query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil?
  query_params[:'volume_greater_than'] = opts[:'volume_greater_than'] if !opts[:'volume_greater_than'].nil?
  query_params[:'volume_less_than'] = opts[:'volume_less_than'] if !opts[:'volume_less_than'].nil?
  query_params[:'open_interest_greater_than'] = opts[:'open_interest_greater_than'] if !opts[:'open_interest_greater_than'].nil?
  query_params[:'open_interest_less_than'] = opts[:'open_interest_less_than'] if !opts[:'open_interest_less_than'].nil?
  query_params[:'moneyness'] = opts[:'moneyness'] if !opts[:'moneyness'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
  query_params[:'show_extended_price'] = opts[:'show_extended_price'] if !opts[:'show_extended_price'].nil?
  query_params[:'include_related_symbols'] = opts[:'include_related_symbols'] if !opts[:'include_related_symbols'].nil?
  query_params[:'show_stats'] = opts[:'show_stats'] if !opts[:'show_stats'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsChainRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_chain_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_chain_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChain, Fixnum, Hash)>

Options Chain Returns a list of the historical end-of-day top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all option contracts currently associated with the option chain. Available via a 3rd party, contact sales for a trial.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • expiration

    The expiration date of the options contract

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date of the option price. Returns option prices on this date.

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :moneyness (String)

    The moneyness of the options contracts to return. &#39;all&#39; will return all options contracts. &#39;in_the_money&#39; will return options contracts that are in the money (call options with strike prices below the current price, put options with strike prices above the current price). &#39;out_of_they_money&#39; will return options contracts that are out of the money (call options with strike prices above the current price, put options with strike prices below the current price). &#39;near_the_money&#39; will return options contracts that are $0.50 or less away from being in the money.

  • :page_size (Integer)

    The number of results to return

Returns:

  • (Array<(ApiResponseOptionsChain, Fixnum, Hash)>)

    ApiResponseOptionsChain data, response status code and response headers



661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
# File 'lib/intrinio-sdk/api/options_api.rb', line 661

def get_options_chain_with_http_info(symbol, expiration, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_chain ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_chain"
  end
  # verify the required parameter 'expiration' is set
  if @api_client.config.client_side_validation && expiration.nil?
    fail ArgumentError, "Missing the required parameter 'expiration' when calling OptionsApi.get_options_chain"
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of call, put'
  end
  if @api_client.config.client_side_validation && opts[:'moneyness'] && !['all', 'in_the_money', 'out_of_the_money', 'near_the_money'].include?(opts[:'moneyness'])
    fail ArgumentError, 'invalid value for "moneyness", must be one of all, in_the_money, out_of_the_money, near_the_money'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_chain, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = "/options/chain/{symbol}/{expiration}".sub('{' + 'symbol' + '}', symbol.to_s).sub('{' + 'expiration' + '}', expiration.to_s)

  # query parameters
  query_params = {}
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil?
  query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil?
  query_params[:'moneyness'] = opts[:'moneyness'] if !opts[:'moneyness'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsChain')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_chain\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_expirations(symbol, opts = {}) ⇒ ApiResponseOptionsExpirations

Options Expirations Returns a list of all current and upcoming option contract expiration dates for a particular symbol. Available via a 3rd party, contact sales for a trial.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    Return option contract expiration dates after this date.

  • :before (String)

    Return option contract expiration dates before this date.

Returns:



926
927
928
929
# File 'lib/intrinio-sdk/api/options_api.rb', line 926

def get_options_expirations(symbol, opts = {})
  data, _status_code, _headers = get_options_expirations_with_http_info(symbol, opts)
  return data
end

#get_options_expirations_eod(symbol, opts = {}) ⇒ ApiResponseOptionsExpirations

Options Expirations Returns a list of all current and upcoming option contract expiration dates for a particular symbol.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    Return option contract expiration dates after this date.

  • :before (String)

    Return option contract expiration dates before this date.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



986
987
988
989
# File 'lib/intrinio-sdk/api/options_api.rb', line 986

def get_options_expirations_eod(symbol, opts = {})
  data, _status_code, _headers = get_options_expirations_eod_with_http_info(symbol, opts)
  return data
end

#get_options_expirations_eod_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsExpirations, Fixnum, Hash)>

Options Expirations Returns a list of all current and upcoming option contract expiration dates for a particular symbol.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    Return option contract expiration dates after this date.

  • :before (String)

    Return option contract expiration dates before this date.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

Returns:



999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
# File 'lib/intrinio-sdk/api/options_api.rb', line 999

def get_options_expirations_eod_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_expirations_eod ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_expirations_eod"
  end
  # resource path
  local_var_path = "/options/expirations/{symbol}/eod".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?
  query_params[:'include_related_symbols'] = opts[:'include_related_symbols'] if !opts[:'include_related_symbols'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsExpirations')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_expirations_eod\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_expirations_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsExpirations, Fixnum, Hash)>

Options Expirations Returns a list of all current and upcoming option contract expiration dates for a particular symbol. Available via a 3rd party, contact sales for a trial.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :after (String)

    Return option contract expiration dates after this date.

  • :before (String)

    Return option contract expiration dates before this date.

Returns:



938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
# File 'lib/intrinio-sdk/api/options_api.rb', line 938

def get_options_expirations_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_expirations ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_expirations"
  end
  # resource path
  local_var_path = "/options/expirations/{symbol}".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'after'] = opts[:'after'] if !opts[:'after'].nil?
  query_params[:'before'] = opts[:'before'] if !opts[:'before'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsExpirations')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_expirations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_gainers(mode, opts = {}) ⇒ ApiResponseOptionMovers

Options Top Gainers Returns a list of top gainers since last close.

Parameters:

  • mode

    Which metric to sort by - change, percent change, or volume.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



1046
1047
1048
1049
# File 'lib/intrinio-sdk/api/options_api.rb', line 1046

def get_options_gainers(mode, opts = {})
  data, _status_code, _headers = get_options_gainers_with_http_info(mode, opts)
  return data
end

#get_options_gainers_with_http_info(mode, opts = {}) ⇒ Array<(ApiResponseOptionMovers, Fixnum, Hash)>

Options Top Gainers Returns a list of top gainers since last close.

Parameters:

  • mode

    Which metric to sort by - change, percent change, or volume.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseOptionMovers, Fixnum, Hash)>)

    ApiResponseOptionMovers data, response status code and response headers



1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
# File 'lib/intrinio-sdk/api/options_api.rb', line 1057

def get_options_gainers_with_http_info(mode, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_gainers ..."
  end
  # verify the required parameter 'mode' is set
  if @api_client.config.client_side_validation && mode.nil?
    fail ArgumentError, "Missing the required parameter 'mode' when calling OptionsApi.get_options_gainers"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['change', 'percent_change', 'volume'].include?(mode)
    fail ArgumentError, "invalid value for 'mode', must be one of change, percent_change, volume"
  end
  # resource path
  local_var_path = "/options/gainers"

  # query parameters
  query_params = {}
  query_params[:'mode'] = mode
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionMovers')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_gainers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_greeks_by_contract(contract, opts = {}) ⇒ ApiResponseOptionsGreekContractRealtime

Option Greeks & Derived Price by Contract Retrieves realtime options greeks data for a specific options contract

Parameters:

  • contract

    The options contract identifier

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The data source to use for options data

  • :model (String)

    The options pricing model to use for greeks calculations (default to black_scholes)

  • :iv_mode (String)

    The implied volatility calculation mode

  • :stock_price_source (String)

    The data source to use for underlying stock prices

Returns:



1110
1111
1112
1113
# File 'lib/intrinio-sdk/api/options_api.rb', line 1110

def get_options_greeks_by_contract(contract, opts = {})
  data, _status_code, _headers = get_options_greeks_by_contract_with_http_info(contract, opts)
  return data
end

#get_options_greeks_by_contract_with_http_info(contract, opts = {}) ⇒ Array<(ApiResponseOptionsGreekContractRealtime, Fixnum, Hash)>

Option Greeks &amp; Derived Price by Contract Retrieves realtime options greeks data for a specific options contract

Parameters:

  • contract

    The options contract identifier

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The data source to use for options data

  • :model (String)

    The options pricing model to use for greeks calculations

  • :iv_mode (String)

    The implied volatility calculation mode

  • :stock_price_source (String)

    The data source to use for underlying stock prices

Returns:



1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
# File 'lib/intrinio-sdk/api/options_api.rb', line 1124

def get_options_greeks_by_contract_with_http_info(contract, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_greeks_by_contract ..."
  end
  # verify the required parameter 'contract' is set
  if @api_client.config.client_side_validation && contract.nil?
    fail ArgumentError, "Missing the required parameter 'contract' when calling OptionsApi.get_options_greeks_by_contract"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'model'] && !['black_scholes', 'bjerk'].include?(opts[:'model'])
    fail ArgumentError, 'invalid value for "model", must be one of black_scholes, bjerk'
  end
  if @api_client.config.client_side_validation && opts[:'iv_mode'] && !['out_of_the_money'].include?(opts[:'iv_mode'])
    fail ArgumentError, 'invalid value for "iv_mode", must be one of out_of_the_money'
  end
  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'nasdaq_basic', 'nasdaq_basic_last_sale', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'otc_delayed', 'delayed_sip', 'iex_delayed', 'cboe_one_delayed'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, nasdaq_basic, nasdaq_basic_last_sale, utp_delayed, cta_a_delayed, cta_b_delayed, otc_delayed, delayed_sip, iex_delayed, cboe_one_delayed'
  end
  # resource path
  local_var_path = "/options/greeks/{contract}/realtime".sub('{' + 'contract' + '}', contract.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
  query_params[:'iv_mode'] = opts[:'iv_mode'] if !opts[:'iv_mode'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsGreekContractRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_greeks_by_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_greeks_by_ticker(identifier, opts = {}) ⇒ ApiResponseOptionsGreeksByTickerRealtime

Options Realtime Greeks & Derived Price by Ticker Retrieves realtime options greeks data for all contracts of a given ticker symbol

Parameters:

  • identifier

    The ticker symbol to get options greeks for

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The data source to use for options data

  • :model (String)

    The options pricing model to use for greeks calculations (default to black_scholes)

  • :iv_mode (String)

    The implied volatility calculation mode

  • :stock_price_source (String)

    The data source to use for underlying stock prices

  • :expiration_start_date (Date)

    Filter options by expiration date (start)

  • :expiration_end_date (Date)

    Filter options by expiration date (end)

  • :strike (Float)

    Filter options by strike price

  • :strike_greater_than (Float)

    Filter options by minimum strike price

  • :strike_less_than (Float)

    Filter options by maximum strike price

  • :page_size (Integer)

    Number of results to return per page (default to 250)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



1194
1195
1196
1197
# File 'lib/intrinio-sdk/api/options_api.rb', line 1194

def get_options_greeks_by_ticker(identifier, opts = {})
  data, _status_code, _headers = get_options_greeks_by_ticker_with_http_info(identifier, opts)
  return data
end

#get_options_greeks_by_ticker_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionsGreeksByTickerRealtime, Fixnum, Hash)>

Options Realtime Greeks &amp; Derived Price by Ticker Retrieves realtime options greeks data for all contracts of a given ticker symbol

Parameters:

  • identifier

    The ticker symbol to get options greeks for

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    The data source to use for options data

  • :model (String)

    The options pricing model to use for greeks calculations

  • :iv_mode (String)

    The implied volatility calculation mode

  • :stock_price_source (String)

    The data source to use for underlying stock prices

  • :expiration_start_date (Date)

    Filter options by expiration date (start)

  • :expiration_end_date (Date)

    Filter options by expiration date (end)

  • :strike (Float)

    Filter options by strike price

  • :strike_greater_than (Float)

    Filter options by minimum strike price

  • :strike_less_than (Float)

    Filter options by maximum strike price

  • :page_size (Integer)

    Number of results to return per page

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
# File 'lib/intrinio-sdk/api/options_api.rb', line 1215

def get_options_greeks_by_ticker_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_greeks_by_ticker ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_options_greeks_by_ticker"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'model'] && !['black_scholes', 'bjerk'].include?(opts[:'model'])
    fail ArgumentError, 'invalid value for "model", must be one of black_scholes, bjerk'
  end
  if @api_client.config.client_side_validation && opts[:'iv_mode'] && !['out_of_the_money'].include?(opts[:'iv_mode'])
    fail ArgumentError, 'invalid value for "iv_mode", must be one of out_of_the_money'
  end
  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'nasdaq_basic', 'nasdaq_basic_last_sale', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'otc_delayed', 'delayed_sip', 'iex_delayed', 'cboe_one_delayed'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, nasdaq_basic, nasdaq_basic_last_sale, utp_delayed, cta_a_delayed, cta_b_delayed, otc_delayed, delayed_sip, iex_delayed, cboe_one_delayed'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 2500
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_greeks_by_ticker, must be smaller than or equal to 2500.'
  end

  # resource path
  local_var_path = "/options/greeks/by_ticker/{identifier}/realtime".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
  query_params[:'iv_mode'] = opts[:'iv_mode'] if !opts[:'iv_mode'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?
  query_params[:'expiration_start_date'] = opts[:'expiration_start_date'] if !opts[:'expiration_start_date'].nil?
  query_params[:'expiration_end_date'] = opts[:'expiration_end_date'] if !opts[:'expiration_end_date'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil?
  query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsGreeksByTickerRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_greeks_by_ticker\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_implied_move_by_symbol(symbol, expiration_date, opts = {}) ⇒ ApiResponseOptionsImpliedMove

Options Implied Move By Symbol Returns the implied move data points for a ticker symbol.

Parameters:

  • symbol

    The ticker symbol for the contracts.

  • expiration_date

    The expiration date for the contracts to consider.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :percentage (Object)

    Percentage to multiply the straddle by. Defaults to 0.85.

  • :source (String)

    Realtime or 15-minute delayed contracts.

Returns:



1288
1289
1290
1291
# File 'lib/intrinio-sdk/api/options_api.rb', line 1288

def get_options_implied_move_by_symbol(symbol, expiration_date, opts = {})
  data, _status_code, _headers = get_options_implied_move_by_symbol_with_http_info(symbol, expiration_date, opts)
  return data
end

#get_options_implied_move_by_symbol_with_http_info(symbol, expiration_date, opts = {}) ⇒ Array<(ApiResponseOptionsImpliedMove, Fixnum, Hash)>

Options Implied Move By Symbol Returns the implied move data points for a ticker symbol.

Parameters:

  • symbol

    The ticker symbol for the contracts.

  • expiration_date

    The expiration date for the contracts to consider.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :percentage (Object)

    Percentage to multiply the straddle by. Defaults to 0.85.

  • :source (String)

    Realtime or 15-minute delayed contracts.

Returns:



1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
# File 'lib/intrinio-sdk/api/options_api.rb', line 1301

def get_options_implied_move_by_symbol_with_http_info(symbol, expiration_date, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_implied_move_by_symbol ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_implied_move_by_symbol"
  end
  # verify the required parameter 'expiration_date' is set
  if @api_client.config.client_side_validation && expiration_date.nil?
    fail ArgumentError, "Missing the required parameter 'expiration_date' when calling OptionsApi.get_options_implied_move_by_symbol"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/implied_move/{symbol}/{expiration_date}".sub('{' + 'symbol' + '}', symbol.to_s).sub('{' + 'expiration_date' + '}', expiration_date.to_s)

  # query parameters
  query_params = {}
  query_params[:'percentage'] = opts[:'percentage'] if !opts[:'percentage'].nil?
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsImpliedMove')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_implied_move_by_symbol\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_interval_by_contract(identifier, interval_size, opts = {}) ⇒ OptionIntervalsResult

Options Intervals By Contract Returns a list of interval data points for a contract.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request intervals for.

  • interval_size

    The time length of the interval.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :end_time (DateTime)

    The inclusive UTC date and time the intervals end at.

Returns:



1357
1358
1359
1360
# File 'lib/intrinio-sdk/api/options_api.rb', line 1357

def get_options_interval_by_contract(identifier, interval_size, opts = {})
  data, _status_code, _headers = get_options_interval_by_contract_with_http_info(identifier, interval_size, opts)
  return data
end

#get_options_interval_by_contract_with_http_info(identifier, interval_size, opts = {}) ⇒ Array<(OptionIntervalsResult, Fixnum, Hash)>

Options Intervals By Contract Returns a list of interval data points for a contract.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request intervals for.

  • interval_size

    The time length of the interval.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :page_size (Integer)

    The number of results to return

  • :end_time (DateTime)

    The inclusive UTC date and time the intervals end at.

Returns:

  • (Array<(OptionIntervalsResult, Fixnum, Hash)>)

    OptionIntervalsResult data, response status code and response headers



1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
# File 'lib/intrinio-sdk/api/options_api.rb', line 1371

def get_options_interval_by_contract_with_http_info(identifier, interval_size, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_interval_by_contract ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_options_interval_by_contract"
  end
  # verify the required parameter 'interval_size' is set
  if @api_client.config.client_side_validation && interval_size.nil?
    fail ArgumentError, "Missing the required parameter 'interval_size' when calling OptionsApi.get_options_interval_by_contract"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['SixtyMinute', '60m', '1h', 'ThirtyMinute', '30m', 'FifteenMinute', '15m', 'TenMinute', '10m', 'FiveMinute', '5m', 'OneMinute', '1m'].include?(interval_size)
    fail ArgumentError, "invalid value for 'interval_size', must be one of SixtyMinute, 60m, 1h, ThirtyMinute, 30m, FifteenMinute, 15m, TenMinute, 10m, FiveMinute, 5m, OneMinute, 1m"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 300
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_interval_by_contract, must be smaller than or equal to 300.'
  end

  # resource path
  local_var_path = "/options/interval/{identifier}".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'interval_size'] = interval_size
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'end_time'] = opts[:'end_time'] if !opts[:'end_time'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OptionIntervalsResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_interval_by_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_interval_movers(opts = {}) ⇒ OptionIntervalsMoversResult

Options Intervals Movers Returns a list of intervals for the biggest movers over the last hour interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :open_time (DateTime)

    The inclusive UTC date and time the interval opens at.

Returns:



1434
1435
1436
1437
# File 'lib/intrinio-sdk/api/options_api.rb', line 1434

def get_options_interval_movers(opts = {})
  data, _status_code, _headers = get_options_interval_movers_with_http_info(opts)
  return data
end

#get_options_interval_movers_change(opts = {}) ⇒ OptionIntervalsMoversResult

Options Intervals Movers By Change Returns a list of intervals for the biggest movers by change over the last hour interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :open_time (DateTime)

    The inclusive UTC date and time the interval opens at.

Returns:



1490
1491
1492
1493
# File 'lib/intrinio-sdk/api/options_api.rb', line 1490

def get_options_interval_movers_change(opts = {})
  data, _status_code, _headers = get_options_interval_movers_change_with_http_info(opts)
  return data
end

#get_options_interval_movers_change_with_http_info(opts = {}) ⇒ Array<(OptionIntervalsMoversResult, Fixnum, Hash)>

Options Intervals Movers By Change Returns a list of intervals for the biggest movers by change over the last hour interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :open_time (DateTime)

    The inclusive UTC date and time the interval opens at.

Returns:



1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
# File 'lib/intrinio-sdk/api/options_api.rb', line 1501

def get_options_interval_movers_change_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_interval_movers_change ..."
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/interval/movers/change"

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'open_time'] = opts[:'open_time'] if !opts[:'open_time'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OptionIntervalsMoversResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_interval_movers_change\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_interval_movers_volume(opts = {}) ⇒ OptionIntervalsMoversResult

Options Intervals Movers By Volume Returns a list of intervals for the biggest movers by volume over the last hour interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :open_time (DateTime)

    The inclusive UTC date and time the interval opens at.

Returns:



1546
1547
1548
1549
# File 'lib/intrinio-sdk/api/options_api.rb', line 1546

def get_options_interval_movers_volume(opts = {})
  data, _status_code, _headers = get_options_interval_movers_volume_with_http_info(opts)
  return data
end

#get_options_interval_movers_volume_with_http_info(opts = {}) ⇒ Array<(OptionIntervalsMoversResult, Fixnum, Hash)>

Options Intervals Movers By Volume Returns a list of intervals for the biggest movers by volume over the last hour interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :open_time (DateTime)

    The inclusive UTC date and time the interval opens at.

Returns:



1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
# File 'lib/intrinio-sdk/api/options_api.rb', line 1557

def get_options_interval_movers_volume_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_interval_movers_volume ..."
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/interval/movers/volume"

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'open_time'] = opts[:'open_time'] if !opts[:'open_time'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OptionIntervalsMoversResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_interval_movers_volume\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_interval_movers_with_http_info(opts = {}) ⇒ Array<(OptionIntervalsMoversResult, Fixnum, Hash)>

Options Intervals Movers Returns a list of intervals for the biggest movers over the last hour interval.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :open_time (DateTime)

    The inclusive UTC date and time the interval opens at.

Returns:



1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
# File 'lib/intrinio-sdk/api/options_api.rb', line 1445

def get_options_interval_movers_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_interval_movers ..."
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/interval/movers"

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'open_time'] = opts[:'open_time'] if !opts[:'open_time'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OptionIntervalsMoversResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_interval_movers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_losers(mode, opts = {}) ⇒ ApiResponseOptionMovers

Options Top Losers Returns a list of top losers since last close.

Parameters:

  • mode

    Which metric to sort by - change, percent change, or volume.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



1602
1603
1604
1605
# File 'lib/intrinio-sdk/api/options_api.rb', line 1602

def get_options_losers(mode, opts = {})
  data, _status_code, _headers = get_options_losers_with_http_info(mode, opts)
  return data
end

#get_options_losers_with_http_info(mode, opts = {}) ⇒ Array<(ApiResponseOptionMovers, Fixnum, Hash)>

Options Top Losers Returns a list of top losers since last close.

Parameters:

  • mode

    Which metric to sort by - change, percent change, or volume.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseOptionMovers, Fixnum, Hash)>)

    ApiResponseOptionMovers data, response status code and response headers



1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
# File 'lib/intrinio-sdk/api/options_api.rb', line 1613

def get_options_losers_with_http_info(mode, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_losers ..."
  end
  # verify the required parameter 'mode' is set
  if @api_client.config.client_side_validation && mode.nil?
    fail ArgumentError, "Missing the required parameter 'mode' when calling OptionsApi.get_options_losers"
  end
  # verify enum value
  if @api_client.config.client_side_validation && !['change', 'percent_change', 'volume'].include?(mode)
    fail ArgumentError, "invalid value for 'mode', must be one of change, percent_change, volume"
  end
  # resource path
  local_var_path = "/options/losers"

  # query parameters
  query_params = {}
  query_params[:'mode'] = mode
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionMovers')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_losers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_prices(identifier, opts = {}) ⇒ ApiResponseOptionPrices

Option Prices Returns all price data from inception to expiration for a particular contract.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :start_date (String)

    Return option contract prices on or after this date.

  • :end_date (String)

    Return option contract prices on or before this date.

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



1666
1667
1668
1669
# File 'lib/intrinio-sdk/api/options_api.rb', line 1666

def get_options_prices(identifier, opts = {})
  data, _status_code, _headers = get_options_prices_with_http_info(identifier, opts)
  return data
end

#get_options_prices_batch_realtime(body, opts = {}) ⇒ ApiResponseOptionsPricesBatchRealtime

Option Prices Batch Realtime Returns a list of latest price data for up to 250 option contracts per request.

Parameters:

  • body

    The contract symbols for which to return options prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :show_stats (BOOLEAN)

    Whether to include Greek calculations or not.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

Returns:



1736
1737
1738
1739
# File 'lib/intrinio-sdk/api/options_api.rb', line 1736

def get_options_prices_batch_realtime(body, opts = {})
  data, _status_code, _headers = get_options_prices_batch_realtime_with_http_info(body, opts)
  return data
end

#get_options_prices_batch_realtime_with_http_info(body, opts = {}) ⇒ Array<(ApiResponseOptionsPricesBatchRealtime, Fixnum, Hash)>

Option Prices Batch Realtime Returns a list of latest price data for up to 250 option contracts per request.

Parameters:

  • body

    The contract symbols for which to return options prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :show_stats (BOOLEAN)

    Whether to include Greek calculations or not.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

Returns:



1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
# File 'lib/intrinio-sdk/api/options_api.rb', line 1751

def get_options_prices_batch_realtime_with_http_info(body, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_prices_batch_realtime ..."
  end
  # verify the required parameter 'body' is set
  if @api_client.config.client_side_validation && body.nil?
    fail ArgumentError, "Missing the required parameter 'body' when calling OptionsApi.get_options_prices_batch_realtime"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'delayed_sip', 'utp_delayed', 'otc_delayed', 'cta_a_delayed', 'cta_b_delayed', 'nasdaq_basic', 'iex_delayed', 'cboe_one_delayed'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, delayed_sip, utp_delayed, otc_delayed, cta_a_delayed, cta_b_delayed, nasdaq_basic, iex_delayed, cboe_one_delayed'
  end
  if @api_client.config.client_side_validation && opts[:'model'] && !['black_scholes', 'bjerk'].include?(opts[:'model'])
    fail ArgumentError, 'invalid value for "model", must be one of black_scholes, bjerk'
  end
  # resource path
  local_var_path = "/options/prices/realtime/batch"

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'show_stats'] = opts[:'show_stats'] if !opts[:'show_stats'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
  query_params[:'show_extended_price'] = opts[:'show_extended_price'] if !opts[:'show_extended_price'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = @api_client.object_to_http_body(body)
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:POST, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsPricesBatchRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_prices_batch_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_prices_eod(identifier, opts = {}) ⇒ ApiResponseOptionsPricesEod

Option Prices EOD Returns all option prices for a given option contract identifier.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :start_date (Date)

    The start date to retrieve prices for

  • :end_date (Date)

    The end date to retrieve prices for

Returns:



1813
1814
1815
1816
# File 'lib/intrinio-sdk/api/options_api.rb', line 1813

def get_options_prices_eod(identifier, opts = {})
  data, _status_code, _headers = get_options_prices_eod_with_http_info(identifier, opts)
  return data
end

#get_options_prices_eod_by_ticker(symbol, opts = {}) ⇒ ApiResponseOptionsPricesByTickerEod

Option Prices End of Day By Ticker Returns a list of end of day pricing information for all option contracts currently associated with the ticker.

Parameters:

  • symbol

    The equities ticker symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of results to return (default to 250)

  • :date (Object)

    The date to get pricing data for. Defaults to today in Eastern time zone.

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



1880
1881
1882
1883
# File 'lib/intrinio-sdk/api/options_api.rb', line 1880

def get_options_prices_eod_by_ticker(symbol, opts = {})
  data, _status_code, _headers = get_options_prices_eod_by_ticker_with_http_info(symbol, opts)
  return data
end

#get_options_prices_eod_by_ticker_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsPricesByTickerEod, Fixnum, Hash)>

Option Prices End of Day By Ticker Returns a list of end of day pricing information for all option contracts currently associated with the ticker.

Parameters:

  • symbol

    The equities ticker symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of results to return

  • :date (Object)

    The date to get pricing data for. Defaults to today in Eastern time zone.

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :include_related_symbols (BOOLEAN)

    Include related symbols that end in a 1 or 2 because of a corporate action.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
# File 'lib/intrinio-sdk/api/options_api.rb', line 1898

def get_options_prices_eod_by_ticker_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_prices_eod_by_ticker ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_prices_eod_by_ticker"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_prices_eod_by_ticker, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of call, put'
  end
  # resource path
  local_var_path = "/options/prices/by_ticker/{symbol}/eod".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil?
  query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil?
  query_params[:'include_related_symbols'] = opts[:'include_related_symbols'] if !opts[:'include_related_symbols'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsPricesByTickerEod')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_prices_eod_by_ticker\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_prices_eod_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionsPricesEod, Fixnum, Hash)>

Option Prices EOD Returns all option prices for a given option contract identifier.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :start_date (Date)

    The start date to retrieve prices for

  • :end_date (Date)

    The end date to retrieve prices for

Returns:



1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
# File 'lib/intrinio-sdk/api/options_api.rb', line 1826

def get_options_prices_eod_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_prices_eod ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_options_prices_eod"
  end
  # resource path
  local_var_path = "/options/prices/{identifier}/eod".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsPricesEod')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_prices_eod\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_prices_realtime(identifier, opts = {}) ⇒ ApiResponseOptionsPriceRealtime

Option Prices Realtime Returns all option prices for a given option contract identifier.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

Returns:



1960
1961
1962
1963
# File 'lib/intrinio-sdk/api/options_api.rb', line 1960

def get_options_prices_realtime(identifier, opts = {})
  data, _status_code, _headers = get_options_prices_realtime_with_http_info(identifier, opts)
  return data
end

#get_options_prices_realtime_by_ticker(symbol, opts = {}) ⇒ ApiResponseOptionsPricesByTickerRealtime

Option Prices Realtime By Ticker Returns a list of the latest National Best Bid & Offer (NBBO) top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all option contracts currently associated with the ticker.

Parameters:

  • symbol

    The equities ticker symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :iv_mode (String)

    Change the mode for the implied volatility calculation to out of the money.

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :page_size (Integer)

    The number of results to return (default to 250)

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

  • :expiration_start_date (Object)

    Filter out contracts that expire before this date.

  • :expiration_end_date (Object)

    Filter out contracts that expire after this date.

  • :strike (Float)

    Filter out contracts that have this strike price.

  • :show_stats (BOOLEAN)

    Whether to include Greek calculations or not.

  • :next_page2 (String)

    Gets the next page of data from a previous API call

Returns:



2042
2043
2044
2045
# File 'lib/intrinio-sdk/api/options_api.rb', line 2042

def get_options_prices_realtime_by_ticker(symbol, opts = {})
  data, _status_code, _headers = get_options_prices_realtime_by_ticker_with_http_info(symbol, opts)
  return data
end

#get_options_prices_realtime_by_ticker_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsPricesByTickerRealtime, Fixnum, Hash)>

Option Prices Realtime By Ticker Returns a list of the latest National Best Bid &amp; Offer (NBBO) top of the order book size and premium (bid / ask), the latest trade size and premium as well as the greeks and implied volatility for all option contracts currently associated with the ticker.

Parameters:

  • symbol

    The equities ticker symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :iv_mode (String)

    Change the mode for the implied volatility calculation to out of the money.

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :page_size (Integer)

    The number of results to return

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

  • :expiration_start_date (Object)

    Filter out contracts that expire before this date.

  • :expiration_end_date (Object)

    Filter out contracts that expire after this date.

  • :strike (Float)

    Filter out contracts that have this strike price.

  • :show_stats (BOOLEAN)

    Whether to include Greek calculations or not.

  • :next_page2 (String)

    Gets the next page of data from a previous API call

Returns:



2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
# File 'lib/intrinio-sdk/api/options_api.rb', line 2064

def get_options_prices_realtime_by_ticker_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_prices_realtime_by_ticker ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options_prices_realtime_by_ticker"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'iv_mode'] && !['out_of_the_money'].include?(opts[:'iv_mode'])
    fail ArgumentError, 'invalid value for "iv_mode", must be one of out_of_the_money'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_prices_realtime_by_ticker, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'delayed_sip', 'utp_delayed', 'otc_delayed', 'cta_a_delayed', 'cta_b_delayed', 'nasdaq_basic', 'cboe_one_delayed', 'iex_delayed'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, delayed_sip, utp_delayed, otc_delayed, cta_a_delayed, cta_b_delayed, nasdaq_basic, cboe_one_delayed, iex_delayed'
  end
  if @api_client.config.client_side_validation && opts[:'model'] && !['black_scholes', 'bjerk'].include?(opts[:'model'])
    fail ArgumentError, 'invalid value for "model", must be one of black_scholes, bjerk'
  end
  # resource path
  local_var_path = "/options/prices/by_ticker/{symbol}/realtime".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'iv_mode'] = opts[:'iv_mode'] if !opts[:'iv_mode'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
  query_params[:'show_extended_price'] = opts[:'show_extended_price'] if !opts[:'show_extended_price'].nil?
  query_params[:'expiration_start_date'] = opts[:'expiration_start_date'] if !opts[:'expiration_start_date'].nil?
  query_params[:'expiration_end_date'] = opts[:'expiration_end_date'] if !opts[:'expiration_end_date'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'show_stats'] = opts[:'show_stats'] if !opts[:'show_stats'].nil?
  query_params[:'next_page'] = opts[:'next_page2'] if !opts[:'next_page2'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsPricesByTickerRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_prices_realtime_by_ticker\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_prices_realtime_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionsPriceRealtime, Fixnum, Hash)>

Option Prices Realtime Returns all option prices for a given option contract identifier.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :model (String)

    Model for calculating Greek values. Default is black_scholes.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

Returns:



1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
# File 'lib/intrinio-sdk/api/options_api.rb', line 1974

def get_options_prices_realtime_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_prices_realtime ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_options_prices_realtime"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'delayed_sip', 'utp_delayed', 'otc_delayed', 'cta_a_delayed', 'cta_b_delayed', 'nasdaq_basic', 'cboe_one_delayed', 'iex_delayed'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, delayed_sip, utp_delayed, otc_delayed, cta_a_delayed, cta_b_delayed, nasdaq_basic, cboe_one_delayed, iex_delayed'
  end
  if @api_client.config.client_side_validation && opts[:'model'] && !['black_scholes', 'bjerk'].include?(opts[:'model'])
    fail ArgumentError, 'invalid value for "model", must be one of black_scholes, bjerk'
  end
  # resource path
  local_var_path = "/options/prices/{identifier}/realtime".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?
  query_params[:'model'] = opts[:'model'] if !opts[:'model'].nil?
  query_params[:'show_extended_price'] = opts[:'show_extended_price'] if !opts[:'show_extended_price'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsPriceRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_prices_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionPrices, Fixnum, Hash)>

Option Prices Returns all price data from inception to expiration for a particular contract.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :start_date (String)

    Return option contract prices on or after this date.

  • :end_date (String)

    Return option contract prices on or before this date.

  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseOptionPrices, Fixnum, Hash)>)

    ApiResponseOptionPrices data, response status code and response headers



1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
# File 'lib/intrinio-sdk/api/options_api.rb', line 1680

def get_options_prices_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_prices ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_options_prices"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options_prices, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = "/options/prices/{identifier}".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionPrices')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_snapshots(opts = {}) ⇒ OptionSnapshotsResult

Option Prices Realtime Snapshot Returns all options snapshots for the queried interval with links to download.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :at_datetime (DateTime)

    The UTC date and time (with url-encoded spaces) the snapshot will cover.

  • :with_greeks (BOOLEAN)

    Whether to include Greek calculations fields when available.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :with_underlying_price (BOOLEAN)

    Whether to include the underlying price of the security in the file.

Returns:



2139
2140
2141
2142
# File 'lib/intrinio-sdk/api/options_api.rb', line 2139

def get_options_snapshots(opts = {})
  data, _status_code, _headers = get_options_snapshots_with_http_info(opts)
  return data
end

#get_options_snapshots_with_http_info(opts = {}) ⇒ Array<(OptionSnapshotsResult, Fixnum, Hash)>

Option Prices Realtime Snapshot Returns all options snapshots for the queried interval with links to download.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :at_datetime (DateTime)

    The UTC date and time (with url-encoded spaces) the snapshot will cover.

  • :with_greeks (BOOLEAN)

    Whether to include Greek calculations fields when available.

  • :stock_price_source (String)

    Source for underlying price for calculating Greeks.

  • :with_underlying_price (BOOLEAN)

    Whether to include the underlying price of the security in the file.

Returns:

  • (Array<(OptionSnapshotsResult, Fixnum, Hash)>)

    OptionSnapshotsResult data, response status code and response headers



2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
# File 'lib/intrinio-sdk/api/options_api.rb', line 2153

def get_options_snapshots_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_snapshots ..."
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  if @api_client.config.client_side_validation && opts[:'stock_price_source'] && !['iex', 'nasdaq_basic', 'nasdaq_basic_last_sale'].include?(opts[:'stock_price_source'])
    fail ArgumentError, 'invalid value for "stock_price_source", must be one of iex, nasdaq_basic, nasdaq_basic_last_sale'
  end
  # resource path
  local_var_path = "/options/snapshots"

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'at_datetime'] = opts[:'at_datetime'] if !opts[:'at_datetime'].nil?
  query_params[:'with_greeks'] = opts[:'with_greeks'] if !opts[:'with_greeks'].nil?
  query_params[:'stock_price_source'] = opts[:'stock_price_source'] if !opts[:'stock_price_source'].nil?
  query_params[:'with_underlying_price'] = opts[:'with_underlying_price'] if !opts[:'with_underlying_price'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'OptionSnapshotsResult')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_snapshots\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_stats_realtime(identifier, opts = {}) ⇒ ApiResponseOptionsStatsRealtime

Option Stats Realtime Returns all option stats (greeks and implied volatility) as well as the underlying factors used to calculate them, for a particular option contract.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

Returns:



2205
2206
2207
2208
# File 'lib/intrinio-sdk/api/options_api.rb', line 2205

def get_options_stats_realtime(identifier, opts = {})
  data, _status_code, _headers = get_options_stats_realtime_with_http_info(identifier, opts)
  return data
end

#get_options_stats_realtime_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionsStatsRealtime, Fixnum, Hash)>

Option Stats Realtime Returns all option stats (greeks and implied volatility) as well as the underlying factors used to calculate them, for a particular option contract.

Parameters:

  • identifier

    The Intrinio ID or code of the options contract to request prices for.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

  • :show_extended_price (BOOLEAN)

    Whether to include open close high low type fields.

Returns:



2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
# File 'lib/intrinio-sdk/api/options_api.rb', line 2217

def get_options_stats_realtime_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options_stats_realtime ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling OptionsApi.get_options_stats_realtime"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/prices/{identifier}/realtime/stats".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?
  query_params[:'show_extended_price'] = opts[:'show_extended_price'] if !opts[:'show_extended_price'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsStatsRealtime')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options_stats_realtime\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_options_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptions, Fixnum, Hash)>

Options Returns a list of all securities that have options listed and are tradable on a US market exchange. Useful to retrieve the entire universe. Available via a 3rd party, contact sales for a trial.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :type (String)

    The option contract type.

  • :strike (Float)

    The strike price of the option contract. This will return options contracts with strike price equal to this price.

  • :strike_greater_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices greater than this price.

  • :strike_less_than (Float)

    The strike price of the option contract. This will return options contracts with strike prices less than this price.

  • :expiration (String)

    The expiration date of the option contract. This will return options contracts with expiration dates on this date.

  • :expiration_after (String)

    The expiration date of the option contract. This will return options contracts with expiration dates after this date.

  • :expiration_before (String)

    The expiration date of the option contract. This will return options contracts with expiration dates before this date.

  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseOptions, Fixnum, Hash)>)

    ApiResponseOptions data, response status code and response headers



490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
# File 'lib/intrinio-sdk/api/options_api.rb', line 490

def get_options_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_options ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_options"
  end
  if @api_client.config.client_side_validation && opts[:'type'] && !['call', 'put'].include?(opts[:'type'])
    fail ArgumentError, 'invalid value for "type", must be one of call, put'
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_options, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = "/options/{symbol}".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?
  query_params[:'strike'] = opts[:'strike'] if !opts[:'strike'].nil?
  query_params[:'strike_greater_than'] = opts[:'strike_greater_than'] if !opts[:'strike_greater_than'].nil?
  query_params[:'strike_less_than'] = opts[:'strike_less_than'] if !opts[:'strike_less_than'].nil?
  query_params[:'expiration'] = opts[:'expiration'] if !opts[:'expiration'].nil?
  query_params[:'expiration_after'] = opts[:'expiration_after'] if !opts[:'expiration_after'].nil?
  query_params[:'expiration_before'] = opts[:'expiration_before'] if !opts[:'expiration_before'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptions')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_options\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_unusual_activity(symbol, opts = {}) ⇒ ApiResponseOptionsUnusualActivity

Options Unusual Activity Returns unusual options activity for a particular company across all option chains. Unusual options activity includes large trades, sweeps, and block trades.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

Returns:



2266
2267
2268
2269
# File 'lib/intrinio-sdk/api/options_api.rb', line 2266

def get_unusual_activity(symbol, opts = {})
  data, _status_code, _headers = get_unusual_activity_with_http_info(symbol, opts)
  return data
end

#get_unusual_activity_intraday(symbol, opts = {}) ⇒ ApiResponseOptionsUnusualActivity

Options Unusual Activity Intraday Returns unusual trades for a given identifier within the query parameters.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :page_size (Integer)

    The number of results to return (default to 1000)

  • :activity_type (String)

    The unusual activity type to query for.

  • :sentiment (String)

    The sentiment type to query for.

  • :start_date (Date)

    Return unusual activity on or after this date.

  • :end_date (Date)

    Return unusual activity before this date.

  • :minimum_total_value (Object)

    The inclusive minimum total value for the unusual activity.

  • :maximum_total_value (Object)

    The inclusive maximum total value for the unusual activity.

Returns:



2332
2333
2334
2335
# File 'lib/intrinio-sdk/api/options_api.rb', line 2332

def get_unusual_activity_intraday(symbol, opts = {})
  data, _status_code, _headers = get_unusual_activity_intraday_with_http_info(symbol, opts)
  return data
end

#get_unusual_activity_intraday_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsUnusualActivity, Fixnum, Hash)>

Options Unusual Activity Intraday Returns unusual trades for a given identifier within the query parameters.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :page_size (Integer)

    The number of results to return

  • :activity_type (String)

    The unusual activity type to query for.

  • :sentiment (String)

    The sentiment type to query for.

  • :start_date (Date)

    Return unusual activity on or after this date.

  • :end_date (Date)

    Return unusual activity before this date.

  • :minimum_total_value (Object)

    The inclusive minimum total value for the unusual activity.

  • :maximum_total_value (Object)

    The inclusive maximum total value for the unusual activity.

Returns:



2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
# File 'lib/intrinio-sdk/api/options_api.rb', line 2350

def get_unusual_activity_intraday_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_unusual_activity_intraday ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_unusual_activity_intraday"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_unusual_activity_intraday, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && opts[:'activity_type'] && !['block', 'sweep', 'large'].include?(opts[:'activity_type'])
    fail ArgumentError, 'invalid value for "activity_type", must be one of block, sweep, large'
  end
  if @api_client.config.client_side_validation && opts[:'sentiment'] && !['bullish', 'bearish', 'neutral'].include?(opts[:'sentiment'])
    fail ArgumentError, 'invalid value for "sentiment", must be one of bullish, bearish, neutral'
  end
  # resource path
  local_var_path = "/options/unusual_activity/{symbol}/intraday".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'activity_type'] = opts[:'activity_type'] if !opts[:'activity_type'].nil?
  query_params[:'sentiment'] = opts[:'sentiment'] if !opts[:'sentiment'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'minimum_total_value'] = opts[:'minimum_total_value'] if !opts[:'minimum_total_value'].nil?
  query_params[:'maximum_total_value'] = opts[:'maximum_total_value'] if !opts[:'maximum_total_value'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsUnusualActivity')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_unusual_activity_intraday\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_unusual_activity_universal(opts = {}) ⇒ ApiResponseOptionsUnusualActivity

Options Unusual Activity Universal Returns the latest unusual options activity across all US companies with across all option chains. Unusual options activity includes large trades, sweeps, and block trades.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

Returns:



2411
2412
2413
2414
# File 'lib/intrinio-sdk/api/options_api.rb', line 2411

def get_unusual_activity_universal(opts = {})
  data, _status_code, _headers = get_unusual_activity_universal_with_http_info(opts)
  return data
end

#get_unusual_activity_universal_intraday(opts = {}) ⇒ ApiResponseOptionsUnusualActivity

Options Unusual Activity Universal Intraday Returns unusual trades for all underlying security symbols within the query parameters.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :page_size (Integer)

    The number of results to return (default to 1000)

  • :activity_type (String)

    The unusual activity type to query for.

  • :sentiment (String)

    The sentiment type to query for.

  • :start_date (Date)

    Return unusual activity on or after this date.

  • :end_date (Date)

    Return unusual activity before this date.

  • :minimum_total_value (Object)

    The inclusive minimum total value for the unusual activity.

  • :maximum_total_value (Object)

    The inclusive maximum total value for the unusual activity.

Returns:



2471
2472
2473
2474
# File 'lib/intrinio-sdk/api/options_api.rb', line 2471

def get_unusual_activity_universal_intraday(opts = {})
  data, _status_code, _headers = get_unusual_activity_universal_intraday_with_http_info(opts)
  return data
end

#get_unusual_activity_universal_intraday_with_http_info(opts = {}) ⇒ Array<(ApiResponseOptionsUnusualActivity, Fixnum, Hash)>

Options Unusual Activity Universal Intraday Returns unusual trades for all underlying security symbols within the query parameters.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :page_size (Integer)

    The number of results to return

  • :activity_type (String)

    The unusual activity type to query for.

  • :sentiment (String)

    The sentiment type to query for.

  • :start_date (Date)

    Return unusual activity on or after this date.

  • :end_date (Date)

    Return unusual activity before this date.

  • :minimum_total_value (Object)

    The inclusive minimum total value for the unusual activity.

  • :maximum_total_value (Object)

    The inclusive maximum total value for the unusual activity.

Returns:



2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
# File 'lib/intrinio-sdk/api/options_api.rb', line 2488

def get_unusual_activity_universal_intraday_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_unusual_activity_universal_intraday ..."
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling OptionsApi.get_unusual_activity_universal_intraday, must be smaller than or equal to 1000.'
  end

  if @api_client.config.client_side_validation && opts[:'activity_type'] && !['block', 'sweep', 'large'].include?(opts[:'activity_type'])
    fail ArgumentError, 'invalid value for "activity_type", must be one of block, sweep, large'
  end
  if @api_client.config.client_side_validation && opts[:'sentiment'] && !['bullish', 'bearish', 'neutral'].include?(opts[:'sentiment'])
    fail ArgumentError, 'invalid value for "sentiment", must be one of bullish, bearish, neutral'
  end
  # resource path
  local_var_path = "/options/unusual_activity/intraday"

  # query parameters
  query_params = {}
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'activity_type'] = opts[:'activity_type'] if !opts[:'activity_type'].nil?
  query_params[:'sentiment'] = opts[:'sentiment'] if !opts[:'sentiment'].nil?
  query_params[:'start_date'] = opts[:'start_date'] if !opts[:'start_date'].nil?
  query_params[:'end_date'] = opts[:'end_date'] if !opts[:'end_date'].nil?
  query_params[:'minimum_total_value'] = opts[:'minimum_total_value'] if !opts[:'minimum_total_value'].nil?
  query_params[:'maximum_total_value'] = opts[:'maximum_total_value'] if !opts[:'maximum_total_value'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsUnusualActivity')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_unusual_activity_universal_intraday\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_unusual_activity_universal_with_http_info(opts = {}) ⇒ Array<(ApiResponseOptionsUnusualActivity, Fixnum, Hash)>

Options Unusual Activity Universal Returns the latest unusual options activity across all US companies with across all option chains. Unusual options activity includes large trades, sweeps, and block trades.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

Returns:



2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
# File 'lib/intrinio-sdk/api/options_api.rb', line 2421

def get_unusual_activity_universal_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_unusual_activity_universal ..."
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/unusual_activity"

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsUnusualActivity')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_unusual_activity_universal\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_unusual_activity_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsUnusualActivity, Fixnum, Hash)>

Options Unusual Activity Returns unusual options activity for a particular company across all option chains. Unusual options activity includes large trades, sweeps, and block trades.

Parameters:

  • symbol

    The option symbol, corresponding to the underlying security.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :source (String)

    Realtime or 15-minute delayed contracts.

Returns:



2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
# File 'lib/intrinio-sdk/api/options_api.rb', line 2277

def get_unusual_activity_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: OptionsApi.get_unusual_activity ..."
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling OptionsApi.get_unusual_activity"
  end
  if @api_client.config.client_side_validation && opts[:'source'] && !['realtime', 'delayed'].include?(opts[:'source'])
    fail ArgumentError, 'invalid value for "source", must be one of realtime, delayed'
  end
  # resource path
  local_var_path = "/options/unusual_activity/{symbol}".sub('{' + 'symbol' + '}', symbol.to_s)

  # query parameters
  query_params = {}
  query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseOptionsUnusualActivity')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: OptionsApi#get_unusual_activity\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end