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
# 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[:body] 

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

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

  new_options = opts.merge(
    :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

#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, price, valuation, margin&lt;/code&gt;

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

    the optional parameters

Returns:



98
99
100
101
# File 'lib/finnhub_ruby/api/default_api.rb', line 98

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, price, valuation, margin&lt;/code&gt;

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

    the optional parameters

Returns:

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

    BasicFinancials data, response status code and response headers



109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/finnhub_ruby/api/default_api.rb', line 109

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[:body] 

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

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

  new_options = opts.merge(
    :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:



168
169
170
171
# File 'lib/finnhub_ruby/api/default_api.rb', line 168

def company_earnings(symbol, opts = {})
  data, _status_code, _headers = company_earnings_with_http_info(symbol, opts)
  data
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



179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
# File 'lib/finnhub_ruby/api/default_api.rb', line 179

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[:body] 

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

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

  new_options = opts.merge(
    :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_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:



234
235
236
237
# File 'lib/finnhub_ruby/api/default_api.rb', line 234

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



245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
# File 'lib/finnhub_ruby/api/default_api.rb', line 245

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[:body] 

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

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

  new_options = opts.merge(
    :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_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:



299
300
301
302
# File 'lib/finnhub_ruby/api/default_api.rb', line 299

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



309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
# File 'lib/finnhub_ruby/api/default_api.rb', line 309

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[:body] 

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

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

  new_options = opts.merge(
    :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<News>

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:



364
365
366
367
# File 'lib/finnhub_ruby/api/default_api.rb', line 364

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<News>, 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<News>, Integer, Hash)>)

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



376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
# File 'lib/finnhub_ruby/api/default_api.rb', line 376

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[:body] 

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

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

  new_options = opts.merge(
    :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 GICS sub-industry

Parameters:

  • symbol (String)

    Symbol of the company: AAPL.

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

    the optional parameters

Returns:

  • (Array<String>)


439
440
441
442
# File 'lib/finnhub_ruby/api/default_api.rb', line 439

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 GICS 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



449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
# File 'lib/finnhub_ruby/api/default_api.rb', line 449

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[:body] 

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

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

  new_options = opts.merge(
    :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:



504
505
506
507
# File 'lib/finnhub_ruby/api/default_api.rb', line 504

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:



569
570
571
572
# File 'lib/finnhub_ruby/api/default_api.rb', line 569

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



581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
# File 'lib/finnhub_ruby/api/default_api.rb', line 581

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[:body] 

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

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

  new_options = opts.merge(
    :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



516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
# File 'lib/finnhub_ruby/api/default_api.rb', line 516

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[:body] 

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

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

  new_options = opts.merge(
    :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:



633
634
635
636
# File 'lib/finnhub_ruby/api/default_api.rb', line 633

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



644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 644

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[:body] 

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

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

  new_options = opts.merge(
    :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:



697
698
699
700
# File 'lib/finnhub_ruby/api/default_api.rb', line 697

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



706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
# File 'lib/finnhub_ruby/api/default_api.rb', line 706

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[:body] 

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

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

  new_options = opts.merge(
    :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:



753
754
755
756
# File 'lib/finnhub_ruby/api/default_api.rb', line 753

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



762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
# File 'lib/finnhub_ruby/api/default_api.rb', line 762

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[:body] 

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

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

  new_options = opts.merge(
    :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:



813
814
815
816
# File 'lib/finnhub_ruby/api/default_api.rb', line 813

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



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
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
# File 'lib/finnhub_ruby/api/default_api.rb', line 826

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[:body] 

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

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

  new_options = opts.merge(
    :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>)


893
894
895
896
# File 'lib/finnhub_ruby/api/default_api.rb', line 893

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



902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
# File 'lib/finnhub_ruby/api/default_api.rb', line 902

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[:body] 

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

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

  new_options = opts.merge(
    :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_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:



950
951
952
953
# File 'lib/finnhub_ruby/api/default_api.rb', line 950

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



960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
# File 'lib/finnhub_ruby/api/default_api.rb', line 960

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[:body] 

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

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

  new_options = opts.merge(
    :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 dating back to 2003. You can setup <a href="#webhook">webhook</a> to receive real-time earnings update.

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 (AnyType)

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

Returns:



1016
1017
1018
1019
# File 'lib/finnhub_ruby/api/default_api.rb', line 1016

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 dating back to 2003. You can setup &lt;a href&#x3D;&quot;#webhook&quot;&gt;webhook&lt;/a&gt; to receive real-time earnings update.

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 (AnyType)

    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



1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
# File 'lib/finnhub_ruby/api/default_api.rb', line 1029

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[:body] 

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

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

  new_options = opts.merge(
    :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_code(opts = {}) ⇒ Array<EconomicCode>

Economic Code List codes of supported economic data.

Parameters:

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

    the optional parameters

Returns:



1080
1081
1082
1083
# File 'lib/finnhub_ruby/api/default_api.rb', line 1080

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



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
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
# File 'lib/finnhub_ruby/api/default_api.rb', line 1089

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[:body] 

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

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

  new_options = opts.merge(
    :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:



1137
1138
1139
1140
# File 'lib/finnhub_ruby/api/default_api.rb', line 1137

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



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
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
# File 'lib/finnhub_ruby/api/default_api.rb', line 1147

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[:body] 

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

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

  new_options = opts.merge(
    :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

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

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:



1205
1206
1207
1208
# File 'lib/finnhub_ruby/api/default_api.rb', line 1205

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

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

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



1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
# File 'lib/finnhub_ruby/api/default_api.rb', line 1220

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[:body] 

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

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

  new_options = opts.merge(
    :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 Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years.

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:



1276
1277
1278
1279
# File 'lib/finnhub_ruby/api/default_api.rb', line 1276

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:



1354
1355
1356
1357
# File 'lib/finnhub_ruby/api/default_api.rb', line 1354

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



1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1367

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[:body] 

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

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

  new_options = opts.merge(
    :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 Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years.

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



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
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
# File 'lib/finnhub_ruby/api/default_api.rb', line 1288

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[:body] 

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

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

  new_options = opts.merge(
    :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:



1422
1423
1424
1425
# File 'lib/finnhub_ruby/api/default_api.rb', line 1422

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



1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1435

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[:body] 

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

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

  new_options = opts.merge(
    :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>)


1502
1503
1504
1505
# File 'lib/finnhub_ruby/api/default_api.rb', line 1502

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



1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1511

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[:body] 

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

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

  new_options = opts.merge(
    :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.

Returns:



1559
1560
1561
1562
# File 'lib/finnhub_ruby/api/default_api.rb', line 1559

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.

Returns:

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

    Forexrates data, response status code and response headers



1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1569

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?

  # 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[:body] 

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

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

  new_options = opts.merge(
    :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:



1618
1619
1620
1621
# File 'lib/finnhub_ruby/api/default_api.rb', line 1618

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



1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1628

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[:body] 

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

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

  new_options = opts.merge(
    :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.

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:



1682
1683
1684
1685
# File 'lib/finnhub_ruby/api/default_api.rb', line 1682

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.

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



1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1693

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[:body] 

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

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

  new_options = opts.merge(
    :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

#general_news(category, opts = {}) ⇒ Array<News>

General 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 (String)

    Use this field to get only news after this ID. Default to 0

Returns:



1748
1749
1750
1751
# File 'lib/finnhub_ruby/api/default_api.rb', line 1748

def general_news(category, opts = {})
  data, _status_code, _headers = general_news_with_http_info(category, opts)
  data
end

#general_news_with_http_info(category, opts = {}) ⇒ Array<(Array<News>, Integer, Hash)>

General 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 (String)

    Use this field to get only news after this ID. Default to 0

Returns:

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

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



1759
1760
1761
1762
1763
1764
1765
1766
1767
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1759

def general_news_with_http_info(category, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.general_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.general_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[:body] 

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

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

  new_options = opts.merge(
    :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#general_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#investors_ownership(symbol, opts = {}) ⇒ InvestorsOwnership

Investors Ownership Get a full list of shareholders/investors of a company in descending order of the number of shares held.

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:



1814
1815
1816
1817
# File 'lib/finnhub_ruby/api/default_api.rb', line 1814

def investors_ownership(symbol, opts = {})
  data, _status_code, _headers = investors_ownership_with_http_info(symbol, opts)
  data
end

#investors_ownership_with_http_info(symbol, opts = {}) ⇒ Array<(InvestorsOwnership, Integer, Hash)>

Investors Ownership Get a full list of shareholders/investors of a company in descending order of the number of shares held.

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<(InvestorsOwnership, Integer, Hash)>)

    InvestorsOwnership data, response status code and response headers



1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1825

def investors_ownership_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.investors_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.investors_ownership"
  end
  # resource path
  local_var_path = '/stock/investor-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[:body] 

  # return_type
  return_type = opts[:return_type] || 'InvestorsOwnership' 

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

  new_options = opts.merge(
    :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#investors_ownership\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 coming IPO.

Parameters:

  • from (Date)

    From date: 2020-03-15.

  • to (Date)

    To date: 2020-03-16.

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

    the optional parameters

Returns:



1880
1881
1882
1883
# File 'lib/finnhub_ruby/api/default_api.rb', line 1880

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 coming 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



1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 1891

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'IPOCalendar' 

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

  new_options = opts.merge(
    :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

#major_developments(symbol, opts = {}) ⇒ MajorDevelopments

Major Developments List latest major developments of a company going back 20 years with 12M+ data points. This data can be used to highlight the most significant events.

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:



1951
1952
1953
1954
# File 'lib/finnhub_ruby/api/default_api.rb', line 1951

def major_developments(symbol, opts = {})
  data, _status_code, _headers = major_developments_with_http_info(symbol, opts)
  data
end

#major_developments_with_http_info(symbol, opts = {}) ⇒ Array<(MajorDevelopments, Integer, Hash)>

Major Developments List latest major developments of a company going back 20 years with 12M+ data points. This data can be used to highlight the most significant events.

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<(MajorDevelopments, Integer, Hash)>)

    MajorDevelopments data, response status code and response headers



1963
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 1963

def major_developments_with_http_info(symbol, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: DefaultApi.major_developments ...'
  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.major_developments"
  end
  # resource path
  local_var_path = '/major-development'

  # 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[:body] 

  # return_type
  return_type = opts[:return_type] || 'MajorDevelopments' 

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

  new_options = opts.merge(
    :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#major_developments\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:



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

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



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
2069
2070
2071
2072
2073
2074
# File 'lib/finnhub_ruby/api/default_api.rb', line 2028

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'NewsSentiment' 

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

  new_options = opts.merge(
    :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

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



2082
2083
2084
2085
# File 'lib/finnhub_ruby/api/default_api.rb', line 2082

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



2093
2094
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
2144
# File 'lib/finnhub_ruby/api/default_api.rb', line 2093

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'PatternRecognition' 

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

  new_options = opts.merge(
    :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

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



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

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



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 2161

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'PriceTarget' 

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

  new_options = opts.merge(
    :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 update.</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:



2214
2215
2216
2217
# File 'lib/finnhub_ruby/api/default_api.rb', line 2214

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 update.&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



2224
2225
2226
2227
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 2224

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'Quote' 

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

  new_options = opts.merge(
    :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:



2277
2278
2279
2280
# File 'lib/finnhub_ruby/api/default_api.rb', line 2277

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



2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 2287

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[:body] 

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

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

  new_options = opts.merge(
    :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

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



2340
2341
2342
2343
# File 'lib/finnhub_ruby/api/default_api.rb', line 2340

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



2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
# File 'lib/finnhub_ruby/api/default_api.rb', line 2350

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'LastBidAsk' 

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

  new_options = opts.merge(
    :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 for stocks going back 25 years for US stocks.</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.

  • 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

Options Hash (opts):

  • :adjusted (String)

    By default, &lt;code&gt;adjusted&#x3D;false&lt;/code&gt;. Use &lt;code&gt;true&lt;/code&gt; to get adjusted data.

Returns:



2407
2408
2409
2410
# File 'lib/finnhub_ruby/api/default_api.rb', line 2407

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 for stocks going back 25 years for US stocks.&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.

  • 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

Options Hash (opts):

  • :adjusted (String)

    By default, &lt;code&gt;adjusted&#x3D;false&lt;/code&gt;. Use &lt;code&gt;true&lt;/code&gt; to get adjusted data.

Returns:

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

    StockCandles data, response status code and response headers



2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 2421

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
  query_params[:'adjusted'] = opts[:'adjusted'] if !opts[:'adjusted'].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[:body] 

  # return_type
  return_type = opts[:return_type] || 'StockCandles' 

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

  new_options = opts.merge(
    :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:



2492
2493
2494
2495
# File 'lib/finnhub_ruby/api/default_api.rb', line 2492

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



2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
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
2560
# File 'lib/finnhub_ruby/api/default_api.rb', line 2504

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[:body] 

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

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

  new_options = opts.merge(
    :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_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:



2569
2570
2571
2572
# File 'lib/finnhub_ruby/api/default_api.rb', line 2569

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



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
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
# File 'lib/finnhub_ruby/api/default_api.rb', line 2581

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[:body] 

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

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

  new_options = opts.merge(
    :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<Stock>

Stock Symbol List supported stocks.

Parameters:

Returns:



2644
2645
2646
2647
# File 'lib/finnhub_ruby/api/default_api.rb', line 2644

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<Stock>, Integer, Hash)>

Stock Symbol List supported stocks.

Parameters:

Returns:

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

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



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
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
# File 'lib/finnhub_ruby/api/default_api.rb', line 2654

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

  # 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[:body] 

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

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

  new_options = opts.merge(
    :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 US stocks from all 13 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. Data is updated at the end of each trading day.</p><p>Tick data from 1985 is available for Enterprise clients. <a href="[email protected]">Contact us</a> to learn more.</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:



2710
2711
2712
2713
# File 'lib/finnhub_ruby/api/default_api.rb', line 2710

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 US stocks from all 13 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. Data is updated at the end of each trading day.&lt;/p&gt;&lt;p&gt;Tick data from 1985 is available for Enterprise clients. &lt;a href&#x3D;&quot;[email protected]&quot;&gt;Contact us&lt;/a&gt; to learn more.&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<(TickData, Integer, Hash)>)

    TickData data, response status code and response headers



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
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
# File 'lib/finnhub_ruby/api/default_api.rb', line 2723

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'TickData' 

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

  new_options = opts.merge(
    :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

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



2792
2793
2794
2795
# File 'lib/finnhub_ruby/api/default_api.rb', line 2792

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



2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
# File 'lib/finnhub_ruby/api/default_api.rb', line 2803

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'SupportResistance' 

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

  new_options = opts.merge(
    :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

#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)


2866
2867
2868
2869
# File 'lib/finnhub_ruby/api/default_api.rb', line 2866

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



2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 2881

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[:body] || @api_client.object_to_http_body(opts[:'indicator_fields']) 

  # return_type
  return_type = opts[:return_type] || 'Object' 

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

  new_options = opts.merge(
    :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 companies. <p>17+ years of data is available with 170,000+ audio which add up to 6TB 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:



2956
2957
2958
2959
# File 'lib/finnhub_ruby/api/default_api.rb', line 2956

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 only available for US companies.

Parameters:

  • symbol (String)

    Company symbol: AAPL. Leave empty to list the latest transcripts

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

    the optional parameters

Returns:



3019
3020
3021
3022
# File 'lib/finnhub_ruby/api/default_api.rb', line 3019

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 only available for US 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



3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 3029

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'EarningsCallTranscriptsList' 

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

  new_options = opts.merge(
    :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 companies. &lt;p&gt;17+ years of data is available with 170,000+ audio which add up to 6TB 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



2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 2966

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[:body] 

  # return_type
  return_type = opts[:return_type] || 'EarningsCallTranscripts' 

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

  new_options = opts.merge(
    :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:



3084
3085
3086
3087
# File 'lib/finnhub_ruby/api/default_api.rb', line 3084

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



3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
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
# File 'lib/finnhub_ruby/api/default_api.rb', line 3096

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[:body] 

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

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

  new_options = opts.merge(
    :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