Class: Intrinio::OptionsApi
- Inherits:
-
Object
- Object
- Intrinio::OptionsApi
- Defined in:
- lib/intrinio-sdk/api/options_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#get_options(symbol, opts = {}) ⇒ ApiResponseOptions
Options Returns the master list of option contracts for a given symbol.
-
#get_options_chain(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChain
Options Chain Returns all options contracts and their prices for the given symbol and expiration date.
-
#get_options_chain_realtime(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChainRealtime
Options Chain Realtime Returns all realtime options contracts and their prices for the given symbol and expiration date.
-
#get_options_chain_realtime_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChainRealtime, Fixnum, Hash)>
Options Chain Realtime Returns all realtime options contracts and their prices for the given symbol and expiration date.
-
#get_options_chain_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChain, Fixnum, Hash)>
Options Chain Returns all options contracts and their prices for the given symbol and expiration date.
-
#get_options_expirations(symbol, opts = {}) ⇒ ApiResponseOptionsExpirations
Options Expirations Returns all option contract expiration dates for a given symbol.
-
#get_options_expirations_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsExpirations, Fixnum, Hash)>
Options Expirations Returns all option contract expiration dates for a given symbol.
-
#get_options_prices(identifier, opts = {}) ⇒ ApiResponseOptionPrices
Option Prices Returns all option prices for a given option contract identifier.
-
#get_options_prices_realtime(identifier, opts = {}) ⇒ ApiResponseOptionsPriceRealtime
Option Prices Realtime Returns all option prices for a given option contract identifier.
-
#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.
-
#get_options_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionPrices, Fixnum, Hash)>
Option Prices Returns all option prices for a given option contract identifier.
-
#get_options_stats_realtime(identifier, opts = {}) ⇒ ApiResponseOptionsStatsRealtime
Option Stats Realtime Returns all option stats (greeks and implied volatility) and factors used to calculate them, for a given option contract identifier.
-
#get_options_stats_realtime_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseOptionsStatsRealtime, Fixnum, Hash)>
Option Stats Realtime Returns all option stats (greeks and implied volatility) and factors used to calculate them, for a given option contract identifier.
-
#get_options_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptions, Fixnum, Hash)>
Options Returns the master list of option contracts for a given symbol.
-
#initialize(api_client = ApiClient.default) ⇒ OptionsApi
constructor
A new instance of OptionsApi.
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_client ⇒ Object
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_options(symbol, opts = {}) ⇒ ApiResponseOptions
Options Returns the master list of option contracts for a given symbol.
37 38 39 40 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 37 def (symbol, opts = {}) data, _status_code, _headers = (symbol, opts) return data end |
#get_options_chain(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChain
Options Chain Returns all options contracts and their prices for the given symbol and expiration date.
123 124 125 126 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 123 def (symbol, expiration, opts = {}) data, _status_code, _headers = (symbol, expiration, opts) return data end |
#get_options_chain_realtime(symbol, expiration, opts = {}) ⇒ ApiResponseOptionsChainRealtime
Options Chain Realtime Returns all realtime options contracts and their prices for the given symbol and expiration date.
216 217 218 219 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 216 def (symbol, expiration, opts = {}) data, _status_code, _headers = (symbol, expiration, opts) return data end |
#get_options_chain_realtime_with_http_info(symbol, expiration, opts = {}) ⇒ Array<(ApiResponseOptionsChainRealtime, Fixnum, Hash)>
Options Chain Realtime Returns all realtime options contracts and their prices for the given symbol and expiration date.
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 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 237 def (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 # 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? # 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 all options contracts and their prices for the given symbol and expiration date.
141 142 143 144 145 146 147 148 149 150 151 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 196 197 198 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 141 def (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 all option contract expiration dates for a given symbol.
305 306 307 308 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 305 def (symbol, opts = {}) data, _status_code, _headers = (symbol, opts) return data end |
#get_options_expirations_with_http_info(symbol, opts = {}) ⇒ Array<(ApiResponseOptionsExpirations, Fixnum, Hash)>
Options Expirations Returns all option contract expiration dates for a given symbol.
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 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 317 def (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_prices(identifier, opts = {}) ⇒ ApiResponseOptionPrices
Option Prices Returns all option prices for a given option contract identifier.
366 367 368 369 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 366 def (identifier, opts = {}) data, _status_code, _headers = (identifier, opts) return data end |
#get_options_prices_realtime(identifier, opts = {}) ⇒ ApiResponseOptionsPriceRealtime
Option Prices Realtime Returns all option prices for a given option contract identifier.
432 433 434 435 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 432 def (identifier, opts = {}) data, _status_code, _headers = (identifier, opts) return data 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.
443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 443 def (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 # 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? # 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 option prices for a given option contract identifier.
380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 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 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 380 def (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_stats_realtime(identifier, opts = {}) ⇒ ApiResponseOptionsStatsRealtime
Option Stats Realtime Returns all option stats (greeks and implied volatility) and factors used to calculate them, for a given option contract identifier.
491 492 493 494 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 491 def (identifier, opts = {}) data, _status_code, _headers = (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) and factors used to calculate them, for a given option contract identifier.
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 502 def (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? # 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 the master list of option contracts for a given symbol.
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
# File 'lib/intrinio-sdk/api/options_api.rb', line 56 def (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 |