=begin #Intrinio API #Welcome to the Intrinio API! Through our Financial Data Marketplace, we offer a wide selection of financial data feed APIs sourced by our own proprietary processes as well as from many data vendors. For a complete API request / response reference please view the [Intrinio API documentation](https://docs.intrinio.com/documentation/api_v2). If you need additional help in using the API, please visit the [Intrinio website](https://intrinio.com) and click on the chat icon in the lower right corner. OpenAPI spec version: 2.75.0 Generated by: https://github.com/swagger-api/swagger-codegen.git Swagger Codegen version: unset =end require "uri" module Intrinio class StockExchangeApi attr_accessor :api_client def initialize(api_client = ApiClient.default) @api_client = api_client end # All Stock Exchanges # Returns all Stock Exchanges matching the specified parameters # @param [Hash] opts the optional parameters # @option opts [String] :city Filter by city # @option opts [String] :country Filter by country # @option opts [String] :country_code Filter by ISO country code # @option opts [Integer] :page_size The number of results to return (default to 100) # @return [ApiResponseStockExchanges] def get_all_stock_exchanges(opts = {}) data, _status_code, _headers = get_all_stock_exchanges_with_http_info(opts) return data end # All Stock Exchanges # Returns all Stock Exchanges matching the specified parameters # @param [Hash] opts the optional parameters # @option opts [String] :city Filter by city # @option opts [String] :country Filter by country # @option opts [String] :country_code Filter by ISO country code # @option opts [Integer] :page_size The number of results to return # @return [Array<(ApiResponseStockExchanges, Fixnum, Hash)>] ApiResponseStockExchanges data, response status code and response headers def get_all_stock_exchanges_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_all_stock_exchanges ..." 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 StockExchangeApi.get_all_stock_exchanges, must be smaller than or equal to 10000.' end # resource path local_var_path = "/stock_exchanges" # query parameters query_params = {} query_params[:'city'] = opts[:'city'] if !opts[:'city'].nil? query_params[:'country'] = opts[:'country'] if !opts[:'country'].nil? query_params[:'country_code'] = opts[:'country_code'] if !opts[:'country_code'].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 => 'ApiResponseStockExchanges') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_all_stock_exchanges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Lookup Stock Exchange # Returns the Stock Exchange with the given `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @return [StockExchange] def get_stock_exchange_by_id(identifier, opts = {}) data, _status_code, _headers = get_stock_exchange_by_id_with_http_info(identifier, opts) return data end # Lookup Stock Exchange # Returns the Stock Exchange with the given `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @return [Array<(StockExchange, Fixnum, Hash)>] StockExchange data, response status code and response headers def get_stock_exchange_by_id_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_by_id ..." 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 StockExchangeApi.get_stock_exchange_by_id" end # resource path local_var_path = "/stock_exchanges/{identifier}".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} # 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 => 'StockExchange') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Top Gainers by Exchange # Returns securities with the highest gain percent change traded on the chosen stock exchange. # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Float] :min_price The minimum price filter # @option opts [Integer] :page_size The number of results to return (default to 100) # @option opts [String] :source Return the realtime price from the specified source instead of the most recent. # @return [ApiResponseStockExchangeMovers] def get_stock_exchange_gainers(identifier, opts = {}) data, _status_code, _headers = get_stock_exchange_gainers_with_http_info(identifier, opts) return data end # Top Gainers by Exchange # Returns securities with the highest gain percent change traded on the chosen stock exchange. # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Float] :min_price The minimum price filter # @option opts [Integer] :page_size The number of results to return # @option opts [String] :source Return the realtime price from the specified source instead of the most recent. # @return [Array<(ApiResponseStockExchangeMovers, Fixnum, Hash)>] ApiResponseStockExchangeMovers data, response status code and response headers def get_stock_exchange_gainers_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_gainers ..." 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 StockExchangeApi.get_stock_exchange_gainers" 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 StockExchangeApi.get_stock_exchange_gainers, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && opts[:'source'] && !['iex', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'otc_delayed', 'delayed_sip', 'nasdaq_basic'].include?(opts[:'source']) fail ArgumentError, 'invalid value for "source", must be one of iex, bats_delayed, utp_delayed, cta_a_delayed, cta_b_delayed, otc_delayed, delayed_sip, nasdaq_basic' end # resource path local_var_path = "/stock_exchanges/{identifier}/gainers".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} query_params[:'min_price'] = opts[:'min_price'] if !opts[:'min_price'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].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 => 'ApiResponseStockExchangeMovers') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_gainers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Top Losers by Exchange # Returns securities with the highest loss percent change traded on the chosen stock exchange. # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Float] :min_price The minimum price filter # @option opts [Integer] :page_size The number of results to return (default to 100) # @option opts [String] :source Return the realtime price from the specified source instead of the most recent. # @return [ApiResponseStockExchangeMovers] def get_stock_exchange_losers(identifier, opts = {}) data, _status_code, _headers = get_stock_exchange_losers_with_http_info(identifier, opts) return data end # Top Losers by Exchange # Returns securities with the highest loss percent change traded on the chosen stock exchange. # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Float] :min_price The minimum price filter # @option opts [Integer] :page_size The number of results to return # @option opts [String] :source Return the realtime price from the specified source instead of the most recent. # @return [Array<(ApiResponseStockExchangeMovers, Fixnum, Hash)>] ApiResponseStockExchangeMovers data, response status code and response headers def get_stock_exchange_losers_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_losers ..." 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 StockExchangeApi.get_stock_exchange_losers" 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 StockExchangeApi.get_stock_exchange_losers, must be smaller than or equal to 10000.' end if @api_client.config.client_side_validation && opts[:'source'] && !['iex', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'otc_delayed', 'delayed_sip', 'nasdaq_basic'].include?(opts[:'source']) fail ArgumentError, 'invalid value for "source", must be one of iex, bats_delayed, utp_delayed, cta_a_delayed, cta_b_delayed, otc_delayed, delayed_sip, nasdaq_basic' end # resource path local_var_path = "/stock_exchanges/{identifier}/losers".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} query_params[:'min_price'] = opts[:'min_price'] if !opts[:'min_price'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].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 => 'ApiResponseStockExchangeMovers') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_losers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Stock Price Adjustments by Exchange # Returns stock price adjustments for the Stock Exchange with the given `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Date] :date The date for which to return price adjustments # @option opts [Integer] :page_size The number of results to return (default to 100) # @option opts [String] :next_page Gets the next page of data from a previous API call # @return [ApiResponseStockExchangeStockPriceAdjustments] def get_stock_exchange_price_adjustments(identifier, opts = {}) data, _status_code, _headers = get_stock_exchange_price_adjustments_with_http_info(identifier, opts) return data end # Stock Price Adjustments by Exchange # Returns stock price adjustments for the Stock Exchange with the given `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Date] :date The date for which to return price adjustments # @option opts [Integer] :page_size The number of results to return # @option opts [String] :next_page Gets the next page of data from a previous API call # @return [Array<(ApiResponseStockExchangeStockPriceAdjustments, Fixnum, Hash)>] ApiResponseStockExchangeStockPriceAdjustments data, response status code and response headers def get_stock_exchange_price_adjustments_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_price_adjustments ..." 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 StockExchangeApi.get_stock_exchange_price_adjustments" 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 StockExchangeApi.get_stock_exchange_price_adjustments, must be smaller than or equal to 10000.' end # resource path local_var_path = "/stock_exchanges/{identifier}/prices/adjustments".sub('{' + 'identifier' + '}', identifier.to_s) # 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 => 'ApiResponseStockExchangeStockPriceAdjustments') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_price_adjustments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Stock Prices by Exchange # Returns end-of-day stock prices for Securities on the Stock Exchange with `identifier` and on the `price_date` (or the latest date that prices are available) # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Date] :date The date for which to return prices. May not be used with the start_date and end_date parameters. # @option opts [Date] :start_date The start of the date range you're querying. May not be used with date parameter. # @option opts [Date] :end_date The end of the date range you're querying. May not be used with date parameter. # @option opts [Integer] :page_size The number of results to return (default to 100) # @option opts [String] :next_page Gets the next page of data from a previous API call # @option opts [Array] :tickers The comma-delimited list of ticker symbols to filter down to. If not provided, the entire stock exchange is returned. # @option opts [String] :next_page2 Gets the next page of data from a previous API call # @return [ApiResponseStockExchangeStockPrices] def get_stock_exchange_prices(identifier, opts = {}) data, _status_code, _headers = get_stock_exchange_prices_with_http_info(identifier, opts) return data end # Stock Prices by Exchange # Returns end-of-day stock prices for Securities on the Stock Exchange with `identifier` and on the `price_date` (or the latest date that prices are available) # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Date] :date The date for which to return prices. May not be used with the start_date and end_date parameters. # @option opts [Date] :start_date The start of the date range you're querying. May not be used with date parameter. # @option opts [Date] :end_date The end of the date range you're querying. May not be used with date parameter. # @option opts [Integer] :page_size The number of results to return # @option opts [String] :next_page Gets the next page of data from a previous API call # @option opts [Array] :tickers The comma-delimited list of ticker symbols to filter down to. If not provided, the entire stock exchange is returned. # @option opts [String] :next_page2 Gets the next page of data from a previous API call # @return [Array<(ApiResponseStockExchangeStockPrices, Fixnum, Hash)>] ApiResponseStockExchangeStockPrices data, response status code and response headers def get_stock_exchange_prices_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_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 StockExchangeApi.get_stock_exchange_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 StockExchangeApi.get_stock_exchange_prices, must be smaller than or equal to 10000.' end # resource path local_var_path = "/stock_exchanges/{identifier}/prices".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} query_params[:'date'] = opts[:'date'] if !opts[:'date'].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[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil? query_params[:'tickers'] = @api_client.build_collection_param(opts[:'tickers'], :csv) if !opts[:'tickers'].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 => 'ApiResponseStockExchangeStockPrices') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Realtime Quote Prices by Exchange # Returns many popular metrics for securities from a given exchange 'identifier' from multiple products conveniently in one API. Realtime stock price data requires at least one realtime product subscription (IEX, NASDAQ Basic, and/or Delayed SIP). If you are subscribed to multiple realtime stock price products, the api will return the most recent realtime stock price. Previous close price and percent change fields require both an EoD US Stock Price subscription and a realtime stock price subscription. Market_cap, price_to_earnings, and dividendyield data fields require a fundamentals subscription. # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param tickers The comma-delimited list of ticker symbols to return quotes for. # @param [Hash] opts the optional parameters # @option opts [String] :source Return the realtime price from the specified source instead of the most recent. # @option opts [BOOLEAN] :active_only Returns prices only from the most recent trading day. # @return [ApiResponseStockExchangeQuote] def get_stock_exchange_quote(identifier, tickers, opts = {}) data, _status_code, _headers = get_stock_exchange_quote_with_http_info(identifier, tickers, opts) return data end # Realtime Quote Prices by Exchange # Returns many popular metrics for securities from a given exchange 'identifier' from multiple products conveniently in one API. Realtime stock price data requires at least one realtime product subscription (IEX, NASDAQ Basic, and/or Delayed SIP). If you are subscribed to multiple realtime stock price products, the api will return the most recent realtime stock price. Previous close price and percent change fields require both an EoD US Stock Price subscription and a realtime stock price subscription. Market_cap, price_to_earnings, and dividendyield data fields require a fundamentals subscription. # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param tickers The comma-delimited list of ticker symbols to return quotes for. # @param [Hash] opts the optional parameters # @option opts [String] :source Return the realtime price from the specified source instead of the most recent. # @option opts [BOOLEAN] :active_only Returns prices only from the most recent trading day. # @return [Array<(ApiResponseStockExchangeQuote, Fixnum, Hash)>] ApiResponseStockExchangeQuote data, response status code and response headers def get_stock_exchange_quote_with_http_info(identifier, tickers, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_quote ..." 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 StockExchangeApi.get_stock_exchange_quote" end # verify the required parameter 'tickers' is set if @api_client.config.client_side_validation && tickers.nil? fail ArgumentError, "Missing the required parameter 'tickers' when calling StockExchangeApi.get_stock_exchange_quote" end if @api_client.config.client_side_validation && opts[:'source'] && !['iex', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'otc_delayed', 'delayed_sip', 'nasdaq_basic', 'intrinio_mx', 'intrinio_mx_plus'].include?(opts[:'source']) fail ArgumentError, 'invalid value for "source", must be one of iex, bats_delayed, utp_delayed, cta_a_delayed, cta_b_delayed, otc_delayed, delayed_sip, nasdaq_basic, intrinio_mx, intrinio_mx_plus' end # resource path local_var_path = "/stock_exchanges/{identifier}/quote".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} query_params[:'tickers'] = @api_client.build_collection_param(tickers, :csv) query_params[:'source'] = opts[:'source'] if !opts[:'source'].nil? query_params[:'active_only'] = opts[:'active_only'] if !opts[:'active_only'].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 => 'ApiResponseStockExchangeQuote') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Realtime Stock Prices by Exchange # Returns realtime stock prices for the Stock Exchange with the given `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Array] :source Return realtime prices from the specified comma-delimited data sources. If no source is specified, all sources available to user are used. # @option opts [BOOLEAN] :active_only Returns prices only from the most recent trading day. # @option opts [BOOLEAN] :traded_today Returns prices only from securities which have traded on the most recent trading day. # @option opts [Integer] :page_size The number of results to return (default to 100) # @option opts [Array] :tickers The comma-delimited list of ticker symbols to filter to. If not provided, the entire stock exchange is returned. # @option opts [String] :next_page Gets the next page of data from a previous API call # @return [ApiResponseStockExchangeRealtimeStockPrices] def get_stock_exchange_realtime_prices(identifier, opts = {}) data, _status_code, _headers = get_stock_exchange_realtime_prices_with_http_info(identifier, opts) return data end # Realtime Stock Prices by Exchange # Returns realtime stock prices for the Stock Exchange with the given `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Array] :source Return realtime prices from the specified comma-delimited data sources. If no source is specified, all sources available to user are used. # @option opts [BOOLEAN] :active_only Returns prices only from the most recent trading day. # @option opts [BOOLEAN] :traded_today Returns prices only from securities which have traded on the most recent trading day. # @option opts [Integer] :page_size The number of results to return # @option opts [Array] :tickers The comma-delimited list of ticker symbols to filter to. If not provided, the entire stock exchange is returned. # @option opts [String] :next_page Gets the next page of data from a previous API call # @return [Array<(ApiResponseStockExchangeRealtimeStockPrices, Fixnum, Hash)>] ApiResponseStockExchangeRealtimeStockPrices data, response status code and response headers def get_stock_exchange_realtime_prices_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_realtime_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 StockExchangeApi.get_stock_exchange_realtime_prices" end if @api_client.config.client_side_validation && opts[:'source'] && !opts[:'source'].all?{|item| ['iex', 'bats_delayed', 'utp_delayed', 'cta_a_delayed', 'cta_b_delayed', 'otc_delayed', 'delayed_sip', 'nasdaq_basic', 'intrinio_mx', 'intrinio_mx_plus'].include?(item)} fail ArgumentError, 'invalid value for "source", must include one of iex, bats_delayed, utp_delayed, cta_a_delayed, cta_b_delayed, otc_delayed, delayed_sip, nasdaq_basic, intrinio_mx, intrinio_mx_plus' 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 StockExchangeApi.get_stock_exchange_realtime_prices, must be smaller than or equal to 10000.' end # resource path local_var_path = "/stock_exchanges/{identifier}/prices/realtime".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} query_params[:'source'] = @api_client.build_collection_param(opts[:'source'], :csv) if !opts[:'source'].nil? query_params[:'active_only'] = opts[:'active_only'] if !opts[:'active_only'].nil? query_params[:'traded_today'] = opts[:'traded_today'] if !opts[:'traded_today'].nil? query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'tickers'] = @api_client.build_collection_param(opts[:'tickers'], :csv) if !opts[:'tickers'].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 => 'ApiResponseStockExchangeRealtimeStockPrices') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_realtime_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end # Securities by Exchange # Returns Securities traded on the Stock Exchange with `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of results to return (default to 100) # @option opts [String] :next_page Gets the next page of data from a previous API call # @return [ApiResponseStockExchangeSecurities] def get_stock_exchange_securities(identifier, opts = {}) data, _status_code, _headers = get_stock_exchange_securities_with_http_info(identifier, opts) return data end # Securities by Exchange # Returns Securities traded on the Stock Exchange with `identifier` # @param identifier A Stock Exchange identifier (MIC or Intrinio ID) # @param [Hash] opts the optional parameters # @option opts [Integer] :page_size The number of results to return # @option opts [String] :next_page Gets the next page of data from a previous API call # @return [Array<(ApiResponseStockExchangeSecurities, Fixnum, Hash)>] ApiResponseStockExchangeSecurities data, response status code and response headers def get_stock_exchange_securities_with_http_info(identifier, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: StockExchangeApi.get_stock_exchange_securities ..." 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 StockExchangeApi.get_stock_exchange_securities" 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 StockExchangeApi.get_stock_exchange_securities, must be smaller than or equal to 10000.' end # resource path local_var_path = "/stock_exchanges/{identifier}/securities".sub('{' + 'identifier' + '}', identifier.to_s) # query parameters query_params = {} 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 => 'ApiResponseStockExchangeSecurities') if @api_client.config.debugging @api_client.config.logger.debug "API called: StockExchangeApi#get_stock_exchange_securities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end end end