Class: FinnhubRuby::DefaultApi

Inherits:
Object
  • Object
show all
Defined in:
lib/finnhub_ruby/api/default_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ DefaultApi

Returns a new instance of DefaultApi.



19
20
21
# File 'lib/finnhub_ruby/api/default_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/finnhub_ruby/api/default_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#aggregate_indicator(symbol, resolution, opts = {}) ⇒ AggregateIndicators

Aggregate Indicators Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v.

Parameters:

  • symbol (String)

    symbol

  • resolution (String)

    Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.

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

    the optional parameters

Returns:



28
29
30
31
# File 'lib/finnhub_ruby/api/default_api.rb', line 28

def aggregate_indicator(symbol, resolution, opts = {})
  data, _status_code, _headers = aggregate_indicator_with_http_info(symbol, resolution, opts)
  data
end

#aggregate_indicator_with_http_info(symbol, resolution, opts = {}) ⇒ Array<(AggregateIndicators, Integer, Hash)>

Aggregate Indicators Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v.

Parameters:

  • symbol (String)

    symbol

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

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

    the optional parameters

Returns:

  • (Array<(AggregateIndicators, Integer, Hash)>)

    AggregateIndicators data, response status code and response headers



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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# File 'lib/finnhub_ruby/api/default_api.rb', line 39

def aggregate_indicator_with_http_info(symbol, resolution, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.aggregate_indicator ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.aggregate_indicator"
  end
  # verify the required parameter 'resolution' is set
  if @api_client.config.client_side_validation && resolution.nil?
    fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.aggregate_indicator"
  end
  # resource path
  local_var_path = '/scan/technical-indicator'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'resolution'] = resolution

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'AggregateIndicators'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.aggregate_indicator",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#aggregate_indicator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#bond_price(isin, from, to, opts = {}) ⇒ BondCandles

Bond price data Get end-of-day bond’s price data.

Parameters:

  • isin (String)

    ISIN.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:



100
101
102
103
# File 'lib/finnhub_ruby/api/default_api.rb', line 100

def bond_price(isin, from, to, opts = {})
  data, _status_code, _headers = bond_price_with_http_info(isin, from, to, opts)
  data
end

#bond_price_with_http_info(isin, from, to, opts = {}) ⇒ Array<(BondCandles, Integer, Hash)>

Bond price data Get end-of-day bond&#39;s price data.

Parameters:

  • isin (String)

    ISIN.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:

  • (Array<(BondCandles, Integer, Hash)>)

    BondCandles data, response status code and response headers



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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
# File 'lib/finnhub_ruby/api/default_api.rb', line 112

def bond_price_with_http_info(isin, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.bond_price ...'
  end
  # verify the required parameter 'isin' is set
  if @api_client.config.client_side_validation && isin.nil?
    fail ArgumentError, "Missing the required parameter 'isin' when calling DefaultApi.bond_price"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.bond_price"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.bond_price"
  end
  # resource path
  local_var_path = '/bond/price'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'isin'] = isin
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BondCandles'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.bond_price",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#bond_price\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#bond_profile(opts = {}) ⇒ BondProfile

Bond Profile Get general information of a bond. You can query by FIGI, ISIN or CUSIP

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :isin (String)

    ISIN

  • :cusip (String)

    CUSIP

  • :figi (String)

    FIGI

Returns:



178
179
180
181
# File 'lib/finnhub_ruby/api/default_api.rb', line 178

def bond_profile(opts = {})
  data, _status_code, _headers = bond_profile_with_http_info(opts)
  data
end

#bond_profile_with_http_info(opts = {}) ⇒ Array<(BondProfile, Integer, Hash)>

Bond Profile Get general information of a bond. You can query by FIGI, ISIN or CUSIP

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :isin (String)

    ISIN

  • :cusip (String)

    CUSIP

  • :figi (String)

    FIGI

Returns:

  • (Array<(BondProfile, Integer, Hash)>)

    BondProfile data, response status code and response headers



190
191
192
193
194
195
196
197
198
199
200
201
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 190

def bond_profile_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.bond_profile ...'
  end
  # resource path
  local_var_path = '/bond/profile'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'isin'] = opts[:'isin'] if !opts[:'isin'].nil?
  query_params[:'cusip'] = opts[:'cusip'] if !opts[:'cusip'].nil?
  query_params[:'figi'] = opts[:'figi'] if !opts[:'figi'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BondProfile'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.bond_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#bond_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_basic_financials(symbol, metric, opts = {}) ⇒ BasicFinancials

Basic Financials Get company basic financials such as margin, P/E ratio, 52-week high/low etc.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

  • metric (String)

    Metric type. Can be 1 of the following values &lt;code&gt;all&lt;/code&gt;

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

    the optional parameters

Returns:



243
244
245
246
# File 'lib/finnhub_ruby/api/default_api.rb', line 243

def company_basic_financials(symbol, metric, opts = {})
  data, _status_code, _headers = company_basic_financials_with_http_info(symbol, metric, opts)
  data
end

#company_basic_financials_with_http_info(symbol, metric, opts = {}) ⇒ Array<(BasicFinancials, Integer, Hash)>

Basic Financials Get company basic financials such as margin, P/E ratio, 52-week high/low etc.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

  • metric (String)

    Metric type. Can be 1 of the following values &lt;code&gt;all&lt;/code&gt;

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

    the optional parameters

Returns:

  • (Array<(BasicFinancials, Integer, Hash)>)

    BasicFinancials data, response status code and response headers



254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
# File 'lib/finnhub_ruby/api/default_api.rb', line 254

def company_basic_financials_with_http_info(symbol, metric, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_basic_financials ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_basic_financials"
  end
  # verify the required parameter 'metric' is set
  if @api_client.config.client_side_validation && metric.nil?
    fail ArgumentError, "Missing the required parameter 'metric' when calling DefaultApi.company_basic_financials"
  end
  # resource path
  local_var_path = '/stock/metric'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'metric'] = metric

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'BasicFinancials'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_basic_financials",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_basic_financials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_earnings(symbol, opts = {}) ⇒ Array<EarningResult>

Earnings Surprises Get company historical quarterly earnings surprise going back to 2000.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit number of period returned. Leave blank to get the full history.

Returns:



314
315
316
317
# File 'lib/finnhub_ruby/api/default_api.rb', line 314

def company_earnings(symbol, opts = {})
  data, _status_code, _headers = company_earnings_with_http_info(symbol, opts)
  data
end

#company_earnings_quality_score(symbol, freq, opts = {}) ⇒ CompanyEarningsQualityScore

Company Earnings Quality Score <p>This endpoint provides Earnings Quality Score for global companies.</p><p> Earnings quality refers to the extent to which current earnings predict future earnings. "High-quality" earnings are expected to persist, while "low-quality" earnings do not. A higher score means a higher earnings quality</p><p>Finnhub uses a proprietary model which takes into consideration 4 criteria:</p> <ul style="list-style-type: unset; margin-left: 30px;"><li>Profitability</li><li>Growth</li><li>Cash Generation & Capital Allocation</li><li>Leverage</li></ul><br/><p>We then compare the metrics of each company in each category against its peers in the same industry to gauge how quality its earnings is.</p>

Parameters:

  • symbol (String)

    Symbol.

  • freq (String)

    Frequency. Currently support &lt;code&gt;annual&lt;/code&gt; and &lt;code&gt;quarterly&lt;/code&gt;

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

    the optional parameters

Returns:



381
382
383
384
# File 'lib/finnhub_ruby/api/default_api.rb', line 381

def company_earnings_quality_score(symbol, freq, opts = {})
  data, _status_code, _headers = company_earnings_quality_score_with_http_info(symbol, freq, opts)
  data
end

#company_earnings_quality_score_with_http_info(symbol, freq, opts = {}) ⇒ Array<(CompanyEarningsQualityScore, Integer, Hash)>

Company Earnings Quality Score &lt;p&gt;This endpoint provides Earnings Quality Score for global companies.&lt;/p&gt;&lt;p&gt; Earnings quality refers to the extent to which current earnings predict future earnings. &quot;High-quality&quot; earnings are expected to persist, while &quot;low-quality&quot; earnings do not. A higher score means a higher earnings quality&lt;/p&gt;&lt;p&gt;Finnhub uses a proprietary model which takes into consideration 4 criteria:&lt;/p&gt; &lt;ul style&#x3D;&quot;list-style-type: unset; margin-left: 30px;&quot;&gt;&lt;li&gt;Profitability&lt;/li&gt;&lt;li&gt;Growth&lt;/li&gt;&lt;li&gt;Cash Generation &amp; Capital Allocation&lt;/li&gt;&lt;li&gt;Leverage&lt;/li&gt;&lt;/ul&gt;&lt;br/&gt;&lt;p&gt;We then compare the metrics of each company in each category against its peers in the same industry to gauge how quality its earnings is.&lt;/p&gt;

Parameters:

  • symbol (String)

    Symbol.

  • freq (String)

    Frequency. Currently support &lt;code&gt;annual&lt;/code&gt; and &lt;code&gt;quarterly&lt;/code&gt;

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

    the optional parameters

Returns:

  • (Array<(CompanyEarningsQualityScore, Integer, Hash)>)

    CompanyEarningsQualityScore data, response status code and response headers



392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
# File 'lib/finnhub_ruby/api/default_api.rb', line 392

def company_earnings_quality_score_with_http_info(symbol, freq, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_earnings_quality_score ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_earnings_quality_score"
  end
  # verify the required parameter 'freq' is set
  if @api_client.config.client_side_validation && freq.nil?
    fail ArgumentError, "Missing the required parameter 'freq' when calling DefaultApi.company_earnings_quality_score"
  end
  # resource path
  local_var_path = '/stock/earnings-quality-score'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'freq'] = freq

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CompanyEarningsQualityScore'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_earnings_quality_score",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_earnings_quality_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_earnings_with_http_info(symbol, opts = {}) ⇒ Array<(Array<EarningResult>, Integer, Hash)>

Earnings Surprises Get company historical quarterly earnings surprise going back to 2000.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit number of period returned. Leave blank to get the full history.

Returns:

  • (Array<(Array<EarningResult>, Integer, Hash)>)

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



325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
# File 'lib/finnhub_ruby/api/default_api.rb', line 325

def company_earnings_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_earnings ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_earnings"
  end
  # resource path
  local_var_path = '/stock/earnings'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<EarningResult>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_earnings",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_earnings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_ebit_estimates(symbol, opts = {}) ⇒ EbitEstimates

EBIT Estimates Get company’s ebit estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:



452
453
454
455
# File 'lib/finnhub_ruby/api/default_api.rb', line 452

def company_ebit_estimates(symbol, opts = {})
  data, _status_code, _headers = company_ebit_estimates_with_http_info(symbol, opts)
  data
end

#company_ebit_estimates_with_http_info(symbol, opts = {}) ⇒ Array<(EbitEstimates, Integer, Hash)>

EBIT Estimates Get company&#39;s ebit estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:

  • (Array<(EbitEstimates, Integer, Hash)>)

    EbitEstimates data, response status code and response headers



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
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
# File 'lib/finnhub_ruby/api/default_api.rb', line 463

def company_ebit_estimates_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_ebit_estimates ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_ebit_estimates"
  end
  # resource path
  local_var_path = '/stock/ebit-estimate'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EbitEstimates'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_ebit_estimates",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_ebit_estimates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_ebitda_estimates(symbol, opts = {}) ⇒ EbitdaEstimates

EBITDA Estimates Get company’s ebitda estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:



519
520
521
522
# File 'lib/finnhub_ruby/api/default_api.rb', line 519

def company_ebitda_estimates(symbol, opts = {})
  data, _status_code, _headers = company_ebitda_estimates_with_http_info(symbol, opts)
  data
end

#company_ebitda_estimates_with_http_info(symbol, opts = {}) ⇒ Array<(EbitdaEstimates, Integer, Hash)>

EBITDA Estimates Get company&#39;s ebitda estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:

  • (Array<(EbitdaEstimates, Integer, Hash)>)

    EbitdaEstimates data, response status code and response headers



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
567
568
569
570
571
572
573
574
575
576
577
578
# File 'lib/finnhub_ruby/api/default_api.rb', line 530

def company_ebitda_estimates_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_ebitda_estimates ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_ebitda_estimates"
  end
  # resource path
  local_var_path = '/stock/ebitda-estimate'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EbitdaEstimates'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_ebitda_estimates",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_ebitda_estimates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_eps_estimates(symbol, opts = {}) ⇒ EarningsEstimates

Earnings Estimates Get company’s EPS estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:



586
587
588
589
# File 'lib/finnhub_ruby/api/default_api.rb', line 586

def company_eps_estimates(symbol, opts = {})
  data, _status_code, _headers = company_eps_estimates_with_http_info(symbol, opts)
  data
end

#company_eps_estimates_with_http_info(symbol, opts = {}) ⇒ Array<(EarningsEstimates, Integer, Hash)>

Earnings Estimates Get company&#39;s EPS estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:

  • (Array<(EarningsEstimates, Integer, Hash)>)

    EarningsEstimates data, response status code and response headers



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
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
# File 'lib/finnhub_ruby/api/default_api.rb', line 597

def company_eps_estimates_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_eps_estimates ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_eps_estimates"
  end
  # resource path
  local_var_path = '/stock/eps-estimate'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EarningsEstimates'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_eps_estimates",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_eps_estimates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_esg_score(symbol, opts = {}) ⇒ CompanyESG

Company ESG Scores <p>This endpoint provides ESG scores and important indicators for 1000+ global companies. The data is collected through company’s public ESG disclosure and public sources.</p><p>Our ESG scoring models takes into account more than 150 different inputs to calculate the level of ESG risks and how well a company is managing them. A higher score means lower ESG risk or better ESG management. ESG scores are in the the range of 0-100. Some key indicators might contain letter-grade score from C- to A+ with C- is the lowest score and A+ is the highest score.</p>

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:



652
653
654
655
# File 'lib/finnhub_ruby/api/default_api.rb', line 652

def company_esg_score(symbol, opts = {})
  data, _status_code, _headers = company_esg_score_with_http_info(symbol, opts)
  data
end

#company_esg_score_with_http_info(symbol, opts = {}) ⇒ Array<(CompanyESG, Integer, Hash)>

Company ESG Scores &lt;p&gt;This endpoint provides ESG scores and important indicators for 1000+ global companies. The data is collected through company&#39;s public ESG disclosure and public sources.&lt;/p&gt;&lt;p&gt;Our ESG scoring models takes into account more than 150 different inputs to calculate the level of ESG risks and how well a company is managing them. A higher score means lower ESG risk or better ESG management. ESG scores are in the the range of 0-100. Some key indicators might contain letter-grade score from C- to A+ with C- is the lowest score and A+ is the highest score.&lt;/p&gt;

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:

  • (Array<(CompanyESG, Integer, Hash)>)

    CompanyESG data, response status code and response headers



662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
# File 'lib/finnhub_ruby/api/default_api.rb', line 662

def company_esg_score_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_esg_score ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_esg_score"
  end
  # resource path
  local_var_path = '/stock/esg'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CompanyESG'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_esg_score",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_esg_score\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_executive(symbol, opts = {}) ⇒ CompanyExecutive

Company Executive Get a list of company’s executives and members of the Board.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:



716
717
718
719
# File 'lib/finnhub_ruby/api/default_api.rb', line 716

def company_executive(symbol, opts = {})
  data, _status_code, _headers = company_executive_with_http_info(symbol, opts)
  data
end

#company_executive_with_http_info(symbol, opts = {}) ⇒ Array<(CompanyExecutive, Integer, Hash)>

Company Executive Get a list of company&#39;s executives and members of the Board.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:

  • (Array<(CompanyExecutive, Integer, Hash)>)

    CompanyExecutive data, response status code and response headers



726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
# File 'lib/finnhub_ruby/api/default_api.rb', line 726

def company_executive_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_executive ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_executive"
  end
  # resource path
  local_var_path = '/stock/executive'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CompanyExecutive'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_executive",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_executive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_news(symbol, from, to, opts = {}) ⇒ Array<CompanyNews>

Company News List latest company news by symbol. This endpoint is only available for North American companies.

Parameters:

  • symbol (String)

    Company symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

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

    the optional parameters

Returns:



782
783
784
785
# File 'lib/finnhub_ruby/api/default_api.rb', line 782

def company_news(symbol, from, to, opts = {})
  data, _status_code, _headers = company_news_with_http_info(symbol, from, to, opts)
  data
end

#company_news_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(Array<CompanyNews>, Integer, Hash)>

Company News List latest company news by symbol. This endpoint is only available for North American companies.

Parameters:

  • symbol (String)

    Company symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

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

    the optional parameters

Returns:

  • (Array<(Array<CompanyNews>, Integer, Hash)>)

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



794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'lib/finnhub_ruby/api/default_api.rb', line 794

def company_news_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_news ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_news"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.company_news"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.company_news"
  end
  # resource path
  local_var_path = '/company-news'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CompanyNews>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_news",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_peers(symbol, opts = {}) ⇒ Array<String>

Peers Get company peers. Return a list of peers in the same country and sub-industry

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:

  • (Array<String>)


858
859
860
861
# File 'lib/finnhub_ruby/api/default_api.rb', line 858

def company_peers(symbol, opts = {})
  data, _status_code, _headers = company_peers_with_http_info(symbol, opts)
  data
end

#company_peers_with_http_info(symbol, opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>

Peers Get company peers. Return a list of peers in the same country and sub-industry

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:

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

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



868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
# File 'lib/finnhub_ruby/api/default_api.rb', line 868

def company_peers_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_peers ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_peers"
  end
  # resource path
  local_var_path = '/stock/peers'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<String>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_peers",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_peers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_profile(opts = {}) ⇒ CompanyProfile

Company Profile Get general information of a company. You can query by symbol, ISIN or CUSIP

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol of the company: AAPL e.g.

  • :isin (String)

    ISIN

  • :cusip (String)

    CUSIP

Returns:



924
925
926
927
# File 'lib/finnhub_ruby/api/default_api.rb', line 924

def company_profile(opts = {})
  data, _status_code, _headers = company_profile_with_http_info(opts)
  data
end

#company_profile2(opts = {}) ⇒ CompanyProfile2

Company Profile 2 Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of <a href="#company-profile">Company Profile</a>.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol of the company: AAPL e.g.

  • :isin (String)

    ISIN

  • :cusip (String)

    CUSIP

Returns:



990
991
992
993
# File 'lib/finnhub_ruby/api/default_api.rb', line 990

def company_profile2(opts = {})
  data, _status_code, _headers = company_profile2_with_http_info(opts)
  data
end

#company_profile2_with_http_info(opts = {}) ⇒ Array<(CompanyProfile2, Integer, Hash)>

Company Profile 2 Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of &lt;a href&#x3D;&quot;#company-profile&quot;&gt;Company Profile&lt;/a&gt;.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol of the company: AAPL e.g.

  • :isin (String)

    ISIN

  • :cusip (String)

    CUSIP

Returns:

  • (Array<(CompanyProfile2, Integer, Hash)>)

    CompanyProfile2 data, response status code and response headers



1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/finnhub_ruby/api/default_api.rb', line 1002

def company_profile2_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_profile2 ...'
  end
  # resource path
  local_var_path = '/stock/profile2'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'isin'] = opts[:'isin'] if !opts[:'isin'].nil?
  query_params[:'cusip'] = opts[:'cusip'] if !opts[:'cusip'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CompanyProfile2'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_profile2",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_profile2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_profile_with_http_info(opts = {}) ⇒ Array<(CompanyProfile, Integer, Hash)>

Company Profile Get general information of a company. You can query by symbol, ISIN or CUSIP

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol of the company: AAPL e.g.

  • :isin (String)

    ISIN

  • :cusip (String)

    CUSIP

Returns:

  • (Array<(CompanyProfile, Integer, Hash)>)

    CompanyProfile data, response status code and response headers



936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
# File 'lib/finnhub_ruby/api/default_api.rb', line 936

def company_profile_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_profile ...'
  end
  # resource path
  local_var_path = '/stock/profile'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'isin'] = opts[:'isin'] if !opts[:'isin'].nil?
  query_params[:'cusip'] = opts[:'cusip'] if !opts[:'cusip'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CompanyProfile'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#company_revenue_estimates(symbol, opts = {}) ⇒ RevenueEstimates

Revenue Estimates Get company’s revenue estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:



1055
1056
1057
1058
# File 'lib/finnhub_ruby/api/default_api.rb', line 1055

def company_revenue_estimates(symbol, opts = {})
  data, _status_code, _headers = company_revenue_estimates_with_http_info(symbol, opts)
  data
end

#company_revenue_estimates_with_http_info(symbol, opts = {}) ⇒ Array<(RevenueEstimates, Integer, Hash)>

Revenue Estimates Get company&#39;s revenue estimates.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :freq (String)

    Can take 1 of the following values: &lt;code&gt;annual, quarterly&lt;/code&gt;. Default to &lt;code&gt;quarterly&lt;/code&gt;

Returns:

  • (Array<(RevenueEstimates, Integer, Hash)>)

    RevenueEstimates data, response status code and response headers



1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
# File 'lib/finnhub_ruby/api/default_api.rb', line 1066

def company_revenue_estimates_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.company_revenue_estimates ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_revenue_estimates"
  end
  # resource path
  local_var_path = '/stock/revenue-estimate'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RevenueEstimates'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.company_revenue_estimates",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#company_revenue_estimates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#country(opts = {}) ⇒ Array<CountryMetadata>

Country Metadata List all countries and metadata.

Parameters:

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

    the optional parameters

Returns:



1120
1121
1122
1123
# File 'lib/finnhub_ruby/api/default_api.rb', line 1120

def country(opts = {})
  data, _status_code, _headers = country_with_http_info(opts)
  data
end

#country_with_http_info(opts = {}) ⇒ Array<(Array<CountryMetadata>, Integer, Hash)>

Country Metadata List all countries and metadata.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Array<CountryMetadata>, Integer, Hash)>)

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



