Class: Intrinio::StockExchangeApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ StockExchangeApi

Returns a new instance of StockExchangeApi.



19
20
21
# File 'lib/intrinio-sdk/api/stock_exchange_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/stock_exchange_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_all_stock_exchanges(opts = {}) ⇒ ApiResponseStockExchanges

All Stock Exchanges Returns all Stock Exchanges matching the specified parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :city (String)

    Filter by city

  • :country (String)

    Filter by country

  • :country_code (String)

    Filter by ISO country code

  • :page_size (Integer)

    The number of results to return (default to 100)

Returns:



31
32
33
34
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 31

def get_all_stock_exchanges(opts = {})
  data, _status_code, _headers = get_all_stock_exchanges_with_http_info(opts)
  return data
end

#get_all_stock_exchanges_with_http_info(opts = {}) ⇒ Array<(ApiResponseStockExchanges, Fixnum, Hash)>

All Stock Exchanges Returns all Stock Exchanges matching the specified parameters

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :city (String)

    Filter by city

  • :country (String)

    Filter by country

  • :country_code (String)

    Filter by ISO country code

  • :page_size (Integer)

    The number of results to return

Returns:

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

    ApiResponseStockExchanges data, response status code and response headers



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
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 44

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

#get_stock_exchange_by_id(identifier, opts = {}) ⇒ StockExchange

Lookup Stock Exchange Returns the Stock Exchange with the given ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Returns:



91
92
93
94
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 91

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

#get_stock_exchange_by_id_with_http_info(identifier, opts = {}) ⇒ Array<(StockExchange, Fixnum, Hash)>

Lookup Stock Exchange Returns the Stock Exchange with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Returns:

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

    StockExchange data, response status code and response headers



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
128
129
130
131
132
133
134
135
136
137
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 101

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

#get_stock_exchange_gainers(identifier, opts = {}) ⇒ ApiResponseStockExchangeMovers

Top Gainers by Exchange Returns securities with the highest gain percent change traded on the chosen stock exchange.

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :min_price (Float)

    The minimum price filter

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :source (String)

    Return the realtime price from the specified source instead of the most recent.

Returns:



147
148
149
150
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 147

def get_stock_exchange_gainers(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_gainers_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_gainers_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeMovers, Fixnum, Hash)>

Top Gainers by Exchange Returns securities with the highest gain percent change traded on the chosen stock exchange.

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :min_price (Float)

    The minimum price filter

  • :page_size (Integer)

    The number of results to return

  • :source (String)

    Return the realtime price from the specified source instead of the most recent.

Returns:



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
199
200
201
202
203
204
205
206
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 160

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

#get_stock_exchange_losers(identifier, opts = {}) ⇒ ApiResponseStockExchangeMovers

Top Losers by Exchange Returns securities with the highest loss percent change traded on the chosen stock exchange.

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :min_price (Float)

    The minimum price filter

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :source (String)

    Return the realtime price from the specified source instead of the most recent.

Returns:



216
217
218
219
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 216

def get_stock_exchange_losers(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_losers_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_losers_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeMovers, Fixnum, Hash)>

Top Losers by Exchange Returns securities with the highest loss percent change traded on the chosen stock exchange.

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :min_price (Float)

    The minimum price filter

  • :page_size (Integer)

    The number of results to return

  • :source (String)

    Return the realtime price from the specified source instead of the most recent.

Returns:



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
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 229

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

#get_stock_exchange_price_adjustments(identifier, opts = {}) ⇒ ApiResponseStockExchangeStockPriceAdjustments

Stock Price Adjustments by Exchange Returns stock price adjustments for the Stock Exchange with the given ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return price adjustments

  • :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:



285
286
287
288
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 285

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

#get_stock_exchange_price_adjustments_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeStockPriceAdjustments, Fixnum, Hash)>

Stock Price Adjustments by Exchange Returns stock price adjustments for the Stock Exchange with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return price adjustments

  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
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
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 298

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

#get_stock_exchange_prices(identifier, opts = {}) ⇒ ApiResponseStockExchangeStockPrices

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)

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return prices. May not be used with the start_date and end_date parameters.

  • :start_date (Date)

    The start of the date range you&#39;re querying. May not be used with date parameter.

  • :end_date (Date)

    The end of the date range you&#39;re querying. May not be used with date parameter.

  • :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

  • :tickers (Array<String>)

    The comma-delimited list of ticker symbols to filter down to. If not provided, the entire stock exchange is returned.

  • :next_page2 (String)

    Gets the next page of data from a previous API call

