Class: Intrinio::SecurityApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ SecurityApi

Returns a new instance of SecurityApi.



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

def api_client
  @api_client
end

Instance Method Details

#get_all_securities(opts = {}) ⇒ ApiResponseSecurities

Get All Securiites

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



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

def get_all_securities(opts = {})
  data, _status_code, _headers = get_all_securities_with_http_info(opts)
  return data
end

#get_all_securities_with_http_info(opts = {}) ⇒ Array<(ApiResponseSecurities, Fixnum, Hash)>

Get All Securiites

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

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

    ApiResponseSecurities data, response status code and response headers



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

def get_all_securities_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.get_all_securities ..."
  end
  # resource path
  local_var_path = "/securities"

  # query parameters
  query_params = {}
  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 => 'ApiResponseSecurities')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#get_all_securities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_security_by_id(identifier, opts = {}) ⇒ Security

Get a Security by ID

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

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

    the optional parameters

Returns:



78
79
80
81
# File 'lib/intrinio-sdk/api/security_api.rb', line 78

def get_security_by_id(identifier, opts = {})
  data, _status_code, _headers = get_security_by_id_with_http_info(identifier, opts)
  return data
end

#get_security_by_id_with_http_info(identifier, opts = {}) ⇒ Array<(Security, Fixnum, Hash)>

Get a Security by ID

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

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

    the optional parameters

Returns:

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

    Security data, response status code and response headers



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

def get_security_by_id_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.get_security_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 SecurityApi.get_security_by_id"
  end
  # resource path
  local_var_path = "/securities/{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 => 'Security')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#get_security_by_id\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_security_data_point_number(identifier, tag, opts = {}) ⇒ Float

Get Security Data Point (Number) Returns a numeric value for the given ‘tag` for the Security with the given `identifier`

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

  • tag

    An Intrinio data tag ID or code-name

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

    the optional parameters

Returns:

  • (Float)


132
133
134
135
# File 'lib/intrinio-sdk/api/security_api.rb', line 132

def get_security_data_point_number(identifier, tag, opts = {})
  data, _status_code, _headers = get_security_data_point_number_with_http_info(identifier, tag, opts)
  return data
end

#get_security_data_point_number_with_http_info(identifier, tag, opts = {}) ⇒ Array<(Float, Fixnum, Hash)>

Get Security Data Point (Number) Returns a numeric value for the given &#x60;tag&#x60; for the Security with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

  • tag

    An Intrinio data tag ID or code-name

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

    the optional parameters

Returns:

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

    Float data, response status code and response headers



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

def get_security_data_point_number_with_http_info(identifier, tag, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.get_security_data_point_number ..."
  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 SecurityApi.get_security_data_point_number"
  end
  # verify the required parameter 'tag' is set
  if @api_client.config.client_side_validation && tag.nil?
    fail ArgumentError, "Missing the required parameter 'tag' when calling SecurityApi.get_security_data_point_number"
  end
  # resource path
  local_var_path = "/securities/{identifier}/data_point/{tag}/number".sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'tag' + '}', tag.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain; charset=utf-8'])

  # 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 => 'Float')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#get_security_data_point_number\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_security_data_point_text(identifier, tag, opts = {}) ⇒ String

Get Security Data Point (Text) Returns a text value for the given ‘tag` for the Security with the given `identifier`

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

  • tag

    An Intrinio data tag ID or code-name

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

    the optional parameters

Returns:

  • (String)


191
192
193
194
# File 'lib/intrinio-sdk/api/security_api.rb', line 191

def get_security_data_point_text(identifier, tag, opts = {})
  data, _status_code, _headers = get_security_data_point_text_with_http_info(identifier, tag, opts)
  return data
end

#get_security_data_point_text_with_http_info(identifier, tag, opts = {}) ⇒ Array<(String, Fixnum, Hash)>

Get Security Data Point (Text) Returns a text value for the given &#x60;tag&#x60; for the Security with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

  • tag

    An Intrinio data tag ID or code-name

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

    the optional parameters

Returns:

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

    String data, response status code and response headers



202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
# File 'lib/intrinio-sdk/api/security_api.rb', line 202

def get_security_data_point_text_with_http_info(identifier, tag, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.get_security_data_point_text ..."
  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 SecurityApi.get_security_data_point_text"
  end
  # verify the required parameter 'tag' is set
  if @api_client.config.client_side_validation && tag.nil?
    fail ArgumentError, "Missing the required parameter 'tag' when calling SecurityApi.get_security_data_point_text"
  end
  # resource path
  local_var_path = "/securities/{identifier}/data_point/{tag}/text".sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'tag' + '}', tag.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['text/plain; charset=utf-8'])

  # 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 => 'String')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#get_security_data_point_text\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_security_historical_data(identifier, tag, opts = {}) ⇒ ApiResponseSecurityHistoricalData