1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
# File 'lib/finnhub_ruby/api/default_api.rb', line 1129

def country_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.country ...'
  end
  # resource path
  local_var_path = '/country'

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CountryMetadata>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.country",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#country\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#covid19(opts = {}) ⇒ Array<CovidInfo>

COVID-19 Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API <a href="rapidapi.com/Finnhub/api/finnhub-real-time-covid-19" target="_blank" rel="nofollow">here</a>

Parameters:

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

    the optional parameters

Returns:



1177
1178
1179
1180
# File 'lib/finnhub_ruby/api/default_api.rb', line 1177

def covid19(opts = {})
  data, _status_code, _headers = covid19_with_http_info(opts)
  data
end

#covid19_with_http_info(opts = {}) ⇒ Array<(Array<CovidInfo>, Integer, Hash)>

COVID-19 Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API &lt;a href&#x3D;&quot;rapidapi.com/Finnhub/api/finnhub-real-time-covid-19&quot; target&#x3D;&quot;_blank&quot; rel&#x3D;&quot;nofollow&quot;&gt;here&lt;/a&gt;

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Array<CovidInfo>, Integer, Hash)>)

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



1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
# File 'lib/finnhub_ruby/api/default_api.rb', line 1186

def covid19_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.covid19 ...'
  end
  # resource path
  local_var_path = '/covid19/us'

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CovidInfo>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.covid19",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#covid19\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crypto_candles(symbol, resolution, from, to, opts = {}) ⇒ CryptoCandles

Crypto Candles Get candlestick data for crypto symbols.

Parameters:

  • symbol (String)

    Use symbol returned in &lt;code&gt;/crypto/symbol&lt;/code&gt; endpoint for this field.

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:



1238
1239
1240
1241
# File 'lib/finnhub_ruby/api/default_api.rb', line 1238

def crypto_candles(symbol, resolution, from, to, opts = {})
  data, _status_code, _headers = crypto_candles_with_http_info(symbol, resolution, from, to, opts)
  data
end

#crypto_candles_with_http_info(symbol, resolution, from, to, opts = {}) ⇒ Array<(CryptoCandles, Integer, Hash)>

Crypto Candles Get candlestick data for crypto symbols.

Parameters:

  • symbol (String)

    Use symbol returned in &lt;code&gt;/crypto/symbol&lt;/code&gt; endpoint for this field.

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:

  • (Array<(CryptoCandles, Integer, Hash)>)

    CryptoCandles data, response status code and response headers



1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
# File 'lib/finnhub_ruby/api/default_api.rb', line 1251

def crypto_candles_with_http_info(symbol, resolution, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.crypto_candles ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.crypto_candles"
  end
  # verify the required parameter 'resolution' is set
  if @api_client.config.client_side_validation && resolution.nil?
    fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.crypto_candles"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.crypto_candles"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.crypto_candles"
  end
  # resource path
  local_var_path = '/crypto/candle'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'resolution'] = resolution
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CryptoCandles'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.crypto_candles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#crypto_candles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crypto_exchanges(opts = {}) ⇒ Array<String>

Crypto Exchanges List supported crypto exchanges

Parameters:

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

    the optional parameters

Returns:

  • (Array<String>)


1319
1320
1321
1322
# File 'lib/finnhub_ruby/api/default_api.rb', line 1319

def crypto_exchanges(opts = {})
  data, _status_code, _headers = crypto_exchanges_with_http_info(opts)
  data
end

#crypto_exchanges_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>

Crypto Exchanges List supported crypto exchanges

Parameters:

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

    the optional parameters

Returns:

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

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



1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
# File 'lib/finnhub_ruby/api/default_api.rb', line 1328

def crypto_exchanges_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.crypto_exchanges ...'
  end
  # resource path
  local_var_path = '/crypto/exchange'

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<String>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.crypto_exchanges",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#crypto_exchanges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crypto_profile(symbol, opts = {}) ⇒ CryptoProfile

Crypto Profile Get crypto’s profile.

Parameters:

  • symbol (String)

    Crypto symbol such as BTC or ETH.

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

    the optional parameters

Returns:



1377
1378
1379
1380
# File 'lib/finnhub_ruby/api/default_api.rb', line 1377

def crypto_profile(symbol, opts = {})
  data, _status_code, _headers = crypto_profile_with_http_info(symbol, opts)
  data
end

#crypto_profile_with_http_info(symbol, opts = {}) ⇒ Array<(CryptoProfile, Integer, Hash)>

Crypto Profile Get crypto&#39;s profile.

Parameters:

  • symbol (String)

    Crypto symbol such as BTC or ETH.

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

    the optional parameters

Returns:

  • (Array<(CryptoProfile, Integer, Hash)>)

    CryptoProfile data, response status code and response headers



1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
# File 'lib/finnhub_ruby/api/default_api.rb', line 1387

def crypto_profile_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.crypto_profile ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.crypto_profile"
  end
  # resource path
  local_var_path = '/crypto/profile'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'CryptoProfile'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.crypto_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#crypto_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#crypto_symbols(exchange, opts = {}) ⇒ Array<CryptoSymbol>

Crypto Symbol List supported crypto symbols by exchange

Parameters:

  • exchange (String)

    Exchange you want to get the list of symbols from.

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

    the optional parameters

Returns:



1441
1442
1443
1444
# File 'lib/finnhub_ruby/api/default_api.rb', line 1441

def crypto_symbols(exchange, opts = {})
  data, _status_code, _headers = crypto_symbols_with_http_info(exchange, opts)
  data
end

#crypto_symbols_with_http_info(exchange, opts = {}) ⇒ Array<(Array<CryptoSymbol>, Integer, Hash)>

Crypto Symbol List supported crypto symbols by exchange

Parameters:

  • exchange (String)

    Exchange you want to get the list of symbols from.

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

    the optional parameters

Returns:

  • (Array<(Array<CryptoSymbol>, Integer, Hash)>)

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



1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
# File 'lib/finnhub_ruby/api/default_api.rb', line 1451

def crypto_symbols_with_http_info(exchange, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.crypto_symbols ...'
  end
  # verify the required parameter 'exchange' is set
  if @api_client.config.client_side_validation && exchange.nil?
    fail ArgumentError, "Missing the required parameter 'exchange' when calling DefaultApi.crypto_symbols"
  end
  # resource path
  local_var_path = '/crypto/symbol'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'exchange'] = exchange

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<CryptoSymbol>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.crypto_symbols",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#crypto_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#earnings_calendar(opts = {}) ⇒ EarningsCalendar

Earnings Calendar Get historical and coming earnings release. EPS and Revenue in this endpoint are non-GAAP, which means they are adjusted to exclude some one-time or unusual items. This is the same data investors usually react to and talked about on the media. Estimates are sourced from both sell-side and buy-side analysts.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date: 2020-03-15.

  • :to (Date)

    To date: 2020-03-16.

  • :symbol (String)

    Filter by symbol: AAPL.

  • :international (Boolean)

    Set to &lt;code&gt;true&lt;/code&gt; to include international markets. Default value is &lt;code&gt;false&lt;/code&gt;

Returns:



1508
1509
1510
1511
# File 'lib/finnhub_ruby/api/default_api.rb', line 1508

def earnings_calendar(opts = {})
  data, _status_code, _headers = earnings_calendar_with_http_info(opts)
  data
end

#earnings_calendar_with_http_info(opts = {}) ⇒ Array<(EarningsCalendar, Integer, Hash)>

Earnings Calendar Get historical and coming earnings release. EPS and Revenue in this endpoint are non-GAAP, which means they are adjusted to exclude some one-time or unusual items. This is the same data investors usually react to and talked about on the media. Estimates are sourced from both sell-side and buy-side analysts.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date: 2020-03-15.

  • :to (Date)

    To date: 2020-03-16.

  • :symbol (String)

    Filter by symbol: AAPL.

  • :international (Boolean)

    Set to &lt;code&gt;true&lt;/code&gt; to include international markets. Default value is &lt;code&gt;false&lt;/code&gt;

Returns:

  • (Array<(EarningsCalendar, Integer, Hash)>)

    EarningsCalendar data, response status code and response headers



1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
# File 'lib/finnhub_ruby/api/default_api.rb', line 1521

def earnings_calendar_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.earnings_calendar ...'
  end
  # resource path
  local_var_path = '/calendar/earnings'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'international'] = opts[:'international'] if !opts[:'international'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EarningsCalendar'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.earnings_calendar",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#earnings_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#economic_calendar(opts = {}) ⇒ EconomicCalendar

Economic Calendar <p>Get recent and upcoming economic releases.</p><p>Historical events and surprises are available for Enterprise clients.</p>

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • :to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

Returns:



1575
1576
1577
1578
# File 'lib/finnhub_ruby/api/default_api.rb', line 1575

def economic_calendar(opts = {})
  data, _status_code, _headers = economic_calendar_with_http_info(opts)
  data
end

#economic_calendar_with_http_info(opts = {}) ⇒ Array<(EconomicCalendar, Integer, Hash)>

Economic Calendar &lt;p&gt;Get recent and upcoming economic releases.&lt;/p&gt;&lt;p&gt;Historical events and surprises are available for Enterprise clients.&lt;/p&gt;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • :to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

Returns:

  • (Array<(EconomicCalendar, Integer, Hash)>)

    EconomicCalendar data, response status code and response headers



1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
# File 'lib/finnhub_ruby/api/default_api.rb', line 1586

def economic_calendar_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.economic_calendar ...'
  end
  # resource path
  local_var_path = '/calendar/economic'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EconomicCalendar'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.economic_calendar",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#economic_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#economic_code(opts = {}) ⇒ Array<EconomicCode>

Economic Code List codes of supported economic data.

Parameters:

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

    the optional parameters

Returns:



1636
1637
1638
1639
# File 'lib/finnhub_ruby/api/default_api.rb', line 1636

def economic_code(opts = {})
  data, _status_code, _headers = economic_code_with_http_info(opts)
  data
end

#economic_code_with_http_info(opts = {}) ⇒ Array<(Array<EconomicCode>, Integer, Hash)>

Economic Code List codes of supported economic data.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Array<EconomicCode>, Integer, Hash)>)

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