Returns:



355
356
357
358
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 355

def get_stock_exchange_prices(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_prices_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeStockPrices, Fixnum, Hash)>

Stock Prices by Exchange Returns end-of-day stock prices for Securities on the Stock Exchange with &#x60;identifier&#x60; and on the &#x60;price_date&#x60; (or the latest date that prices are available)

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :date (Date)

    The date for which to return prices. May not be used with the start_date and end_date parameters.

  • :start_date (Date)

    The start of the date range you&#39;re querying. May not be used with date parameter.

  • :end_date (Date)

    The end of the date range you&#39;re querying. May not be used with date parameter.

  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

  • :tickers (Array<String>)

    The comma-delimited list of ticker symbols to filter down to. If not provided, the entire stock exchange is returned.

  • :next_page2 (String)

    Gets the next page of data from a previous API call

Returns:



372
373
374
375
376
377
378
379
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
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 372

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

#get_stock_exchange_quote(identifier, tickers, opts = {}) ⇒ ApiResponseStockExchangeQuote

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.

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • tickers

    The comma-delimited list of ticker symbols to return quotes for.

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

    the optional parameters

Options Hash (opts):

  • :source (String)

    Return the realtime price from the specified source instead of the most recent.

  • :active_only (BOOLEAN)

    Returns prices only from the most recent trading day.

Returns:



429
430
431
432
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 429

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

#get_stock_exchange_quote_with_http_info(identifier, tickers, opts = {}) ⇒ Array<(ApiResponseStockExchangeQuote, Fixnum, Hash)>

Realtime Quote Prices by Exchange Returns many popular metrics for securities from a given exchange &#39;identifier&#39; 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.

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

  • tickers

    The comma-delimited list of ticker symbols to return quotes for.

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

    the optional parameters

Options Hash (opts):

  • :source (String)

    Return the realtime price from the specified source instead of the most recent.

  • :active_only (BOOLEAN)

    Returns prices only from the most recent trading day.

Returns:



442
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
484
485
486
487
488
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 442

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

#get_stock_exchange_realtime_prices(identifier, opts = {}) ⇒ ApiResponseStockExchangeRealtimeStockPrices

Realtime Stock Prices by Exchange Returns realtime stock prices for the Stock Exchange with the given ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :source (Array<String>)

    Return realtime prices from the specified comma-delimited data sources. If no source is specified, all sources available to user are used.

  • :active_only (BOOLEAN)

    Returns prices only from the most recent trading day.

  • :traded_today (BOOLEAN)

    Returns prices only from securities which have traded on the most recent trading day.

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :tickers (Array<String>)

    The comma-delimited list of ticker symbols to filter to. If not provided, the entire stock exchange is returned.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



501
502
503
504
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 501

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

#get_stock_exchange_realtime_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeRealtimeStockPrices, Fixnum, Hash)>

Realtime Stock Prices by Exchange Returns realtime stock prices for the Stock Exchange with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :source (Array<String>)

    Return realtime prices from the specified comma-delimited data sources. If no source is specified, all sources available to user are used.

  • :active_only (BOOLEAN)

    Returns prices only from the most recent trading day.

  • :traded_today (BOOLEAN)

    Returns prices only from securities which have traded on the most recent trading day.

  • :page_size (Integer)

    The number of results to return

  • :tickers (Array<String>)

    The comma-delimited list of ticker symbols to filter to. If not provided, the entire stock exchange is returned.

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



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
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 517

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

#get_stock_exchange_securities(identifier, opts = {}) ⇒ ApiResponseStockExchangeSecurities

Securities by Exchange Returns Securities traded on the Stock Exchange with ‘identifier`

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :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:



575
576
577
578
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 575

def get_stock_exchange_securities(identifier, opts = {})
  data, _status_code, _headers = get_stock_exchange_securities_with_http_info(identifier, opts)
  return data
end

#get_stock_exchange_securities_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseStockExchangeSecurities, Fixnum, Hash)>

Securities by Exchange Returns Securities traded on the Stock Exchange with &#x60;identifier&#x60;

Parameters:

  • identifier

    A Stock Exchange identifier (MIC or Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



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
629
# File 'lib/intrinio-sdk/api/stock_exchange_api.rb', line 587

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