Get Security Historical Data Returns historical values for the given ‘tag` and the Security with the given `identifier`

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

  • tag

    An Intrinio data tag ID or code-name

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    Filter by type, when applicable

  • :start_date (Date)

    Get historical data on or after this date

  • :end_date (Date)

    Get historical date on or before this date

  • :sort_order (String)

    Sort by date &#x60;asc&#x60; or &#x60;desc&#x60; (default to desc)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



255
256
257
258
# File 'lib/intrinio-sdk/api/security_api.rb', line 255

def get_security_historical_data(identifier, tag, opts = {})
  data, _status_code, _headers = get_security_historical_data_with_http_info(identifier, tag, opts)
  return data
end

#get_security_historical_data_with_http_info(identifier, tag, opts = {}) ⇒ Array<(ApiResponseSecurityHistoricalData, Fixnum, Hash)>

Get Security Historical Data Returns historical values for the given &#x60;tag&#x60; and the Security with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

  • tag

    An Intrinio data tag ID or code-name

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

    the optional parameters

Options Hash (opts):

  • :type (String)

    Filter by type, when applicable

  • :start_date (Date)

    Get historical data on or after this date

  • :end_date (Date)

    Get historical date on or before this date

  • :sort_order (String)

    Sort by date &#x60;asc&#x60; or &#x60;desc&#x60;

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



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
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
# File 'lib/intrinio-sdk/api/security_api.rb', line 271

def get_security_historical_data_with_http_info(identifier, tag, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.get_security_historical_data ..."
  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 SecurityApi.get_security_historical_data"
  end
  # verify the required parameter 'tag' is set
  if @api_client.config.client_side_validation && tag.nil?
    fail ArgumentError, "Missing the required parameter 'tag' when calling SecurityApi.get_security_historical_data"
  end
  if @api_client.config.client_side_validation && opts[:'sort_order'] && !['asc', 'desc'].include?(opts[:'sort_order'])
    fail ArgumentError, 'invalid value for "sort_order", must be one of asc, desc'
  end
  # resource path
  local_var_path = "/securities/{identifier}/historical_data/{tag}".sub('{' + 'identifier' + '}', identifier.to_s).sub('{' + 'tag' + '}', tag.to_s)

  # query parameters
  query_params = {}
  query_params[:'type'] = opts[:'type'] if !opts[:'type'].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[:'sort_order'] = opts[:'sort_order'] if !opts[:'sort_order'].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 => 'ApiResponseSecurityHistoricalData')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#get_security_historical_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_security_stock_price_adjustments(identifier, opts = {}) ⇒ ApiResponseSecurityStockPriceAdjustments

Get Stock Price Adjustments for Security Return stock price adjustments for the Security with the given ‘identifier`

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Return price adjustments on or after the date

  • :end_date (Date)

    Return price adjustments on or before the date

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



329
330
331
332
# File 'lib/intrinio-sdk/api/security_api.rb', line 329

def get_security_stock_price_adjustments(identifier, opts = {})
  data, _status_code, _headers = get_security_stock_price_adjustments_with_http_info(identifier, opts)
  return data
end

#get_security_stock_price_adjustments_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseSecurityStockPriceAdjustments, Fixnum, Hash)>

Get Stock Price Adjustments for Security Return stock price adjustments for the Security with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Return price adjustments on or after the date

  • :end_date (Date)

    Return price adjustments on or before the date

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
# File 'lib/intrinio-sdk/api/security_api.rb', line 342