1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
# File 'lib/finnhub_ruby/api/default_api.rb', line 1645

def economic_code_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.economic_code ...'
  end
  # resource path
  local_var_path = '/economic/code'

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<EconomicCode>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.economic_code",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#economic_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#economic_data(code, opts = {}) ⇒ EconomicData

Economic Data Get economic data.

Parameters:

  • code (String)

    Economic code.

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

    the optional parameters

Returns:



1694
1695
1696
1697
# File 'lib/finnhub_ruby/api/default_api.rb', line 1694

def economic_data(code, opts = {})
  data, _status_code, _headers = economic_data_with_http_info(code, opts)
  data
end

#economic_data_with_http_info(code, opts = {}) ⇒ Array<(EconomicData, Integer, Hash)>

Economic Data Get economic data.

Parameters:

  • code (String)

    Economic code.

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

    the optional parameters

Returns:

  • (Array<(EconomicData, Integer, Hash)>)

    EconomicData data, response status code and response headers



1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
# File 'lib/finnhub_ruby/api/default_api.rb', line 1704

def economic_data_with_http_info(code, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.economic_data ...'
  end
  # verify the required parameter 'code' is set
  if @api_client.config.client_side_validation && code.nil?
    fail ArgumentError, "Missing the required parameter 'code' when calling DefaultApi.economic_data"
  end
  # resource path
  local_var_path = '/economic'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'code'] = code

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EconomicData'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.economic_data",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#economic_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#etfs_country_exposure(symbol, opts = {}) ⇒ ETFsCountryExposure

ETFs Country Exposure Get ETF country exposure data.

Parameters:

  • symbol (String)

    ETF symbol.

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

    the optional parameters

Returns:



1758
1759
1760
1761
# File 'lib/finnhub_ruby/api/default_api.rb', line 1758

def etfs_country_exposure(symbol, opts = {})
  data, _status_code, _headers = etfs_country_exposure_with_http_info(symbol, opts)
  data
end

#etfs_country_exposure_with_http_info(symbol, opts = {}) ⇒ Array<(ETFsCountryExposure, Integer, Hash)>

ETFs Country Exposure Get ETF country exposure data.

Parameters:

  • symbol (String)

    ETF symbol.

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

    the optional parameters

Returns:

  • (Array<(ETFsCountryExposure, Integer, Hash)>)

    ETFsCountryExposure data, response status code and response headers



1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
# File 'lib/finnhub_ruby/api/default_api.rb', line 1768

def etfs_country_exposure_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_country_exposure ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.etfs_country_exposure"
  end
  # resource path
  local_var_path = '/etf/country'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ETFsCountryExposure'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.etfs_country_exposure",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#etfs_country_exposure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#etfs_holdings(opts = {}) ⇒ ETFsHoldings

ETFs Holdings Get full ETF holdings/constituents. This endpoint has global coverage. Widget only shows top 10 holdings.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    ETF symbol.

  • :isin (String)

    ETF isin.

  • :skip (Integer)

    Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip&#x3D;0 or not set.

  • :date (String)

    Query holdings by date. You can use either this param or &lt;code&gt;skip&lt;/code&gt; param, not both.

Returns:



1825
1826
1827
1828
# File 'lib/finnhub_ruby/api/default_api.rb', line 1825

def etfs_holdings(opts = {})
  data, _status_code, _headers = etfs_holdings_with_http_info(opts)
  data
end

#etfs_holdings_with_http_info(opts = {}) ⇒ Array<(ETFsHoldings, Integer, Hash)>

ETFs Holdings Get full ETF holdings/constituents. This endpoint has global coverage. Widget only shows top 10 holdings.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    ETF symbol.

  • :isin (String)

    ETF isin.

  • :skip (Integer)

    Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip&#x3D;0 or not set.

  • :date (String)

    Query holdings by date. You can use either this param or &lt;code&gt;skip&lt;/code&gt; param, not both.

Returns:

  • (Array<(ETFsHoldings, Integer, Hash)>)

    ETFsHoldings data, response status code and response headers



1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
# File 'lib/finnhub_ruby/api/default_api.rb', line 1838