def get_security_stock_price_adjustments_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.get_security_stock_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 SecurityApi.get_security_stock_price_adjustments"
  end
  # resource path
  local_var_path = "/securities/{identifier}/prices/adjustments".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[:'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 => 'ApiResponseSecurityStockPriceAdjustments')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#get_security_stock_price_adjustments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_security_stock_prices(identifier, opts = {}) ⇒ ApiResponseSecurityStockPrices

Get Stock Prices for Security Return stock prices for the Security with the given ‘identifier`

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Return prices on or after the date

  • :end_date (Date)

    Return prices on or before the date

  • :frequency (String)

    Return stock prices in the given frequency (default to daily)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



392
393
394
395
# File 'lib/intrinio-sdk/api/security_api.rb', line 392

def get_security_stock_prices(identifier, opts = {})
  data, _status_code, _headers = get_security_stock_prices_with_http_info(identifier, opts)
  return data
end

#get_security_stock_prices_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseSecurityStockPrices, Fixnum, Hash)>

Get Stock Prices for Security Return stock prices for the Security with the given &#x60;identifier&#x60;

Parameters:

  • identifier

    A Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :start_date (Date)

    Return prices on or after the date

  • :end_date (Date)

    Return prices on or before the date

  • :frequency (String)

    Return stock prices in the given frequency

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



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

def get_security_stock_prices_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.get_security_stock_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 SecurityApi.get_security_stock_prices"
  end
  if @api_client.config.client_side_validation && opts[:'frequency'] && !['daily', 'weekly', 'monthly', 'quarterly', 'yearly'].include?(opts[:'frequency'])
    fail ArgumentError, 'invalid value for "frequency", must be one of daily, weekly, monthly, quarterly, yearly'
  end
  # resource path
  local_var_path = "/securities/{identifier}/prices".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[:'frequency'] = opts[:'frequency'] if !opts[:'frequency'].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 => 'ApiResponseSecurityStockPrices')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#get_security_stock_prices\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#screen_securities(opts = {}) ⇒ Array<SecurityScreenResult>

Screen Securities Screen securities using complex logic

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :logic (SecurityScreenGroup)

    The logic to screen with, consisting of operators, clauses, and nested groups.&lt;br/&gt; See &lt;a href&#x3D;&quot;/documentation/screener_v2&quot; target&#x3D;&quot;_blank&quot;&gt;screener documentation&lt;/a&gt; for details on how to construct conditions.

  • :order_column (String)

    Results returned sorted by this column

  • :order_direction (String)

    Sort order to use with the order_column (default to asc)

  • :primary_only (BOOLEAN)

    Return only primary securities (default to false)

Returns:



459
460
461
462
# File 'lib/intrinio-sdk/api/security_api.rb', line 459

def screen_securities(opts = {})
  data, _status_code, _headers = screen_securities_with_http_info(opts)
  return data
end

#screen_securities_with_http_info(opts = {}) ⇒ Array<(Array<SecurityScreenResult>, Fixnum, Hash)>

Screen Securities Screen securities using complex logic

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :logic (SecurityScreenGroup)

    The logic to screen with, consisting of operators, clauses, and nested groups.&lt;br/&gt; See &lt;a href&#x3D;&quot;/documentation/screener_v2&quot; target&#x3D;&quot;_blank&quot;&gt;screener documentation&lt;/a&gt; for details on how to construct conditions.

  • :order_column (String)

    Results returned sorted by this column

  • :order_direction (String)

    Sort order to use with the order_column

  • :primary_only (BOOLEAN)

    Return only primary securities

Returns:

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

    Array<SecurityScreenResult> data, response status code and response headers



472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
# File 'lib/intrinio-sdk/api/security_api.rb', line 472

def screen_securities_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.screen_securities ..."
  end
  if @api_client.config.client_side_validation && opts[:'order_direction'] && !['asc', 'desc'].include?(opts[:'order_direction'])
    fail ArgumentError, 'invalid value for "order_direction", must be one of asc, desc'
  end
  # resource path
  local_var_path = "/securities/screen"

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

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

  # form parameters
  form_params = {}

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

#search_securities(query, opts = {}) ⇒ ApiResponseSecurities

Search Securities Searches for Securities matching the text ‘query`

Parameters:

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

    the optional parameters

Returns:



519
520
521
522
# File 'lib/intrinio-sdk/api/security_api.rb', line 519

def search_securities(query, opts = {})
  data, _status_code, _headers = search_securities_with_http_info(query, opts)
  return data
end

#search_securities_with_http_info(query, opts = {}) ⇒ Array<(ApiResponseSecurities, Fixnum, Hash)>

Search Securities Searches for Securities matching the text &#x60;query&#x60;

Parameters:

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

    the optional parameters

Returns:

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

    ApiResponseSecurities data, response status code and response headers



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/security_api.rb', line 529

def search_securities_with_http_info(query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: SecurityApi.search_securities ..."
  end
  # verify the required parameter 'query' is set
  if @api_client.config.client_side_validation && query.nil?
    fail ArgumentError, "Missing the required parameter 'query' when calling SecurityApi.search_securities"
  end
  # resource path
  local_var_path = "/securities/search"

  # query parameters
  query_params = {}
  query_params[:'query'] = query

  # 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 => 'ApiResponseSecurities')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: SecurityApi#search_securities\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end