def etfs_holdings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_holdings ...'
  end
  # resource path
  local_var_path = '/etf/holdings'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'isin'] = opts[:'isin'] if !opts[:'isin'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?
  query_params[:'date'] = opts[:'date'] if !opts[:'date'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ETFsHoldings'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.etfs_holdings",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#etfs_holdings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#etfs_profile(opts = {}) ⇒ ETFsProfile

ETFs Profile Get ETF profile information. This endpoint has global coverage.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    ETF symbol.

  • :isin (String)

    ETF isin.

Returns:



1892
1893
1894
1895
# File 'lib/finnhub_ruby/api/default_api.rb', line 1892

def etfs_profile(opts = {})
  data, _status_code, _headers = etfs_profile_with_http_info(opts)
  data
end

#etfs_profile_with_http_info(opts = {}) ⇒ Array<(ETFsProfile, Integer, Hash)>

ETFs Profile Get ETF profile information. This endpoint has global coverage.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    ETF symbol.

  • :isin (String)

    ETF isin.

Returns:

  • (Array<(ETFsProfile, Integer, Hash)>)

    ETFsProfile data, response status code and response headers



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

def etfs_profile_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_profile ...'
  end
  # resource path
  local_var_path = '/etf/profile'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ETFsProfile'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.etfs_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#etfs_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#etfs_sector_exposure(symbol, opts = {}) ⇒ ETFsSectorExposure

ETFs Sector Exposure Get ETF sector exposure data.

Parameters:

  • symbol (String)

    ETF symbol.

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

    the optional parameters

Returns:



1954
1955
1956
1957
# File 'lib/finnhub_ruby/api/default_api.rb', line 1954

def etfs_sector_exposure(symbol, opts = {})
  data, _status_code, _headers = etfs_sector_exposure_with_http_info(symbol, opts)
  data
end

#etfs_sector_exposure_with_http_info(symbol, opts = {}) ⇒ Array<(ETFsSectorExposure, Integer, Hash)>

ETFs Sector Exposure Get ETF sector exposure data.

Parameters:

  • symbol (String)

    ETF symbol.

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

    the optional parameters

Returns:

  • (Array<(ETFsSectorExposure, Integer, Hash)>)

    ETFsSectorExposure data, response status code and response headers



1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
# File 'lib/finnhub_ruby/api/default_api.rb', line 1964

def etfs_sector_exposure_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.etfs_sector_exposure ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.etfs_sector_exposure"
  end
  # resource path
  local_var_path = '/etf/sector'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ETFsSectorExposure'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.etfs_sector_exposure",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#etfs_sector_exposure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fda_committee_meeting_calendar(opts = {}) ⇒ Array<FDAComitteeMeeting>

FDA Committee Meeting Calendar FDA’s advisory committees are established to provide functions which support the agency’s mission of protecting and promoting the public health, while meeting the requirements set forth in the Federal Advisory Committee Act. Committees are either mandated by statute or established at the discretion of the Department of Health and Human Services. Each committee is subject to renewal at two-year intervals unless the committee charter states otherwise.

Parameters:

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

    the optional parameters

Returns:



2017
2018
2019
2020
# File 'lib/finnhub_ruby/api/default_api.rb', line 2017

def fda_committee_meeting_calendar(opts = {})
  data, _status_code, _headers = fda_committee_meeting_calendar_with_http_info(opts)
  data
end

#fda_committee_meeting_calendar_with_http_info(opts = {}) ⇒ Array<(Array<FDAComitteeMeeting>, Integer, Hash)>

FDA Committee Meeting Calendar FDA&#39;s advisory committees are established to provide functions which support the agency&#39;s mission of protecting and promoting the public health, while meeting the requirements set forth in the Federal Advisory Committee Act. Committees are either mandated by statute or established at the discretion of the Department of Health and Human Services. Each committee is subject to renewal at two-year intervals unless the committee charter states otherwise.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(Array<FDAComitteeMeeting>, Integer, Hash)>)

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



2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
# File 'lib/finnhub_ruby/api/default_api.rb', line 2026

def fda_committee_meeting_calendar_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.fda_committee_meeting_calendar ...'
  end
  # resource path
  local_var_path = '/fda-advisory-committee-calendar'

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<FDAComitteeMeeting>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.fda_committee_meeting_calendar",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#fda_committee_meeting_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#filings(opts = {}) ⇒ Array<Filing>

SEC Filings List company’s filing. Limit to 250 documents at a time. This data is available for bulk download on <a href="www.kaggle.com/finnhub/sec-filings" target="_blank">Kaggle SEC Filings database</a>.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol. Leave &lt;code&gt;symbol&lt;/code&gt;,&lt;code&gt;cik&lt;/code&gt; and &lt;code&gt;accessNumber&lt;/code&gt; empty to list latest filings.

  • :cik (String)

    CIK.

  • :access_number (String)

    Access number of a specific report you want to retrieve data from.

  • :form (String)

    Filter by form. You can use this value &lt;code&gt;NT 10-K&lt;/code&gt; to find non-timely filings for a company.

  • :from (Date)

    From date: 2020-03-15.

  • :to (Date)

    To date: 2020-03-16.

Returns:



2080
2081
2082
2083
# File 'lib/finnhub_ruby/api/default_api.rb', line 2080

def filings(opts = {})
  data, _status_code, _headers = filings_with_http_info(opts)
  data
end

#filings_sentiment(access_number, opts = {}) ⇒ SECSentimentAnalysis

SEC Sentiment Analysis Get sentiment analysis of 10-K and 10-Q filings from SEC. An abnormal increase in the number of positive/negative words in filings can signal a significant change in the company’s stock price in the upcoming 4 quarters. We make use of <a href= "sraf.nd.edu/textual-analysis/resources/" target="_blank">Loughran and McDonald Sentiment Word Lists</a> to calculate the sentiment for each filing.

Parameters:

  • access_number (String)

    Access number of a specific report you want to retrieve data from.

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

    the optional parameters

Returns:



2150
2151
2152
2153
# File 'lib/finnhub_ruby/api/default_api.rb', line 2150

def filings_sentiment(access_number, opts = {})
  data, _status_code, _headers = filings_sentiment_with_http_info(access_number, opts)
  data
end

#filings_sentiment_with_http_info(access_number, opts = {}) ⇒ Array<(SECSentimentAnalysis, Integer, Hash)>

SEC Sentiment Analysis Get sentiment analysis of 10-K and 10-Q filings from SEC. An abnormal increase in the number of positive/negative words in filings can signal a significant change in the company&#39;s stock price in the upcoming 4 quarters. We make use of &lt;a href&#x3D; &quot;sraf.nd.edu/textual-analysis/resources/&quot; target&#x3D;&quot;_blank&quot;&gt;Loughran and McDonald Sentiment Word Lists&lt;/a&gt; to calculate the sentiment for each filing.

Parameters:

  • access_number (String)

    Access number of a specific report you want to retrieve data from.

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

    the optional parameters

Returns:

  • (Array<(SECSentimentAnalysis, Integer, Hash)>)

    SECSentimentAnalysis data, response status code and response headers



2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
# File 'lib/finnhub_ruby/api/default_api.rb', line 2160

def filings_sentiment_with_http_info(access_number, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.filings_sentiment ...'
  end
  # verify the required parameter 'access_number' is set
  if @api_client.config.client_side_validation && access_number.nil?
    fail ArgumentError, "Missing the required parameter 'access_number' when calling DefaultApi.filings_sentiment"
  end
  # resource path
  local_var_path = '/stock/filings-sentiment'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'accessNumber'] = access_number

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SECSentimentAnalysis'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.filings_sentiment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#filings_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#filings_with_http_info(opts = {}) ⇒ Array<(Array<Filing>, Integer, Hash)>

SEC Filings List company&#39;s filing. Limit to 250 documents at a time. This data is available for bulk download on &lt;a href&#x3D;&quot;www.kaggle.com/finnhub/sec-filings&quot; target&#x3D;&quot;_blank&quot;&gt;Kaggle SEC Filings database&lt;/a&gt;.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol. Leave &lt;code&gt;symbol&lt;/code&gt;,&lt;code&gt;cik&lt;/code&gt; and &lt;code&gt;accessNumber&lt;/code&gt; empty to list latest filings.

  • :cik (String)

    CIK.

  • :access_number (String)

    Access number of a specific report you want to retrieve data from.

  • :form (String)

    Filter by form. You can use this value &lt;code&gt;NT 10-K&lt;/code&gt; to find non-timely filings for a company.

  • :from (Date)

    From date: 2020-03-15.

  • :to (Date)

    To date: 2020-03-16.

Returns:

  • (Array<(Array<Filing>, Integer, Hash)>)

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



2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
# File 'lib/finnhub_ruby/api/default_api.rb', line 2095

def filings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.filings ...'
  end
  # resource path
  local_var_path = '/stock/filings'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'cik'] = opts[:'cik'] if !opts[:'cik'].nil?
  query_params[:'accessNumber'] = opts[:'access_number'] if !opts[:'access_number'].nil?
  query_params[:'form'] = opts[:'form'] if !opts[:'form'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Filing>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.filings",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#filings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#financials(symbol, statement, freq, opts = {}) ⇒ FinancialStatements

Financial Statements <p>Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years. Data is sourced from original filings most of which made available through <a href="#filings">SEC Filings</a> and <a href="#international-filings">International Filings</a> endpoints.</p><p>Wondering why our standardized data is different from Bloomberg, Reuters, Factset, S&P or Yahoo Finance ? Check out our <a href="/faq">FAQ page</a> to learn more</p>

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

  • statement (String)

    Statement can take 1 of these values &lt;code&gt;bs, ic, cf&lt;/code&gt; for Balance Sheet, Income Statement, Cash Flow respectively.

  • freq (String)

    Frequency can take 1 of these values &lt;code&gt;annual, quarterly, ttm, ytd&lt;/code&gt;. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow.

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

    the optional parameters

Returns:



2216
2217
2218
2219
# File 'lib/finnhub_ruby/api/default_api.rb', line 2216

def financials(symbol, statement, freq, opts = {})
  data, _status_code, _headers = financials_with_http_info(symbol, statement, freq, opts)
  data
end

#financials_reported(opts = {}) ⇒ FinancialsAsReported

Financials As Reported Get financials as reported. This data is available for bulk download on <a href="www.kaggle.com/finnhub/reported-financials" target="_blank">Kaggle SEC Financials database</a>.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol.

  • :cik (String)

    CIK.

  • :access_number (String)

    Access number of a specific report you want to retrieve financials from.

  • :freq (String)

    Frequency. Can be either &lt;code&gt;annual&lt;/code&gt; or &lt;code&gt;quarterly&lt;/code&gt;. Default to &lt;code&gt;annual&lt;/code&gt;.

Returns:



2295
2296
2297
2298
# File 'lib/finnhub_ruby/api/default_api.rb', line 2295

def financials_reported(opts = {})
  data, _status_code, _headers = financials_reported_with_http_info(opts)
  data
end

#financials_reported_with_http_info(opts = {}) ⇒ Array<(FinancialsAsReported, Integer, Hash)>

Financials As Reported Get financials as reported. This data is available for bulk download on &lt;a href&#x3D;&quot;www.kaggle.com/finnhub/reported-financials&quot; target&#x3D;&quot;_blank&quot;&gt;Kaggle SEC Financials database&lt;/a&gt;.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol.

  • :cik (String)

    CIK.

  • :access_number (String)

    Access number of a specific report you want to retrieve financials from.

  • :freq (String)

    Frequency. Can be either &lt;code&gt;annual&lt;/code&gt; or &lt;code&gt;quarterly&lt;/code&gt;. Default to &lt;code&gt;annual&lt;/code&gt;.

Returns:

  • (Array<(FinancialsAsReported, Integer, Hash)>)

    FinancialsAsReported data, response status code and response headers



2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
# File 'lib/finnhub_ruby/api/default_api.rb', line 2308

def financials_reported_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.financials_reported ...'
  end
  # resource path
  local_var_path = '/stock/financials-reported'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'cik'] = opts[:'cik'] if !opts[:'cik'].nil?
  query_params[:'accessNumber'] = opts[:'access_number'] if !opts[:'access_number'].nil?
  query_params[:'freq'] = opts[:'freq'] if !opts[:'freq'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FinancialsAsReported'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.financials_reported",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#financials_reported\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#financials_with_http_info(symbol, statement, freq, opts = {}) ⇒ Array<(FinancialStatements, Integer, Hash)>

Financial Statements &lt;p&gt;Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years. Data is sourced from original filings most of which made available through &lt;a href&#x3D;&quot;#filings&quot;&gt;SEC Filings&lt;/a&gt; and &lt;a href&#x3D;&quot;#international-filings&quot;&gt;International Filings&lt;/a&gt; endpoints.&lt;/p&gt;&lt;p&gt;&lt;i&gt;Wondering why our standardized data is different from Bloomberg, Reuters, Factset, S&amp;P or Yahoo Finance ? Check out our &lt;a href&#x3D;&quot;/faq&quot;&gt;FAQ page&lt;/a&gt; to learn more&lt;/i&gt;&lt;/p&gt;

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

  • statement (String)

    Statement can take 1 of these values &lt;code&gt;bs, ic, cf&lt;/code&gt; for Balance Sheet, Income Statement, Cash Flow respectively.

  • freq (String)

    Frequency can take 1 of these values &lt;code&gt;annual, quarterly, ttm, ytd&lt;/code&gt;. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow.

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

    the optional parameters

Returns:

  • (Array<(FinancialStatements, Integer, Hash)>)

    FinancialStatements data, response status code and response headers



2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
# File 'lib/finnhub_ruby/api/default_api.rb', line 2228

def financials_with_http_info(symbol, statement, freq, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.financials ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.financials"
  end
  # verify the required parameter 'statement' is set
  if @api_client.config.client_side_validation && statement.nil?
    fail ArgumentError, "Missing the required parameter 'statement' when calling DefaultApi.financials"
  end
  # verify the required parameter 'freq' is set
  if @api_client.config.client_side_validation && freq.nil?
    fail ArgumentError, "Missing the required parameter 'freq' when calling DefaultApi.financials"
  end
  # resource path
  local_var_path = '/stock/financials'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'statement'] = statement
  query_params[:'freq'] = freq

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FinancialStatements'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.financials",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#financials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#forex_candles(symbol, resolution, from, to, opts = {}) ⇒ ForexCandles

Forex Candles Get candlestick data for forex symbols.

Parameters:

  • symbol (String)

    Use symbol returned in &lt;code&gt;/forex/symbol&lt;/code&gt; endpoint for this field.

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:



2364
2365
2366
2367
# File 'lib/finnhub_ruby/api/default_api.rb', line 2364

def forex_candles(symbol, resolution, from, to, opts = {})
  data, _status_code, _headers = forex_candles_with_http_info(symbol, resolution, from, to, opts)
  data
end

#forex_candles_with_http_info(symbol, resolution, from, to, opts = {}) ⇒ Array<(ForexCandles, Integer, Hash)>

Forex Candles Get candlestick data for forex symbols.

Parameters:

  • symbol (String)

    Use symbol returned in &lt;code&gt;/forex/symbol&lt;/code&gt; endpoint for this field.

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:

  • (Array<(ForexCandles, Integer, Hash)>)

    ForexCandles data, response status code and response headers



2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
# File 'lib/finnhub_ruby/api/default_api.rb', line 2377

def forex_candles_with_http_info(symbol, resolution, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.forex_candles ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.forex_candles"
  end
  # verify the required parameter 'resolution' is set
  if @api_client.config.client_side_validation && resolution.nil?
    fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.forex_candles"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.forex_candles"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.forex_candles"
  end
  # resource path
  local_var_path = '/forex/candle'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'resolution'] = resolution
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ForexCandles'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.forex_candles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#forex_candles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#forex_exchanges(opts = {}) ⇒ Array<String>

Forex Exchanges List supported forex exchanges

Parameters:

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

    the optional parameters

Returns:

  • (Array<String>)


2445
2446
2447
2448
# File 'lib/finnhub_ruby/api/default_api.rb', line 2445

def forex_exchanges(opts = {})
  data, _status_code, _headers = forex_exchanges_with_http_info(opts)
  data
end

#forex_exchanges_with_http_info(opts = {}) ⇒ Array<(Array<String>, Integer, Hash)>

Forex Exchanges List supported forex exchanges

Parameters:

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

    the optional parameters

Returns:

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

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



2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
# File 'lib/finnhub_ruby/api/default_api.rb', line 2454

def forex_exchanges_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.forex_exchanges ...'
  end
  # resource path
  local_var_path = '/forex/exchange'

  # query parameters
  query_params = opts[:query_params] || {}

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<String>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.forex_exchanges",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#forex_exchanges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#forex_rates(opts = {}) ⇒ Forexrates

Forex rates Get rates for all forex pairs. Ideal for currency conversion

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :base (String)

    Base currency. Default to EUR.

  • :date (String)

    Date. Leave blank to get the latest data.

Returns:



2504
2505
2506
2507
# File 'lib/finnhub_ruby/api/default_api.rb', line 2504

def forex_rates(opts = {})
  data, _status_code, _headers = forex_rates_with_http_info(opts)
  data
end

#forex_rates_with_http_info(opts = {}) ⇒ Array<(Forexrates, Integer, Hash)>

Forex rates Get rates for all forex pairs. Ideal for currency conversion

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :base (String)

    Base currency. Default to EUR.

  • :date (String)

    Date. Leave blank to get the latest data.

Returns:

  • (Array<(Forexrates, Integer, Hash)>)

    Forexrates data, response status code and response headers



2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
# File 'lib/finnhub_ruby/api/default_api.rb', line 2515

def forex_rates_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.forex_rates ...'
  end
  # resource path
  local_var_path = '/forex/rates'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Forexrates'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.forex_rates",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#forex_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#forex_symbols(exchange, opts = {}) ⇒ Array<ForexSymbol>

Forex Symbol List supported forex symbols.

Parameters:

  • exchange (String)

    Exchange you want to get the list of symbols from.

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

    the optional parameters

Returns:



2566
2567
2568
2569
# File 'lib/finnhub_ruby/api/default_api.rb', line 2566

def forex_symbols(exchange, opts = {})
  data, _status_code, _headers = forex_symbols_with_http_info(exchange, opts)
  data
end

#forex_symbols_with_http_info(exchange, opts = {}) ⇒ Array<(Array<ForexSymbol>, Integer, Hash)>

Forex Symbol List supported forex symbols.

Parameters:

  • exchange (String)

    Exchange you want to get the list of symbols from.

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

    the optional parameters

Returns:

  • (Array<(Array<ForexSymbol>, Integer, Hash)>)

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



2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
# File 'lib/finnhub_ruby/api/default_api.rb', line 2576

def forex_symbols_with_http_info(exchange, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.forex_symbols ...'
  end
  # verify the required parameter 'exchange' is set
  if @api_client.config.client_side_validation && exchange.nil?
    fail ArgumentError, "Missing the required parameter 'exchange' when calling DefaultApi.forex_symbols"
  end
  # resource path
  local_var_path = '/forex/symbol'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'exchange'] = exchange

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<ForexSymbol>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.forex_symbols",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#forex_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#fund_ownership(symbol, opts = {}) ⇒ FundOwnership

Fund Ownership Get a full list fund and institutional investors of a company in descending order of the number of shares held. Data is sourced from 13F form, Schedule 13D and 13G for US market, UK Share Register for UK market, SEDI for Canadian market and equivalent filings for other international markets.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit number of results. Leave empty to get the full list.

Returns:



2631
2632
2633
2634
# File 'lib/finnhub_ruby/api/default_api.rb', line 2631

def fund_ownership(symbol, opts = {})
  data, _status_code, _headers = fund_ownership_with_http_info(symbol, opts)
  data
end

#fund_ownership_with_http_info(symbol, opts = {}) ⇒ Array<(FundOwnership, Integer, Hash)>

Fund Ownership Get a full list fund and institutional investors of a company in descending order of the number of shares held. Data is sourced from &lt;code&gt;13F form&lt;/code&gt;, &lt;code&gt;Schedule 13D&lt;/code&gt; and &lt;code&gt;13G&lt;/code&gt; for US market, &lt;code&gt;UK Share Register&lt;/code&gt; for UK market, &lt;code&gt;SEDI&lt;/code&gt; for Canadian market and equivalent filings for other international markets.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit number of results. Leave empty to get the full list.

Returns:

  • (Array<(FundOwnership, Integer, Hash)>)

    FundOwnership data, response status code and response headers



2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
# File 'lib/finnhub_ruby/api/default_api.rb', line 2642

def fund_ownership_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.fund_ownership ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.fund_ownership"
  end
  # resource path
  local_var_path = '/stock/fund-ownership'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'FundOwnership'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.fund_ownership",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#fund_ownership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#indices_constituents(symbol, opts = {}) ⇒ IndicesConstituents

Indices Constituents Get a list of index’s constituents. A list of supported indices for this endpoint can be found <a href="docs.google.com/spreadsheets/d/1Syr2eLielHWsorxkDEZXyc55d6bNx1M3ZeI4vdn7Qzo/edit?usp=sharing" target="_blank">here</a>.

Parameters:

  • symbol (String)

    symbol

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

    the optional parameters

Returns:



2697
2698
2699
2700
# File 'lib/finnhub_ruby/api/default_api.rb', line 2697

def indices_constituents(symbol, opts = {})
  data, _status_code, _headers = indices_constituents_with_http_info(symbol, opts)
  data
end

#indices_constituents_with_http_info(symbol, opts = {}) ⇒ Array<(IndicesConstituents, Integer, Hash)>

Indices Constituents Get a list of index&#39;s constituents. A list of supported indices for this endpoint can be found &lt;a href&#x3D;&quot;docs.google.com/spreadsheets/d/1Syr2eLielHWsorxkDEZXyc55d6bNx1M3ZeI4vdn7Qzo/edit?usp&#x3D;sharing&quot; target&#x3D;&quot;_blank&quot;&gt;here&lt;/a&gt;.

Parameters:

  • symbol (String)

    symbol

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

    the optional parameters

Returns:

  • (Array<(IndicesConstituents, Integer, Hash)>)

    IndicesConstituents data, response status code and response headers



2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
# File 'lib/finnhub_ruby/api/default_api.rb', line 2707

def indices_constituents_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.indices_constituents ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.indices_constituents"
  end
  # resource path
  local_var_path = '/index/constituents'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IndicesConstituents'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.indices_constituents",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#indices_constituents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#indices_historical_constituents(symbol, opts = {}) ⇒ IndicesHistoricalConstituents

Indices Historical Constituents Get full history of index’s constituents including symbols and dates of joining and leaving the Index. Currently support ^GSPC, ^NDX, ^DJI

Parameters:

  • symbol (String)

    symbol

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

    the optional parameters

Returns:



2761
2762
2763
2764
# File 'lib/finnhub_ruby/api/default_api.rb', line 2761

def indices_historical_constituents(symbol, opts = {})
  data, _status_code, _headers = indices_historical_constituents_with_http_info(symbol, opts)
  data
end

#indices_historical_constituents_with_http_info(symbol, opts = {}) ⇒ Array<(IndicesHistoricalConstituents, Integer, Hash)>

Indices Historical Constituents Get full history of index&#39;s constituents including symbols and dates of joining and leaving the Index. Currently support &lt;code&gt;^GSPC&lt;/code&gt;, &lt;code&gt;^NDX&lt;/code&gt;, &lt;code&gt;^DJI&lt;/code&gt;

Parameters:

  • symbol (String)

    symbol

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

    the optional parameters

Returns:



2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
# File 'lib/finnhub_ruby/api/default_api.rb', line 2771

def indices_historical_constituents_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.indices_historical_constituents ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.indices_historical_constituents"
  end
  # resource path
  local_var_path = '/index/historical-constituents'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IndicesHistoricalConstituents'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.indices_historical_constituents",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#indices_historical_constituents\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insider_sentiment(symbol, from, to, opts = {}) ⇒ InsiderSentiments

Insider Sentiment Get insider sentiment data for US companies calculated using method discussed <a href="medium.com/@stock-api/finnhub-insiders-sentiment-analysis-cc43f9f64b3a" target="_blank">here</a>. The MSPR ranges from -100 for the most negative to 100 for the most positive which can signal price changes in the coming 30-90 days.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

  • from (Date)

    From date: 2020-03-15.

  • to (Date)

    To date: 2020-03-16.

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

    the optional parameters

Returns:



2827
2828
2829
2830
# File 'lib/finnhub_ruby/api/default_api.rb', line 2827

def insider_sentiment(symbol, from, to, opts = {})
  data, _status_code, _headers = insider_sentiment_with_http_info(symbol, from, to, opts)
  data
end

#insider_sentiment_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(InsiderSentiments, Integer, Hash)>

Insider Sentiment Get insider sentiment data for US companies calculated using method discussed &lt;a href&#x3D;&quot;medium.com/@stock-api/finnhub-insiders-sentiment-analysis-cc43f9f64b3a&quot; target&#x3D;&quot;_blank&quot;&gt;here&lt;/a&gt;. The MSPR ranges from -100 for the most negative to 100 for the most positive which can signal price changes in the coming 30-90 days.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

  • from (Date)

    From date: 2020-03-15.

  • to (Date)

    To date: 2020-03-16.

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

    the optional parameters

Returns:

  • (Array<(InsiderSentiments, Integer, Hash)>)

    InsiderSentiments data, response status code and response headers



2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
# File 'lib/finnhub_ruby/api/default_api.rb', line 2839

def insider_sentiment_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.insider_sentiment ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.insider_sentiment"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.insider_sentiment"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.insider_sentiment"
  end
  # resource path
  local_var_path = '/stock/insider-sentiment'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InsiderSentiments'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.insider_sentiment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#insider_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#insider_transactions(symbol, opts = {}) ⇒ InsiderTransactions

Insider Transactions Company insider transactions data sourced from Form 3,4,5. This endpoint only covers US companies at the moment. Limit to 100 transactions per API call.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL. Leave this param blank to get the latest transactions.

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date: 2020-03-15.

  • :to (Date)

    To date: 2020-03-16.

Returns:



2905
2906
2907
2908
# File 'lib/finnhub_ruby/api/default_api.rb', line 2905

def insider_transactions(symbol, opts = {})
  data, _status_code, _headers = insider_transactions_with_http_info(symbol, opts)
  data
end

#insider_transactions_with_http_info(symbol, opts = {}) ⇒ Array<(InsiderTransactions, Integer, Hash)>

Insider Transactions Company insider transactions data sourced from &lt;code&gt;Form 3,4,5&lt;/code&gt;. This endpoint only covers US companies at the moment. Limit to 100 transactions per API call.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL. Leave this param blank to get the latest transactions.

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date: 2020-03-15.

  • :to (Date)

    To date: 2020-03-16.

Returns:

  • (Array<(InsiderTransactions, Integer, Hash)>)

    InsiderTransactions data, response status code and response headers



2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
# File 'lib/finnhub_ruby/api/default_api.rb', line 2917

def insider_transactions_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.insider_transactions ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.insider_transactions"
  end
  # resource path
  local_var_path = '/stock/insider-transactions'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InsiderTransactions'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.insider_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#insider_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#international_filings(opts = {}) ⇒ Array<InternationalFiling>

International Filings List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol. Leave empty to list latest filings.

  • :country (String)

    Filter by country using country&#39;s 2-letter code.

Returns:



2974
2975
2976
2977
# File 'lib/finnhub_ruby/api/default_api.rb', line 2974

def international_filings(opts = {})
  data, _status_code, _headers = international_filings_with_http_info(opts)
  data
end

#international_filings_with_http_info(opts = {}) ⇒ Array<(Array<InternationalFiling>, Integer, Hash)>

International Filings List filings for international companies. Limit to 250 documents at a time. These are the documents we use to source our fundamental data.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol. Leave empty to list latest filings.

  • :country (String)

    Filter by country using country&#39;s 2-letter code.

Returns:

  • (Array<(Array<InternationalFiling>, Integer, Hash)>)

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



2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
# File 'lib/finnhub_ruby/api/default_api.rb', line 2985

def international_filings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.international_filings ...'
  end
  # resource path
  local_var_path = '/stock/international-filings'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<InternationalFiling>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.international_filings",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#international_filings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#investment_themes(theme, opts = {}) ⇒ InvestmentThemes

Investment Themes (Thematic Investing) <p>Thematic investing involves creating a portfolio (or portion of a portfolio) by gathering together a collection of companies involved in certain areas that you predict will generate above-market returns over the long term. Themes can be based on a concept such as ageing populations or a sub-sector such as robotics, and drones. Thematic investing focuses on predicted long-term trends rather than specific companies or sectors, enabling investors to access structural, one-off shifts that can change an entire industry.</p><p>This endpoint will help you get portfolios of different investment themes that are changing our life and are the way of the future.</p><p>A full list of themes supported can be found <a target="_blank" href="docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp=sharing">here</a>. The theme coverage and portfolios are updated bi-weekly by our analysts. Our approach excludes penny, super-small cap and illiquid stocks.</p>

Parameters:

Returns:



3036
3037
3038
3039
# File 'lib/finnhub_ruby/api/default_api.rb', line 3036

def investment_themes(theme, opts = {})
  data, _status_code, _headers = investment_themes_with_http_info(theme, opts)
  data
end

#investment_themes_with_http_info(theme, opts = {}) ⇒ Array<(InvestmentThemes, Integer, Hash)>

Investment Themes (Thematic Investing) &lt;p&gt;Thematic investing involves creating a portfolio (or portion of a portfolio) by gathering together a collection of companies involved in certain areas that you predict will generate above-market returns over the long term. Themes can be based on a concept such as ageing populations or a sub-sector such as robotics, and drones. Thematic investing focuses on predicted long-term trends rather than specific companies or sectors, enabling investors to access structural, one-off shifts that can change an entire industry.&lt;/p&gt;&lt;p&gt;This endpoint will help you get portfolios of different investment themes that are changing our life and are the way of the future.&lt;/p&gt;&lt;p&gt;A full list of themes supported can be found &lt;a target&#x3D;&quot;_blank&quot; href&#x3D;&quot;docs.google.com/spreadsheets/d/1ULj9xDh4iPoQj279M084adZ2_S852ttRthKKJ7madYc/edit?usp&#x3D;sharing&quot;&gt;here&lt;/a&gt;. The theme coverage and portfolios are updated bi-weekly by our analysts. Our approach excludes penny, super-small cap and illiquid stocks.&lt;/p&gt;

Parameters:

Returns:

  • (Array<(InvestmentThemes, Integer, Hash)>)

    InvestmentThemes data, response status code and response headers



3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
# File 'lib/finnhub_ruby/api/default_api.rb', line 3046

def investment_themes_with_http_info(theme, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.investment_themes ...'
  end
  # verify the required parameter 'theme' is set
  if @api_client.config.client_side_validation && theme.nil?
    fail ArgumentError, "Missing the required parameter 'theme' when calling DefaultApi.investment_themes"
  end
  # resource path
  local_var_path = '/stock/investment-theme'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'theme'] = theme

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'InvestmentThemes'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.investment_themes",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#investment_themes\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ipo_calendar(from, to, opts = {}) ⇒ IPOCalendar

IPO Calendar Get recent and upcoming IPO.

Parameters:

  • from (Date)

    From date: 2020-03-15.

  • to (Date)

    To date: 2020-03-16.

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

    the optional parameters

Returns:



3101
3102
3103
3104
# File 'lib/finnhub_ruby/api/default_api.rb', line 3101

def ipo_calendar(from, to, opts = {})
  data, _status_code, _headers = ipo_calendar_with_http_info(from, to, opts)
  data
end

#ipo_calendar_with_http_info(from, to, opts = {}) ⇒ Array<(IPOCalendar, Integer, Hash)>

IPO Calendar Get recent and upcoming IPO.

Parameters:

  • from (Date)

    From date: 2020-03-15.

  • to (Date)

    To date: 2020-03-16.

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

    the optional parameters

Returns:

  • (Array<(IPOCalendar, Integer, Hash)>)

    IPOCalendar data, response status code and response headers



3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
# File 'lib/finnhub_ruby/api/default_api.rb', line 3112

def ipo_calendar_with_http_info(from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.ipo_calendar ...'
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.ipo_calendar"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.ipo_calendar"
  end
  # resource path
  local_var_path = '/calendar/ipo'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'IPOCalendar'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.ipo_calendar",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#ipo_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#market_news(category, opts = {}) ⇒ Array<MarketNews>

Market News Get latest market news.

Parameters:

  • category (String)

    This parameter can be 1 of the following values &lt;code&gt;general, forex, crypto, merger&lt;/code&gt;.

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

    the optional parameters

Options Hash (opts):

  • :min_id (Integer)

    Use this field to get only news after this ID. Default to 0

Returns:



3172
3173
3174
3175
# File 'lib/finnhub_ruby/api/default_api.rb', line 3172

def market_news(category, opts = {})
  data, _status_code, _headers = market_news_with_http_info(category, opts)
  data
end

#market_news_with_http_info(category, opts = {}) ⇒ Array<(Array<MarketNews>, Integer, Hash)>

Market News Get latest market news.

Parameters:

  • category (String)

    This parameter can be 1 of the following values &lt;code&gt;general, forex, crypto, merger&lt;/code&gt;.

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

    the optional parameters

Options Hash (opts):

  • :min_id (Integer)

    Use this field to get only news after this ID. Default to 0

Returns:

  • (Array<(Array<MarketNews>, Integer, Hash)>)

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



3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
# File 'lib/finnhub_ruby/api/default_api.rb', line 3183

def market_news_with_http_info(category, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.market_news ...'
  end
  # verify the required parameter 'category' is set
  if @api_client.config.client_side_validation && category.nil?
    fail ArgumentError, "Missing the required parameter 'category' when calling DefaultApi.market_news"
  end
  # resource path
  local_var_path = '/news'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'category'] = category
  query_params[:'minId'] = opts[:'min_id'] if !opts[:'min_id'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<MarketNews>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.market_news",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#market_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mutual_fund_country_exposure(symbol, opts = {}) ⇒ MutualFundCountryExposure

Mutual Funds Country Exposure Get Mutual Funds country exposure data.

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:



3238
3239
3240
3241
# File 'lib/finnhub_ruby/api/default_api.rb', line 3238

def mutual_fund_country_exposure(symbol, opts = {})
  data, _status_code, _headers = mutual_fund_country_exposure_with_http_info(symbol, opts)
  data
end

#mutual_fund_country_exposure_with_http_info(symbol, opts = {}) ⇒ Array<(MutualFundCountryExposure, Integer, Hash)>

Mutual Funds Country Exposure Get Mutual Funds country exposure data.

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:

  • (Array<(MutualFundCountryExposure, Integer, Hash)>)

    MutualFundCountryExposure data, response status code and response headers



3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
# File 'lib/finnhub_ruby/api/default_api.rb', line 3248

def mutual_fund_country_exposure_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.mutual_fund_country_exposure ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.mutual_fund_country_exposure"
  end
  # resource path
  local_var_path = '/mutual-fund/country'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MutualFundCountryExposure'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.mutual_fund_country_exposure",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#mutual_fund_country_exposure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mutual_fund_holdings(opts = {}) ⇒ MutualFundHoldings

Mutual Funds Holdings Get full Mutual Funds holdings/constituents. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Fund&#39;s symbol.

  • :isin (String)

    Fund&#39;s isin.

  • :skip (Integer)

    Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip&#x3D;0 or not set.

Returns:



3304
3305
3306
3307
# File 'lib/finnhub_ruby/api/default_api.rb', line 3304

def mutual_fund_holdings(opts = {})
  data, _status_code, _headers = mutual_fund_holdings_with_http_info(opts)
  data
end

#mutual_fund_holdings_with_http_info(opts = {}) ⇒ Array<(MutualFundHoldings, Integer, Hash)>

Mutual Funds Holdings Get full Mutual Funds holdings/constituents. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Fund&#39;s symbol.

  • :isin (String)

    Fund&#39;s isin.

  • :skip (Integer)

    Skip the first n results. You can use this parameter to query historical constituents data. The latest result is returned if skip&#x3D;0 or not set.

Returns:

  • (Array<(MutualFundHoldings, Integer, Hash)>)

    MutualFundHoldings data, response status code and response headers



3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
# File 'lib/finnhub_ruby/api/default_api.rb', line 3316

def mutual_fund_holdings_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.mutual_fund_holdings ...'
  end
  # resource path
  local_var_path = '/mutual-fund/holdings'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'isin'] = opts[:'isin'] if !opts[:'isin'].nil?
  query_params[:'skip'] = opts[:'skip'] if !opts[:'skip'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MutualFundHoldings'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.mutual_fund_holdings",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#mutual_fund_holdings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mutual_fund_profile(opts = {}) ⇒ MutualFundProfile

Mutual Funds Profile Get mutual funds profile information. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Fund&#39;s symbol.

  • :isin (String)

    Fund&#39;s isin.

Returns:



3369
3370
3371
3372
# File 'lib/finnhub_ruby/api/default_api.rb', line 3369

def mutual_fund_profile(opts = {})
  data, _status_code, _headers = mutual_fund_profile_with_http_info(opts)
  data
end

#mutual_fund_profile_with_http_info(opts = {}) ⇒ Array<(MutualFundProfile, Integer, Hash)>

Mutual Funds Profile Get mutual funds profile information. This endpoint covers both US and global mutual funds. For international funds, you must query the data using ISIN.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Fund&#39;s symbol.

  • :isin (String)

    Fund&#39;s isin.

Returns:

  • (Array<(MutualFundProfile, Integer, Hash)>)

    MutualFundProfile data, response status code and response headers



3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
# File 'lib/finnhub_ruby/api/default_api.rb', line 3380

def mutual_fund_profile_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.mutual_fund_profile ...'
  end
  # resource path
  local_var_path = '/mutual-fund/profile'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MutualFundProfile'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.mutual_fund_profile",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#mutual_fund_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#mutual_fund_sector_exposure(symbol, opts = {}) ⇒ MutualFundSectorExposure

Mutual Funds Sector Exposure Get Mutual Funds sector exposure data.

Parameters:

  • symbol (String)

    Mutual Fund symbol.

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

    the optional parameters

Returns:



3431
3432
3433
3434
# File 'lib/finnhub_ruby/api/default_api.rb', line 3431

def mutual_fund_sector_exposure(symbol, opts = {})
  data, _status_code, _headers = mutual_fund_sector_exposure_with_http_info(symbol, opts)
  data
end

#mutual_fund_sector_exposure_with_http_info(symbol, opts = {}) ⇒ Array<(MutualFundSectorExposure, Integer, Hash)>

Mutual Funds Sector Exposure Get Mutual Funds sector exposure data.

Parameters:

  • symbol (String)

    Mutual Fund symbol.

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

    the optional parameters

Returns:

  • (Array<(MutualFundSectorExposure, Integer, Hash)>)

    MutualFundSectorExposure data, response status code and response headers



3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
# File 'lib/finnhub_ruby/api/default_api.rb', line 3441

def mutual_fund_sector_exposure_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.mutual_fund_sector_exposure ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.mutual_fund_sector_exposure"
  end
  # resource path
  local_var_path = '/mutual-fund/sector'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'MutualFundSectorExposure'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.mutual_fund_sector_exposure",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#mutual_fund_sector_exposure\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#news_sentiment(symbol, opts = {}) ⇒ NewsSentiment

News Sentiment Get company’s news sentiment and statistics. This endpoint is only available for US companies.

Parameters:

  • symbol (String)

    Company symbol.

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

    the optional parameters

Returns:



3495
3496
3497
3498
# File 'lib/finnhub_ruby/api/default_api.rb', line 3495

def news_sentiment(symbol, opts = {})
  data, _status_code, _headers = news_sentiment_with_http_info(symbol, opts)
  data
end

#news_sentiment_with_http_info(symbol, opts = {}) ⇒ Array<(NewsSentiment, Integer, Hash)>

News Sentiment Get company&#39;s news sentiment and statistics. This endpoint is only available for US companies.

Parameters:

  • symbol (String)

    Company symbol.

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

    the optional parameters

Returns:

  • (Array<(NewsSentiment, Integer, Hash)>)

    NewsSentiment data, response status code and response headers



3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
# File 'lib/finnhub_ruby/api/default_api.rb', line 3505

def news_sentiment_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.news_sentiment ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.news_sentiment"
  end
  # resource path
  local_var_path = '/news-sentiment'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'NewsSentiment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.news_sentiment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#news_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#ownership(symbol, opts = {}) ⇒ Ownership

Ownership Get a full list of shareholders of a company in descending order of the number of shares held. Data is sourced from 13F form, Schedule 13D and 13G for US market, UK Share Register for UK market, SEDI for Canadian market and equivalent filings for other international markets.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit number of results. Leave empty to get the full list.

Returns:



3560
3561
3562
3563
# File 'lib/finnhub_ruby/api/default_api.rb', line 3560

def ownership(symbol, opts = {})
  data, _status_code, _headers = ownership_with_http_info(symbol, opts)
  data
end

#ownership_with_http_info(symbol, opts = {}) ⇒ Array<(Ownership, Integer, Hash)>

Ownership Get a full list of shareholders of a company in descending order of the number of shares held. Data is sourced from &lt;code&gt;13F form&lt;/code&gt;, &lt;code&gt;Schedule 13D&lt;/code&gt; and &lt;code&gt;13G&lt;/code&gt; for US market, &lt;code&gt;UK Share Register&lt;/code&gt; for UK market, &lt;code&gt;SEDI&lt;/code&gt; for Canadian market and equivalent filings for other international markets.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limit number of results. Leave empty to get the full list.

Returns:

  • (Array<(Ownership, Integer, Hash)>)

    Ownership data, response status code and response headers



3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
# File 'lib/finnhub_ruby/api/default_api.rb', line 3571

def ownership_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.ownership ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.ownership"
  end
  # resource path
  local_var_path = '/stock/ownership'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Ownership'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.ownership",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#ownership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#pattern_recognition(symbol, resolution, opts = {}) ⇒ PatternRecognition

Pattern Recognition Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns.

Parameters:

  • symbol (String)

    Symbol

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

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

    the optional parameters

Returns:



3627
3628
3629
3630
# File 'lib/finnhub_ruby/api/default_api.rb', line 3627

def pattern_recognition(symbol, resolution, opts = {})
  data, _status_code, _headers = pattern_recognition_with_http_info(symbol, resolution, opts)
  data
end

#pattern_recognition_with_http_info(symbol, resolution, opts = {}) ⇒ Array<(PatternRecognition, Integer, Hash)>

Pattern Recognition Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns.

Parameters:

  • symbol (String)

    Symbol

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

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

    the optional parameters

Returns:

  • (Array<(PatternRecognition, Integer, Hash)>)

    PatternRecognition data, response status code and response headers



3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
# File 'lib/finnhub_ruby/api/default_api.rb', line 3638

def pattern_recognition_with_http_info(symbol, resolution, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.pattern_recognition ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.pattern_recognition"
  end
  # verify the required parameter 'resolution' is set
  if @api_client.config.client_side_validation && resolution.nil?
    fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.pattern_recognition"
  end
  # resource path
  local_var_path = '/scan/pattern'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'resolution'] = resolution

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PatternRecognition'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.pattern_recognition",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#pattern_recognition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#press_releases(symbol, opts = {}) ⇒ PressRelease

Major Press Releases Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.

Parameters:

  • symbol (String)

    Company symbol.

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From time: 2020-01-01.

  • :to (Date)

    To time: 2020-01-05.

Returns:



3699
3700
3701
3702
# File 'lib/finnhub_ruby/api/default_api.rb', line 3699

def press_releases(symbol, opts = {})
  data, _status_code, _headers = press_releases_with_http_info(symbol, opts)
  data
end

#press_releases_with_http_info(symbol, opts = {}) ⇒ Array<(PressRelease, Integer, Hash)>

Major Press Releases Get latest major press releases of a company. This data can be used to highlight the most significant events comprised of mostly press releases sourced from the exchanges, BusinessWire, AccessWire, GlobeNewswire, Newsfile, and PRNewswire.

Parameters:

  • symbol (String)

    Company symbol.

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From time: 2020-01-01.

  • :to (Date)

    To time: 2020-01-05.

Returns:

  • (Array<(PressRelease, Integer, Hash)>)

    PressRelease data, response status code and response headers



3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
# File 'lib/finnhub_ruby/api/default_api.rb', line 3711

def press_releases_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.press_releases ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.press_releases"
  end
  # resource path
  local_var_path = '/press-releases'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PressRelease'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.press_releases",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#press_releases\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#price_target(symbol, opts = {}) ⇒ PriceTarget

Price Target Get latest price target consensus.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:



3767
3768
3769
3770
# File 'lib/finnhub_ruby/api/default_api.rb', line 3767

def price_target(symbol, opts = {})
  data, _status_code, _headers = price_target_with_http_info(symbol, opts)
  data
end

#price_target_with_http_info(symbol, opts = {}) ⇒ Array<(PriceTarget, Integer, Hash)>

Price Target Get latest price target consensus.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:

  • (Array<(PriceTarget, Integer, Hash)>)

    PriceTarget data, response status code and response headers



3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
# File 'lib/finnhub_ruby/api/default_api.rb', line 3777

def price_target_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.price_target ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.price_target"
  end
  # resource path
  local_var_path = '/stock/price-target'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'PriceTarget'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.price_target",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#price_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#quote(symbol, opts = {}) ⇒ Quote

Quote <p>Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time updates.</p><p>Real-time stock prices for international markets are supported for Enterprise clients via our partner’s feed. <a href="[email protected]">Contact Us</a> to learn more.</p>

Parameters:

  • symbol (String)

    Symbol

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

    the optional parameters

Returns:



3831
3832
3833
3834
# File 'lib/finnhub_ruby/api/default_api.rb', line 3831

def quote(symbol, opts = {})
  data, _status_code, _headers = quote_with_http_info(symbol, opts)
  data
end

#quote_with_http_info(symbol, opts = {}) ⇒ Array<(Quote, Integer, Hash)>

Quote &lt;p&gt;Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time updates.&lt;/p&gt;&lt;p&gt;Real-time stock prices for international markets are supported for Enterprise clients via our partner&#39;s feed. &lt;a href&#x3D;&quot;[email protected]&quot;&gt;Contact Us&lt;/a&gt; to learn more.&lt;/p&gt;

Parameters:

  • symbol (String)

    Symbol

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

    the optional parameters

Returns:

  • (Array<(Quote, Integer, Hash)>)

    Quote data, response status code and response headers



3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
# File 'lib/finnhub_ruby/api/default_api.rb', line 3841

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Quote'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.quote",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

Recommendation Trends Get latest analyst recommendation trends for a company.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:



3895
3896
3897
3898
# File 'lib/finnhub_ruby/api/default_api.rb', line 3895

def recommendation_trends(symbol, opts = {})
  data, _status_code, _headers = recommendation_trends_with_http_info(symbol, opts)
  data
end

Recommendation Trends Get latest analyst recommendation trends for a company.

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:

  • (Array<(Array<RecommendationTrend>, Integer, Hash)>)

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



3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
# File 'lib/finnhub_ruby/api/default_api.rb', line 3905

def recommendation_trends_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.recommendation_trends ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.recommendation_trends"
  end
  # resource path
  local_var_path = '/stock/recommendation'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<RecommendationTrend>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.recommendation_trends",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#recommendation_trends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#revenue_breakdown(opts = {}) ⇒ RevenueBreakdown

Revenue Breakdown Get revenue breakdown by product. This dataset is only available for US companies which disclose their revenue breakdown in the annual or quarterly reports.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol.

  • :cik (String)

    CIK.

Returns:



3960
3961
3962
3963
# File 'lib/finnhub_ruby/api/default_api.rb', line 3960

def revenue_breakdown(opts = {})
  data, _status_code, _headers = revenue_breakdown_with_http_info(opts)
  data
end

#revenue_breakdown_with_http_info(opts = {}) ⇒ Array<(RevenueBreakdown, Integer, Hash)>

Revenue Breakdown Get revenue breakdown by product. This dataset is only available for US companies which disclose their revenue breakdown in the annual or quarterly reports.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol.

  • :cik (String)

    CIK.

Returns:

  • (Array<(RevenueBreakdown, Integer, Hash)>)

    RevenueBreakdown data, response status code and response headers



3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
# File 'lib/finnhub_ruby/api/default_api.rb', line 3971

def revenue_breakdown_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.revenue_breakdown ...'
  end
  # resource path
  local_var_path = '/stock/revenue-breakdown'

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

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'RevenueBreakdown'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.revenue_breakdown",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#revenue_breakdown\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#similarity_index(opts = {}) ⇒ SimilarityIndex

Similarity Index <p>Calculate the textual difference between a company’s 10-K / 10-Q reports and the same type of report in the previous year using Cosine Similarity. For example, this endpoint compares 2019’s 10-K with 2018’s 10-K. Companies breaking from its routines in disclosure of financial condition and risk analysis section can signal a significant change in the company’s stock price in the upcoming 4 quarters.</p>

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol. Required if cik is empty

  • :cik (String)

    CIK. Required if symbol is empty

  • :freq (String)

    &lt;code&gt;annual&lt;/code&gt; or &lt;code&gt;quarterly&lt;/code&gt;. Default to &lt;code&gt;annual&lt;/code&gt;

Returns:



4024
4025
4026
4027
# File 'lib/finnhub_ruby/api/default_api.rb', line 4024

def similarity_index(opts = {})
  data, _status_code, _headers = similarity_index_with_http_info(opts)
  data
end

#similarity_index_with_http_info(opts = {}) ⇒ Array<(SimilarityIndex, Integer, Hash)>

Similarity Index &lt;p&gt;Calculate the textual difference between a company&#39;s 10-K / 10-Q reports and the same type of report in the previous year using Cosine Similarity. For example, this endpoint compares 2019&#39;s 10-K with 2018&#39;s 10-K. Companies breaking from its routines in disclosure of financial condition and risk analysis section can signal a significant change in the company&#39;s stock price in the upcoming 4 quarters.&lt;/p&gt;

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol. Required if cik is empty

  • :cik (String)

    CIK. Required if symbol is empty

  • :freq (String)

    &lt;code&gt;annual&lt;/code&gt; or &lt;code&gt;quarterly&lt;/code&gt;. Default to &lt;code&gt;annual&lt;/code&gt;

Returns:

  • (Array<(SimilarityIndex, Integer, Hash)>)

    SimilarityIndex data, response status code and response headers



4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
# File 'lib/finnhub_ruby/api/default_api.rb', line 4036

def similarity_index_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.similarity_index ...'
  end
  # resource path
  local_var_path = '/stock/similarity-index'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'cik'] = opts[:'cik'] if !opts[:'cik'].nil?
  query_params[:'freq'] = opts[:'freq'] if !opts[:'freq'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SimilarityIndex'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.similarity_index",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#similarity_index\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#social_sentiment(symbol, opts = {}) ⇒ SocialSentiment

Social Sentiment <p>Get social sentiment for stocks on Reddit and Twitter. This endpoint is currently in Beta.</p>

Parameters:

  • symbol (String)

    Company symbol.

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • :to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

Returns:



4090
4091
4092
4093
# File 'lib/finnhub_ruby/api/default_api.rb', line 4090

def social_sentiment(symbol, opts = {})
  data, _status_code, _headers = social_sentiment_with_http_info(symbol, opts)
  data
end

#social_sentiment_with_http_info(symbol, opts = {}) ⇒ Array<(SocialSentiment, Integer, Hash)>

Social Sentiment &lt;p&gt;Get social sentiment for stocks on Reddit and Twitter. This endpoint is currently in Beta.&lt;/p&gt;

Parameters:

  • symbol (String)

    Company symbol.

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

    the optional parameters

Options Hash (opts):

  • :from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • :to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

Returns:

  • (Array<(SocialSentiment, Integer, Hash)>)

    SocialSentiment data, response status code and response headers



4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
# File 'lib/finnhub_ruby/api/default_api.rb', line 4102

def social_sentiment_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.social_sentiment ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.social_sentiment"
  end
  # resource path
  local_var_path = '/stock/social-sentiment'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SocialSentiment'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.social_sentiment",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#social_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_basic_dividends(symbol, opts = {}) ⇒ Dividends2

Dividends 2 (Basic) Get global dividends data.

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:



4158
4159
4160
4161
# File 'lib/finnhub_ruby/api/default_api.rb', line 4158

def stock_basic_dividends(symbol, opts = {})
  data, _status_code, _headers = stock_basic_dividends_with_http_info(symbol, opts)
  data
end

#stock_basic_dividends_with_http_info(symbol, opts = {}) ⇒ Array<(Dividends2, Integer, Hash)>

Dividends 2 (Basic) Get global dividends data.

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:

  • (Array<(Dividends2, Integer, Hash)>)

    Dividends2 data, response status code and response headers



4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
# File 'lib/finnhub_ruby/api/default_api.rb', line 4168

def stock_basic_dividends_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_basic_dividends ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_basic_dividends"
  end
  # resource path
  local_var_path = '/stock/dividend2'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Dividends2'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_basic_dividends",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_basic_dividends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_bidask(symbol, opts = {}) ⇒ LastBidAsk

Last Bid-Ask Get last bid/ask data for US stocks.

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:



4222
4223
4224
4225
# File 'lib/finnhub_ruby/api/default_api.rb', line 4222

def stock_bidask(symbol, opts = {})
  data, _status_code, _headers = stock_bidask_with_http_info(symbol, opts)
  data
end

#stock_bidask_with_http_info(symbol, opts = {}) ⇒ Array<(LastBidAsk, Integer, Hash)>

Last Bid-Ask Get last bid/ask data for US stocks.

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:

  • (Array<(LastBidAsk, Integer, Hash)>)

    LastBidAsk data, response status code and response headers



4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
# File 'lib/finnhub_ruby/api/default_api.rb', line 4232

def stock_bidask_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_bidask ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_bidask"
  end
  # resource path
  local_var_path = '/stock/bidask'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LastBidAsk'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_bidask",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_bidask\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_candles(symbol, resolution, from, to, opts = {}) ⇒ StockCandles

Stock Candles <p>Get candlestick data (OHLCV) for stocks.</p><p>Daily data will be adjusted for Splits. Intraday data will remain unadjusted.</p>

Parameters:

  • symbol (String)

    Symbol.

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:



4289
4290
4291
4292
# File 'lib/finnhub_ruby/api/default_api.rb', line 4289

def stock_candles(symbol, resolution, from, to, opts = {})
  data, _status_code, _headers = stock_candles_with_http_info(symbol, resolution, from, to, opts)
  data
end

#stock_candles_with_http_info(symbol, resolution, from, to, opts = {}) ⇒ Array<(StockCandles, Integer, Hash)>

Stock Candles &lt;p&gt;Get candlestick data (OHLCV) for stocks.&lt;/p&gt;&lt;p&gt;Daily data will be adjusted for Splits. Intraday data will remain unadjusted.&lt;/p&gt;

Parameters:

  • symbol (String)

    Symbol.

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

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

    the optional parameters

Returns:

  • (Array<(StockCandles, Integer, Hash)>)

    StockCandles data, response status code and response headers



4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
# File 'lib/finnhub_ruby/api/default_api.rb', line 4302

def stock_candles_with_http_info(symbol, resolution, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_candles ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_candles"
  end
  # verify the required parameter 'resolution' is set
  if @api_client.config.client_side_validation && resolution.nil?
    fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.stock_candles"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_candles"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_candles"
  end
  # resource path
  local_var_path = '/stock/candle'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'resolution'] = resolution
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'StockCandles'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_candles",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_candles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_dividends(symbol, from, to, opts = {}) ⇒ Array<Dividends>

Dividends Get dividends data for common stocks going back 30 years.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    YYYY-MM-DD.

  • to (Date)

    YYYY-MM-DD.

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

    the optional parameters

Returns:



4373
4374
4375
4376
# File 'lib/finnhub_ruby/api/default_api.rb', line 4373

def stock_dividends(symbol, from, to, opts = {})
  data, _status_code, _headers = stock_dividends_with_http_info(symbol, from, to, opts)
  data
end

#stock_dividends_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(Array<Dividends>, Integer, Hash)>

Dividends Get dividends data for common stocks going back 30 years.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    YYYY-MM-DD.

  • to (Date)

    YYYY-MM-DD.

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

    the optional parameters

Returns:

  • (Array<(Array<Dividends>, Integer, Hash)>)

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



4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
# File 'lib/finnhub_ruby/api/default_api.rb', line 4385

def stock_dividends_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_dividends ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_dividends"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_dividends"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_dividends"
  end
  # resource path
  local_var_path = '/stock/dividend'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Dividends>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_dividends",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_dividends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_lobbying(symbol, from, to, opts = {}) ⇒ LobbyingResult

Senate Lobbying Get a list of reported lobbying activities in the Senate and the House.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

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

    the optional parameters

Returns:



4451
4452
4453
4454
# File 'lib/finnhub_ruby/api/default_api.rb', line 4451

def stock_lobbying(symbol, from, to, opts = {})
  data, _status_code, _headers = stock_lobbying_with_http_info(symbol, from, to, opts)
  data
end

#stock_lobbying_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(LobbyingResult, Integer, Hash)>

Senate Lobbying Get a list of reported lobbying activities in the Senate and the House.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

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

    the optional parameters

Returns:

  • (Array<(LobbyingResult, Integer, Hash)>)

    LobbyingResult data, response status code and response headers



4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
# File 'lib/finnhub_ruby/api/default_api.rb', line 4463

def stock_lobbying_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_lobbying ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_lobbying"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_lobbying"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_lobbying"
  end
  # resource path
  local_var_path = '/stock/lobbying'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'LobbyingResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_lobbying",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_lobbying\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_nbbo(symbol, date, limit, skip, opts = {}) ⇒ HistoricalNBBO

Historical NBBO <p>Get historical best bid and offer for US stocks, LSE, TSX, Euronext and Deutsche Borse.</p><p>For US market, this endpoint only serves historical NBBO from the beginning of 2020. To download more historical data, please visit our bulk download page in the Dashboard <a target="_blank" href="/dashboard/download",>here</a>.</p>

Parameters:

  • symbol (String)

    Symbol.

  • date (Date)

    Date: 2020-04-02.

  • limit (Integer)

    Limit number of ticks returned. Maximum value: &lt;code&gt;25000&lt;/code&gt;

  • skip (Integer)

    Number of ticks to skip. Use this parameter to loop through the entire data.

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

    the optional parameters

Returns:



4530
4531
4532
4533
# File 'lib/finnhub_ruby/api/default_api.rb', line 4530

def stock_nbbo(symbol, date, limit, skip, opts = {})
  data, _status_code, _headers = stock_nbbo_with_http_info(symbol, date, limit, skip, opts)
  data
end

#stock_nbbo_with_http_info(symbol, date, limit, skip, opts = {}) ⇒ Array<(HistoricalNBBO, Integer, Hash)>

Historical NBBO &lt;p&gt;Get historical best bid and offer for US stocks, LSE, TSX, Euronext and Deutsche Borse.&lt;/p&gt;&lt;p&gt;For US market, this endpoint only serves historical NBBO from the beginning of 2020. To download more historical data, please visit our bulk download page in the Dashboard &lt;a target&#x3D;&quot;_blank&quot; href&#x3D;&quot;/dashboard/download&quot;,&gt;here&lt;/a&gt;.&lt;/p&gt;

Parameters:

  • symbol (String)

    Symbol.

  • date (Date)

    Date: 2020-04-02.

  • limit (Integer)

    Limit number of ticks returned. Maximum value: &lt;code&gt;25000&lt;/code&gt;

  • skip (Integer)

    Number of ticks to skip. Use this parameter to loop through the entire data.

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

    the optional parameters

Returns:

  • (Array<(HistoricalNBBO, Integer, Hash)>)

    HistoricalNBBO data, response status code and response headers



4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
# File 'lib/finnhub_ruby/api/default_api.rb', line 4543

def stock_nbbo_with_http_info(symbol, date, limit, skip, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_nbbo ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_nbbo"
  end
  # verify the required parameter 'date' is set
  if @api_client.config.client_side_validation && date.nil?
    fail ArgumentError, "Missing the required parameter 'date' when calling DefaultApi.stock_nbbo"
  end
  # verify the required parameter 'limit' is set
  if @api_client.config.client_side_validation && limit.nil?
    fail ArgumentError, "Missing the required parameter 'limit' when calling DefaultApi.stock_nbbo"
  end
  # verify the required parameter 'skip' is set
  if @api_client.config.client_side_validation && skip.nil?
    fail ArgumentError, "Missing the required parameter 'skip' when calling DefaultApi.stock_nbbo"
  end
  # resource path
  local_var_path = '/stock/bbo'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'date'] = date
  query_params[:'limit'] = limit
  query_params[:'skip'] = skip

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'HistoricalNBBO'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_nbbo",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_nbbo\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_splits(symbol, from, to, opts = {}) ⇒ Array<Split>

Splits Get splits data for stocks.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    YYYY-MM-DD.

  • to (Date)

    YYYY-MM-DD.

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

    the optional parameters

Returns:



4614
4615
4616
4617
# File 'lib/finnhub_ruby/api/default_api.rb', line 4614

def stock_splits(symbol, from, to, opts = {})
  data, _status_code, _headers = stock_splits_with_http_info(symbol, from, to, opts)
  data
end

#stock_splits_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(Array<Split>, Integer, Hash)>

Splits Get splits data for stocks.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    YYYY-MM-DD.

  • to (Date)

    YYYY-MM-DD.

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

    the optional parameters

Returns:

  • (Array<(Array<Split>, Integer, Hash)>)

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



4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
# File 'lib/finnhub_ruby/api/default_api.rb', line 4626

def stock_splits_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_splits ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_splits"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_splits"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_splits"
  end
  # resource path
  local_var_path = '/stock/split'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<Split>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_splits",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_splits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_symbols(exchange, opts = {}) ⇒ Array<StockSymbol>

Stock Symbol List supported stocks. We use the following symbology to identify stocks on Finnhub Exchange_Ticker.Exchange_Code. A list of supported exchange codes can be found <a href="docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing" target="_blank">here</a>.

Parameters:

Options Hash (opts):

  • :mic (String)

    Filter by MIC code.

  • :security_type (String)

    Filter by security type used by OpenFigi standard.

  • :currency (String)

    Filter by currency.

Returns:



4693
4694
4695
4696
# File 'lib/finnhub_ruby/api/default_api.rb', line 4693

def stock_symbols(exchange, opts = {})
  data, _status_code, _headers = stock_symbols_with_http_info(exchange, opts)
  data
end

#stock_symbols_with_http_info(exchange, opts = {}) ⇒ Array<(Array<StockSymbol>, Integer, Hash)>

Stock Symbol List supported stocks. We use the following symbology to identify stocks on Finnhub &lt;code&gt;Exchange_Ticker.Exchange_Code&lt;/code&gt;. A list of supported exchange codes can be found &lt;a href&#x3D;&quot;docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp&#x3D;sharing&quot; target&#x3D;&quot;_blank&quot;&gt;here&lt;/a&gt;.

Parameters:

Options Hash (opts):

  • :mic (String)

    Filter by MIC code.

  • :security_type (String)

    Filter by security type used by OpenFigi standard.

  • :currency (String)

    Filter by currency.

Returns:

  • (Array<(Array<StockSymbol>, Integer, Hash)>)

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



4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
# File 'lib/finnhub_ruby/api/default_api.rb', line 4706

def stock_symbols_with_http_info(exchange, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_symbols ...'
  end
  # verify the required parameter 'exchange' is set
  if @api_client.config.client_side_validation && exchange.nil?
    fail ArgumentError, "Missing the required parameter 'exchange' when calling DefaultApi.stock_symbols"
  end
  # resource path
  local_var_path = '/stock/symbol'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'exchange'] = exchange
  query_params[:'mic'] = opts[:'mic'] if !opts[:'mic'].nil?
  query_params[:'securityType'] = opts[:'security_type'] if !opts[:'security_type'].nil?
  query_params[:'currency'] = opts[:'currency'] if !opts[:'currency'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<StockSymbol>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_symbols",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_tick(symbol, date, limit, skip, opts = {}) ⇒ TickData

Tick Data <p>Get historical tick data for global exchanges. You can send the request directly to our tick server at <a href="tick.finnhub.io/">tick.finnhub.io/</a> with the same path and parameters or get redirected there if you call our main server.</p><p>For US market, you can visit our bulk download page in the Dashboard <a target="_blank" href="/dashboard/download",>here</a> to speed up the download process.</p><table class="table table-hover"> <thead> <tr> <th>Exchange</th> <th>Segment</th> <th>Delay</th> </tr> </thead> <tbody> <tr> <td class="text-blue">US CTA/UTP</th> <td>Full SIP</td> <td>15 minute</td> </tr> <tr> <td class="text-blue">TSX</th> <td><ul><li>TSX</li><li>TSX Venture</li><li>Index</li></ul></td> <td>End-of-day</td> </tr> <tr> <td class="text-blue">LSE</th> <td><ul><li>London Stock Exchange (L)</li><li>LSE International (L)</li><li>LSE European (L)</li></ul></td> <td>15 minute</td> </tr> <tr> <td class="text-blue">Euronext</th> <td><ul> <li>Euronext Paris (PA)</li> <li>Euronext Amsterdam (AS)</li> <li>Euronext Lisbon (LS)</li> <li>Euronext Brussels (BR)</li> <li>Euronext Oslo (OL)</li> <li>Euronext London (LN)</li> <li>Euronext Dublin (IR)</li> <li>Index</li> <li>Warrant</li></ul></td> <td>End-of-day</td> </tr> <tr> <td class="text-blue">Deutsche Börse</th> <td><ul> <li>Frankfurt (F)</li> <li>Xetra (DE)</li> <li>Duesseldorf (DU)</li> <li>Hamburg (HM)</li> <li>Berlin (BE)</li> <li>Hanover (HA)</li> <li>Stoxx (SX)</li> <li>TradeGate (TG)</li> <li>Zertifikate (SC)</li> <li>Index</li> <li>Warrant</li></ul></td> <td>End-of-day</td> </tr> </tbody> </table>

Parameters:

  • symbol (String)

    Symbol.

  • date (Date)

    Date: 2020-04-02.

  • limit (Integer)

    Limit number of ticks returned. Maximum value: &lt;code&gt;25000&lt;/code&gt;

  • skip (Integer)

    Number of ticks to skip. Use this parameter to loop through the entire data.

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

    the optional parameters

Returns:



4766
4767
4768
4769
# File 'lib/finnhub_ruby/api/default_api.rb', line 4766

def stock_tick(symbol, date, limit, skip, opts = {})
  data, _status_code, _headers = stock_tick_with_http_info(symbol, date, limit, skip, opts)
  data
end

#stock_tick_with_http_info(symbol, date, limit, skip, opts = {}) ⇒ Array<(TickData, Integer, Hash)>

Tick Data &lt;p&gt;Get historical tick data for global exchanges. You can send the request directly to our tick server at &lt;a href&#x3D;&quot;tick.finnhub.io/&quot;&gt;tick.finnhub.io/&lt;/a&gt; with the same path and parameters or get redirected there if you call our main server.&lt;/p&gt;&lt;p&gt;For US market, you can visit our bulk download page in the Dashboard &lt;a target&#x3D;&quot;_blank&quot; href&#x3D;&quot;/dashboard/download&quot;,&gt;here&lt;/a&gt; to speed up the download process.&lt;/p&gt;&lt;table class&#x3D;&quot;table table-hover&quot;&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;Exchange&lt;/th&gt; &lt;th&gt;Segment&lt;/th&gt; &lt;th&gt;Delay&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td class&#x3D;&quot;text-blue&quot;&gt;US CTA/UTP&lt;/th&gt; &lt;td&gt;Full SIP&lt;/td&gt; &lt;td&gt;15 minute&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class&#x3D;&quot;text-blue&quot;&gt;TSX&lt;/th&gt; &lt;td&gt;&lt;ul&gt;&lt;li&gt;TSX&lt;/li&gt;&lt;li&gt;TSX Venture&lt;/li&gt;&lt;li&gt;Index&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt; &lt;td&gt;End-of-day&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class&#x3D;&quot;text-blue&quot;&gt;LSE&lt;/th&gt; &lt;td&gt;&lt;ul&gt;&lt;li&gt;London Stock Exchange (L)&lt;/li&gt;&lt;li&gt;LSE International (L)&lt;/li&gt;&lt;li&gt;LSE European (L)&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt; &lt;td&gt;15 minute&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class&#x3D;&quot;text-blue&quot;&gt;Euronext&lt;/th&gt; &lt;td&gt;&lt;ul&gt; &lt;li&gt;Euronext Paris (PA)&lt;/li&gt; &lt;li&gt;Euronext Amsterdam (AS)&lt;/li&gt; &lt;li&gt;Euronext Lisbon (LS)&lt;/li&gt; &lt;li&gt;Euronext Brussels (BR)&lt;/li&gt; &lt;li&gt;Euronext Oslo (OL)&lt;/li&gt; &lt;li&gt;Euronext London (LN)&lt;/li&gt; &lt;li&gt;Euronext Dublin (IR)&lt;/li&gt; &lt;li&gt;Index&lt;/li&gt; &lt;li&gt;Warrant&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt; &lt;td&gt;End-of-day&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td class&#x3D;&quot;text-blue&quot;&gt;Deutsche Börse&lt;/th&gt; &lt;td&gt;&lt;ul&gt; &lt;li&gt;Frankfurt (F)&lt;/li&gt; &lt;li&gt;Xetra (DE)&lt;/li&gt; &lt;li&gt;Duesseldorf (DU)&lt;/li&gt; &lt;li&gt;Hamburg (HM)&lt;/li&gt; &lt;li&gt;Berlin (BE)&lt;/li&gt; &lt;li&gt;Hanover (HA)&lt;/li&gt; &lt;li&gt;Stoxx (SX)&lt;/li&gt; &lt;li&gt;TradeGate (TG)&lt;/li&gt; &lt;li&gt;Zertifikate (SC)&lt;/li&gt; &lt;li&gt;Index&lt;/li&gt; &lt;li&gt;Warrant&lt;/li&gt;&lt;/ul&gt;&lt;/td&gt; &lt;td&gt;End-of-day&lt;/td&gt; &lt;/tr&gt; &lt;/tbody&gt; &lt;/table&gt;

Parameters:

  • symbol (String)

    Symbol.

  • date (Date)

    Date: 2020-04-02.

  • limit (Integer)

    Limit number of ticks returned. Maximum value: &lt;code&gt;25000&lt;/code&gt;

  • skip (Integer)

    Number of ticks to skip. Use this parameter to loop through the entire data.

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

    the optional parameters

Returns:

  • (Array<(TickData, Integer, Hash)>)

    TickData data, response status code and response headers



4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
# File 'lib/finnhub_ruby/api/default_api.rb', line 4779

def stock_tick_with_http_info(symbol, date, limit, skip, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_tick ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_tick"
  end
  # verify the required parameter 'date' is set
  if @api_client.config.client_side_validation && date.nil?
    fail ArgumentError, "Missing the required parameter 'date' when calling DefaultApi.stock_tick"
  end
  # verify the required parameter 'limit' is set
  if @api_client.config.client_side_validation && limit.nil?
    fail ArgumentError, "Missing the required parameter 'limit' when calling DefaultApi.stock_tick"
  end
  # verify the required parameter 'skip' is set
  if @api_client.config.client_side_validation && skip.nil?
    fail ArgumentError, "Missing the required parameter 'skip' when calling DefaultApi.stock_tick"
  end
  # resource path
  local_var_path = '/stock/tick'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'date'] = date
  query_params[:'limit'] = limit
  query_params[:'skip'] = skip

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'TickData'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_tick",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_tick\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_usa_spending(symbol, from, to, opts = {}) ⇒ UsaSpendingResult

USA Spending Get a list of government’s spending activities from USASpending dataset for public companies. This dataset can help you identify companies that win big government contracts which is extremely important for industries such as Defense, Aerospace, and Education.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter for &lt;code&gt;actionDate&lt;/code&gt;

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter for &lt;code&gt;actionDate&lt;/code&gt;

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

    the optional parameters

Returns:



4850
4851
4852
4853
# File 'lib/finnhub_ruby/api/default_api.rb', line 4850

def stock_usa_spending(symbol, from, to, opts = {})
  data, _status_code, _headers = stock_usa_spending_with_http_info(symbol, from, to, opts)
  data
end

#stock_usa_spending_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(UsaSpendingResult, Integer, Hash)>

USA Spending Get a list of government&#39;s spending activities from USASpending dataset for public companies. This dataset can help you identify companies that win big government contracts which is extremely important for industries such as Defense, Aerospace, and Education.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter for &lt;code&gt;actionDate&lt;/code&gt;

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter for &lt;code&gt;actionDate&lt;/code&gt;

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

    the optional parameters

Returns:

  • (Array<(UsaSpendingResult, Integer, Hash)>)

    UsaSpendingResult data, response status code and response headers



4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
# File 'lib/finnhub_ruby/api/default_api.rb', line 4862

def stock_usa_spending_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_usa_spending ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_usa_spending"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_usa_spending"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_usa_spending"
  end
  # resource path
  local_var_path = '/stock/usa-spending'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsaSpendingResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_usa_spending",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_usa_spending\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_uspto_patent(symbol, from, to, opts = {}) ⇒ UsptoPatentResult

USPTO Patents List USPTO patents for companies. Limit to 250 records per API call.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

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

    the optional parameters

Returns:



4928
4929
4930
4931
# File 'lib/finnhub_ruby/api/default_api.rb', line 4928

def stock_uspto_patent(symbol, from, to, opts = {})
  data, _status_code, _headers = stock_uspto_patent_with_http_info(symbol, from, to, opts)
  data
end

#stock_uspto_patent_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(UsptoPatentResult, Integer, Hash)>

USPTO Patents List USPTO patents for companies. Limit to 250 records per API call.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;.

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

    the optional parameters

Returns:

  • (Array<(UsptoPatentResult, Integer, Hash)>)

    UsptoPatentResult data, response status code and response headers



4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
# File 'lib/finnhub_ruby/api/default_api.rb', line 4940

def stock_uspto_patent_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_uspto_patent ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_uspto_patent"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_uspto_patent"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_uspto_patent"
  end
  # resource path
  local_var_path = '/stock/uspto-patent'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'UsptoPatentResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_uspto_patent",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_uspto_patent\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#stock_visa_application(symbol, from, to, opts = {}) ⇒ VisaApplicationResult

H1-B Visa Application Get a list of H1-B and Permanent visa applications for companies from the DOL. The data is updated quarterly.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter on the &lt;code&gt;beginDate&lt;/code&gt; column.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter on the &lt;code&gt;beginDate&lt;/code&gt; column.

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

    the optional parameters

Returns:



5006
5007
5008
5009
# File 'lib/finnhub_ruby/api/default_api.rb', line 5006

def stock_visa_application(symbol, from, to, opts = {})
  data, _status_code, _headers = stock_visa_application_with_http_info(symbol, from, to, opts)
  data
end

#stock_visa_application_with_http_info(symbol, from, to, opts = {}) ⇒ Array<(VisaApplicationResult, Integer, Hash)>

H1-B Visa Application Get a list of H1-B and Permanent visa applications for companies from the DOL. The data is updated quarterly.

Parameters:

  • symbol (String)

    Symbol.

  • from (Date)

    From date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter on the &lt;code&gt;beginDate&lt;/code&gt; column.

  • to (Date)

    To date &lt;code&gt;YYYY-MM-DD&lt;/code&gt;. Filter on the &lt;code&gt;beginDate&lt;/code&gt; column.

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

    the optional parameters

Returns:

  • (Array<(VisaApplicationResult, Integer, Hash)>)

    VisaApplicationResult data, response status code and response headers



5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
# File 'lib/finnhub_ruby/api/default_api.rb', line 5018

def stock_visa_application_with_http_info(symbol, from, to, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.stock_visa_application ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_visa_application"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_visa_application"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_visa_application"
  end
  # resource path
  local_var_path = '/stock/visa-application'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'from'] = from
  query_params[:'to'] = to

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'VisaApplicationResult'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.stock_visa_application",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#stock_visa_application\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#supply_chain_relationships(symbol, opts = {}) ⇒ SupplyChainRelationships

Supply Chain Relationships <p>This endpoint provides an overall map of public companies’ key customers and suppliers. The data offers a deeper look into a company’s supply chain and how products are created. The data will help investors manage risk, limit exposure or generate alpha-generating ideas and trading insights.</p>

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:



5082
5083
5084
5085
# File 'lib/finnhub_ruby/api/default_api.rb', line 5082

def supply_chain_relationships(symbol, opts = {})
  data, _status_code, _headers = supply_chain_relationships_with_http_info(symbol, opts)
  data
end

#supply_chain_relationships_with_http_info(symbol, opts = {}) ⇒ Array<(SupplyChainRelationships, Integer, Hash)>

Supply Chain Relationships &lt;p&gt;This endpoint provides an overall map of public companies&#39; key customers and suppliers. The data offers a deeper look into a company&#39;s supply chain and how products are created. The data will help investors manage risk, limit exposure or generate alpha-generating ideas and trading insights.&lt;/p&gt;

Parameters:

  • symbol (String)

    Symbol.

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

    the optional parameters

Returns:

  • (Array<(SupplyChainRelationships, Integer, Hash)>)

    SupplyChainRelationships data, response status code and response headers



5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
# File 'lib/finnhub_ruby/api/default_api.rb', line 5092

def supply_chain_relationships_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.supply_chain_relationships ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.supply_chain_relationships"
  end
  # resource path
  local_var_path = '/stock/supply-chain'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SupplyChainRelationships'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.supply_chain_relationships",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#supply_chain_relationships\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#support_resistance(symbol, resolution, opts = {}) ⇒ SupportResistance

Support/Resistance Get support and resistance levels for a symbol.

Parameters:

  • symbol (String)

    Symbol

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

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

    the optional parameters

Returns:



5147
5148
5149
5150
# File 'lib/finnhub_ruby/api/default_api.rb', line 5147

def support_resistance(symbol, resolution, opts = {})
  data, _status_code, _headers = support_resistance_with_http_info(symbol, resolution, opts)
  data
end

#support_resistance_with_http_info(symbol, resolution, opts = {}) ⇒ Array<(SupportResistance, Integer, Hash)>

Support/Resistance Get support and resistance levels for a symbol.

Parameters:

  • symbol (String)

    Symbol

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

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

    the optional parameters

Returns:

  • (Array<(SupportResistance, Integer, Hash)>)

    SupportResistance data, response status code and response headers



5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
# File 'lib/finnhub_ruby/api/default_api.rb', line 5158

def support_resistance_with_http_info(symbol, resolution, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.support_resistance ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.support_resistance"
  end
  # verify the required parameter 'resolution' is set
  if @api_client.config.client_side_validation && resolution.nil?
    fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.support_resistance"
  end
  # resource path
  local_var_path = '/scan/support-resistance'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'resolution'] = resolution

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SupportResistance'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.support_resistance",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#support_resistance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#symbol_search(q, opts = {}) ⇒ SymbolLookup

Symbol Lookup Search for best-matching symbols based on your query. You can input anything from symbol, security’s name to ISIN and Cusip.

Parameters:

  • q (String)

    Query text can be symbol, name, isin, or cusip.

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

    the optional parameters

Returns:



5217
5218
5219
5220
# File 'lib/finnhub_ruby/api/default_api.rb', line 5217

def symbol_search(q, opts = {})
  data, _status_code, _headers = symbol_search_with_http_info(q, opts)
  data
end

#symbol_search_with_http_info(q, opts = {}) ⇒ Array<(SymbolLookup, Integer, Hash)>

Symbol Lookup Search for best-matching symbols based on your query. You can input anything from symbol, security&#39;s name to ISIN and Cusip.

Parameters:

  • q (String)

    Query text can be symbol, name, isin, or cusip.

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

    the optional parameters

Returns:

  • (Array<(SymbolLookup, Integer, Hash)>)

    SymbolLookup data, response status code and response headers



5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
# File 'lib/finnhub_ruby/api/default_api.rb', line 5227

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

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'q'] = q

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'SymbolLookup'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.symbol_search",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#symbol_search\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#technical_indicator(symbol, resolution, from, to, indicator, opts = {}) ⇒ Object

Technical Indicators Return technical indicator with price data. List of supported indicators can be found <a href="docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing" target="_blank">here</a>.

Parameters:

  • symbol (String)

    symbol

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

  • indicator (String)

    Indicator name. Full list can be found &lt;a href&#x3D;&quot;docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp&#x3D;sharing&quot; target&#x3D;&quot;_blank&quot;&gt;here&lt;/a&gt;.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Object)


5286
5287
5288
5289
# File 'lib/finnhub_ruby/api/default_api.rb', line 5286

def technical_indicator(symbol, resolution, from, to, indicator, opts = {})
  data, _status_code, _headers = technical_indicator_with_http_info(symbol, resolution, from, to, indicator, opts)
  data
end

#technical_indicator_with_http_info(symbol, resolution, from, to, indicator, opts = {}) ⇒ Array<(Object, Integer, Hash)>

Technical Indicators Return technical indicator with price data. List of supported indicators can be found &lt;a href&#x3D;&quot;docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp&#x3D;sharing&quot; target&#x3D;&quot;_blank&quot;&gt;here&lt;/a&gt;.

Parameters:

  • symbol (String)

    symbol

  • resolution (String)

    Supported resolution includes &lt;code&gt;1, 5, 15, 30, 60, D, W, M &lt;/code&gt;.Some timeframes might not be available depending on the exchange.

  • from (Integer)

    UNIX timestamp. Interval initial value.

  • to (Integer)

    UNIX timestamp. Interval end value.

  • indicator (String)

    Indicator name. Full list can be found &lt;a href&#x3D;&quot;docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp&#x3D;sharing&quot; target&#x3D;&quot;_blank&quot;&gt;here&lt;/a&gt;.

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

    the optional parameters

Options Hash (opts):

Returns:

  • (Array<(Object, Integer, Hash)>)

    Object data, response status code and response headers



5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
# File 'lib/finnhub_ruby/api/default_api.rb', line 5301

def technical_indicator_with_http_info(symbol, resolution, from, to, indicator, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.technical_indicator ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.technical_indicator"
  end
  # verify the required parameter 'resolution' is set
  if @api_client.config.client_side_validation && resolution.nil?
    fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.technical_indicator"
  end
  # verify the required parameter 'from' is set
  if @api_client.config.client_side_validation && from.nil?
    fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.technical_indicator"
  end
  # verify the required parameter 'to' is set
  if @api_client.config.client_side_validation && to.nil?
    fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.technical_indicator"
  end
  # verify the required parameter 'indicator' is set
  if @api_client.config.client_side_validation && indicator.nil?
    fail ArgumentError, "Missing the required parameter 'indicator' when calling DefaultApi.technical_indicator"
  end
  # resource path
  local_var_path = '/indicator'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol
  query_params[:'resolution'] = resolution
  query_params[:'from'] = from
  query_params[:'to'] = to
  query_params[:'indicator'] = indicator

  # header parameters
  header_params = opts[: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 = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'indicator_fields'])

  # return_type
  return_type = opts[:debug_return_type] || 'Object'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.technical_indicator",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#technical_indicator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#transcripts(id, opts = {}) ⇒ EarningsCallTranscripts

Earnings Call Transcripts <p>Get earnings call transcripts, audio and participants’ list. This endpoint is only available for US, UK, and Candian companies. <p>15+ years of data is available with 220,000+ audio which add up to 7TB in size.</p>

Parameters:

  • id (String)

    Transcript&#39;s id obtained with &lt;a href&#x3D;&quot;#transcripts-list&quot;&gt;Transcripts List endpoint&lt;/a&gt;.

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

    the optional parameters

Returns:



5377
5378
5379
5380
# File 'lib/finnhub_ruby/api/default_api.rb', line 5377

def transcripts(id, opts = {})
  data, _status_code, _headers = transcripts_with_http_info(id, opts)
  data
end

#transcripts_list(symbol, opts = {}) ⇒ EarningsCallTranscriptsList

Earnings Call Transcripts List List earnings call transcripts’ metadata. This endpoint is available for US, UK, European, Australian and Canadian companies.

Parameters:

  • symbol (String)

    Company symbol: AAPL. Leave empty to list the latest transcripts

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

    the optional parameters

Returns:



5441
5442
5443
5444
# File 'lib/finnhub_ruby/api/default_api.rb', line 5441

def transcripts_list(symbol, opts = {})
  data, _status_code, _headers = transcripts_list_with_http_info(symbol, opts)
  data
end

#transcripts_list_with_http_info(symbol, opts = {}) ⇒ Array<(EarningsCallTranscriptsList, Integer, Hash)>

Earnings Call Transcripts List List earnings call transcripts&#39; metadata. This endpoint is available for US, UK, European, Australian and Canadian companies.

Parameters:

  • symbol (String)

    Company symbol: AAPL. Leave empty to list the latest transcripts

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

    the optional parameters

Returns:

  • (Array<(EarningsCallTranscriptsList, Integer, Hash)>)

    EarningsCallTranscriptsList data, response status code and response headers



5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
# File 'lib/finnhub_ruby/api/default_api.rb', line 5451

def transcripts_list_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.transcripts_list ...'
  end
  # verify the required parameter 'symbol' is set
  if @api_client.config.client_side_validation && symbol.nil?
    fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.transcripts_list"
  end
  # resource path
  local_var_path = '/stock/transcripts/list'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = symbol

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EarningsCallTranscriptsList'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.transcripts_list",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#transcripts_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#transcripts_with_http_info(id, opts = {}) ⇒ Array<(EarningsCallTranscripts, Integer, Hash)>

Earnings Call Transcripts &lt;p&gt;Get earnings call transcripts, audio and participants&#39; list. This endpoint is only available for US, UK, and Candian companies. &lt;p&gt;15+ years of data is available with 220,000+ audio which add up to 7TB in size.&lt;/p&gt;

Parameters:

  • id (String)

    Transcript&#39;s id obtained with &lt;a href&#x3D;&quot;#transcripts-list&quot;&gt;Transcripts List endpoint&lt;/a&gt;.

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

    the optional parameters

Returns:

  • (Array<(EarningsCallTranscripts, Integer, Hash)>)

    EarningsCallTranscripts data, response status code and response headers



5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
# File 'lib/finnhub_ruby/api/default_api.rb', line 5387

def transcripts_with_http_info(id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.transcripts ...'
  end
  # verify the required parameter 'id' is set
  if @api_client.config.client_side_validation && id.nil?
    fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.transcripts"
  end
  # resource path
  local_var_path = '/stock/transcripts'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'id'] = id

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'EarningsCallTranscripts'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.transcripts",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#transcripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#upgrade_downgrade(opts = {}) ⇒ Array<UpgradeDowngrade>

Stock Upgrade/Downgrade Get latest stock upgrade and downgrade.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol of the company: AAPL. If left blank, the API will return latest stock upgrades/downgrades.

  • :from (Date)

    From date: 2000-03-15.

  • :to (Date)

    To date: 2020-03-16.

Returns:



5507
5508
5509
5510
# File 'lib/finnhub_ruby/api/default_api.rb', line 5507

def upgrade_downgrade(opts = {})
  data, _status_code, _headers = upgrade_downgrade_with_http_info(opts)
  data
end

#upgrade_downgrade_with_http_info(opts = {}) ⇒ Array<(Array<UpgradeDowngrade>, Integer, Hash)>

Stock Upgrade/Downgrade Get latest stock upgrade and downgrade.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :symbol (String)

    Symbol of the company: AAPL. If left blank, the API will return latest stock upgrades/downgrades.

  • :from (Date)

    From date: 2000-03-15.

  • :to (Date)

    To date: 2020-03-16.

Returns:

  • (Array<(Array<UpgradeDowngrade>, Integer, Hash)>)

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



5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
# File 'lib/finnhub_ruby/api/default_api.rb', line 5519

def upgrade_downgrade_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.upgrade_downgrade ...'
  end
  # resource path
  local_var_path = '/stock/upgrade-downgrade'

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
  query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
  query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?

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

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'Array<UpgradeDowngrade>'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['api_key']

  new_options = opts.merge(
    :operation => :"DefaultApi.upgrade_downgrade",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: DefaultApi#upgrade_downgrade\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end