Class: FinnhubRuby::DefaultApi

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

Constant Summary collapse

API_URL =
'https://api.finnhub.io/api/v1'
DEFAULT_TIMEOUT =
10

Instance Method Summary collapse

Constructor Details

#initialize(api_client = nil) ⇒ DefaultApi

Returns a new instance of DefaultApi.



43
44
45
46
# File 'lib/finnhub_ruby.rb', line 43

def initialize(api_client = nil)
  # api_client is unused, but kept for compatibility with openapi-generator pattern
  @config = Configuration.default
end

Instance Method Details

#aggregate_indicator(symbol, resolution) ⇒ Object



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

def aggregate_indicator(symbol, resolution)
  get('/scan/technical-indicator', { symbol: symbol, resolution: resolution })
end

#airline_price_index(airline, from, to) ⇒ Object



490
491
492
# File 'lib/finnhub_ruby.rb', line 490

def airline_price_index(airline, from, to)
  get('/airline/price-index', { airline: airline, from: from, to: to })
end

#bond_price(isin, from, to) ⇒ Object



430
431
432
# File 'lib/finnhub_ruby.rb', line 430

def bond_price(isin, from, to)
  get('/bond/price', { isin: isin, from: from, to: to })
end

#bond_profile(params = {}) ⇒ Object



426
427
428
# File 'lib/finnhub_ruby.rb', line 426

def bond_profile(params = {})
  get('/bond/profile', params)
end

#bond_tick(isin, date, limit, skip, exchange: 'trace', format: 'json', **kwargs) ⇒ Object



470
471
472
# File 'lib/finnhub_ruby.rb', line 470

def bond_tick(isin, date, limit, skip, exchange: 'trace', format: 'json', **kwargs)
  get('/bond/tick', { isin: isin, date: date, limit: limit, skip: skip, exchange: exchange, format: format }.merge(kwargs))
end

#bond_yield_curve(code) ⇒ Object



474
475
476
# File 'lib/finnhub_ruby.rb', line 474

def bond_yield_curve(code)
  get('/bond/yield-curve', { code: code })
end

#company_basic_financials(symbol, metric) ⇒ Object



150
151
152
# File 'lib/finnhub_ruby.rb', line 150

def company_basic_financials(symbol, metric)
  get('/stock/metric', { symbol: symbol, metric: metric })
end

#company_earnings(symbol, limit: nil) ⇒ Object



166
167
168
# File 'lib/finnhub_ruby.rb', line 166

def company_earnings(symbol, limit: nil)
  get('/stock/earnings', { symbol: symbol, limit: limit }.compact)
end

#company_earnings_quality_score(symbol, freq) ⇒ Object



402
403
404
# File 'lib/finnhub_ruby.rb', line 402

def company_earnings_quality_score(symbol, freq)
  get('/stock/earnings-quality-score', { symbol: symbol, freq: freq })
end

#company_ebit_estimates(symbol, freq: nil) ⇒ Object



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

def company_ebit_estimates(symbol, freq: nil)
  get('/stock/ebit-estimate', { symbol: symbol, freq: freq }.compact)
end

#company_ebitda_estimates(symbol, freq: nil) ⇒ Object



174
175
176
# File 'lib/finnhub_ruby.rb', line 174

def company_ebitda_estimates(symbol, freq: nil)
  get('/stock/ebitda-estimate', { symbol: symbol, freq: freq }.compact)
end

#company_eps_estimates(symbol, freq: nil) ⇒ Object



182
183
184
# File 'lib/finnhub_ruby.rb', line 182

def company_eps_estimates(symbol, freq: nil)
  get('/stock/eps-estimate', { symbol: symbol, freq: freq }.compact)
end

#company_esg_score(symbol) ⇒ Object



390
391
392
# File 'lib/finnhub_ruby.rb', line 390

def company_esg_score(symbol)
  get('/stock/esg', { symbol: symbol })
end

#company_executive(symbol) ⇒ Object



114
115
116
# File 'lib/finnhub_ruby.rb', line 114

def company_executive(symbol)
  get('/stock/executive', { symbol: symbol })
end

#company_historical_esg_score(symbol) ⇒ Object



394
395
396
# File 'lib/finnhub_ruby.rb', line 394

def company_historical_esg_score(symbol)
  get('/stock/historical-esg', { symbol: symbol })
end

#company_news(symbol, from, to) ⇒ Object



262
263
264
# File 'lib/finnhub_ruby.rb', line 262

def company_news(symbol, from, to)
  get('/company-news', { symbol: symbol, from: from, to: to })
end

#company_peers(symbol) ⇒ Object



146
147
148
# File 'lib/finnhub_ruby.rb', line 146

def company_peers(symbol)
  get('/stock/peers', { symbol: symbol })
end

#company_profile(params = {}) ⇒ Object



90
91
92
# File 'lib/finnhub_ruby.rb', line 90

def company_profile(params = {})
  get('/stock/profile', params)
end

#company_profile2(params = {}) ⇒ Object



94
95
96
# File 'lib/finnhub_ruby.rb', line 94

def company_profile2(params = {})
  get('/stock/profile2', params)
end

#company_revenue_estimates(symbol, freq: nil) ⇒ Object



170
171
172
# File 'lib/finnhub_ruby.rb', line 170

def company_revenue_estimates(symbol, freq: nil)
  get('/stock/revenue-estimate', { symbol: symbol, freq: freq }.compact)
end

#congressional_trading(symbol, from, to) ⇒ Object



466
467
468
# File 'lib/finnhub_ruby.rb', line 466

def congressional_trading(symbol, from, to)
  get('/stock/congressional-trading', { symbol: symbol, from: from, to: to })
end

#countryObject



274
275
276
# File 'lib/finnhub_ruby.rb', line 274

def country
  get('/country')
end

#covid19Object



506
507
508
# File 'lib/finnhub_ruby.rb', line 506

def covid19
  get('/covid19/us')
end

#crypto_candles(symbol, resolution, from, to, format: 'json') ⇒ Object



238
239
240
# File 'lib/finnhub_ruby.rb', line 238

def crypto_candles(symbol, resolution, from, to, format: 'json')
  get('/crypto/candle', { symbol: symbol, resolution: resolution, from: from, to: to, format: format })
end

#crypto_exchangesObject



102
103
104
# File 'lib/finnhub_ruby.rb', line 102

def crypto_exchanges
  get('/crypto/exchange')
end

#crypto_profile(symbol) ⇒ Object



406
407
408
# File 'lib/finnhub_ruby.rb', line 406

def crypto_profile(symbol)
  get('/crypto/profile', { symbol: symbol })
end

#crypto_symbols(exchange) ⇒ Object



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

def crypto_symbols(exchange)
  get('/crypto/symbol', { exchange: exchange })
end

#earnings_calendar(from:, to:, symbol: '', international: false) ⇒ Object



290
291
292
# File 'lib/finnhub_ruby.rb', line 290

def earnings_calendar(from:, to:, symbol: '', international: false)
  get('/calendar/earnings', { from: from, to: to, symbol: symbol, international: international })
end

#earnings_call_live(from, to, symbol: '') ⇒ Object



494
495
496
# File 'lib/finnhub_ruby.rb', line 494

def earnings_call_live(from, to, symbol: '')
  get('/stock/earnings-call-live', { symbol: symbol, from: from, to: to })
end

#economic_calendar(from: nil, to: nil) ⇒ Object



286
287
288
# File 'lib/finnhub_ruby.rb', line 286

def economic_calendar(from: nil, to: nil)
  get('/calendar/economic', { from: from, to: to }.compact)
end

#economic_codeObject



278
279
280
# File 'lib/finnhub_ruby.rb', line 278

def economic_code
  get('/economic/code')
end

#economic_data(code) ⇒ Object



282
283
284
# File 'lib/finnhub_ruby.rb', line 282

def economic_data(code)
  get('/economic', { code: code })
end

#etfs_country_exp(symbol) ⇒ Object



318
319
320
# File 'lib/finnhub_ruby.rb', line 318

def etfs_country_exp(symbol)
  get('/etf/country', { symbol: symbol })
end

#etfs_holdings(symbol: nil, isin: nil, skip: nil, date: nil) ⇒ Object



310
311
312
# File 'lib/finnhub_ruby.rb', line 310

def etfs_holdings(symbol: nil, isin: nil, skip: nil, date: nil)
  get('/etf/holdings', { symbol: symbol, isin: isin, skip: skip, date: date }.compact)
end

#etfs_profile(symbol: nil, isin: nil) ⇒ Object



306
307
308
# File 'lib/finnhub_ruby.rb', line 306

def etfs_profile(symbol: nil, isin: nil)
  get('/etf/profile', { symbol: symbol, isin: isin }.compact)
end

#etfs_sector_exp(symbol) ⇒ Object



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

def etfs_sector_exp(symbol)
  get('/etf/sector', { symbol: symbol })
end

#exchangeObject



186
187
188
# File 'lib/finnhub_ruby.rb', line 186

def exchange
  get('/stock/exchange')
end

#fda_calendarObject



338
339
340
# File 'lib/finnhub_ruby.rb', line 338

def fda_calendar
  get('/fda-advisory-committee-calendar')
end

#filings(symbol: '', cik: '', access_number: '', form: '', from: '', to: '') ⇒ Object



190
191
192
# File 'lib/finnhub_ruby.rb', line 190

def filings(symbol: '', cik: '', access_number: '', form: '', from: '', to: '')
  get('/stock/filings', { symbol: symbol, cik: cik, accessNumber: access_number, form: form, from: from, to: to }.compact)
end

#financials(symbol, statement, freq) ⇒ Object



154
155
156
# File 'lib/finnhub_ruby.rb', line 154

def financials(symbol, statement, freq)
  get('/stock/financials', { symbol: symbol, statement: statement, freq: freq })
end

#financials_reported(params = {}) ⇒ Object



158
159
160
# File 'lib/finnhub_ruby.rb', line 158

def financials_reported(params = {})
  get('/stock/financials-reported', params)
end

#forex_candles(symbol, resolution, from, to, format: 'json') ⇒ Object



230
231
232
# File 'lib/finnhub_ruby.rb', line 230

def forex_candles(symbol, resolution, from, to, format: 'json')
  get('/forex/candle', { symbol: symbol, resolution: resolution, from: from, to: to, format: format })
end

#forex_exchangesObject



106
107
108
# File 'lib/finnhub_ruby.rb', line 106

def forex_exchanges
  get('/forex/exchange')
end

#forex_rates(params = {}) ⇒ Object



222
223
224
# File 'lib/finnhub_ruby.rb', line 222

def forex_rates(params = {})
  get('/forex/rates', params)
end

#forex_symbols(exchange) ⇒ Object



226
227
228
# File 'lib/finnhub_ruby.rb', line 226

def forex_symbols(exchange)
  get('/forex/symbol', { exchange: exchange })
end

#fund_ownership(symbol, limit: nil) ⇒ Object



162
163
164
# File 'lib/finnhub_ruby.rb', line 162

def fund_ownership(symbol, limit: nil)
  get('/stock/fund-ownership', { symbol: symbol, limit: limit }.compact)
end

#general_news(category, min_id: 0) ⇒ Object



258
259
260
# File 'lib/finnhub_ruby.rb', line 258

def general_news(category, min_id: 0)
  get('/news', { category: category, minId: min_id })
end

#get(path, params = {}) ⇒ Object



48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'lib/finnhub_ruby.rb', line 48

def get(path, params = {})
  # Ensure exactly one slash between base and path
  base = API_URL.chomp('/')
  path = path.start_with?('/') ? path : "/#{path}"
  url = "#{base}#{path}"
  uri = URI.parse(url)
  params = params.dup
  params['token'] = @config.api_key['api_key']
  uri.query = URI.encode_www_form(params)
  puts(uri)

  # Some endpoints redirect to another endpoint, so we need to handle that
  limit = 2
  res = nil

  loop do
    raise FinnhubRequestException, 'Too many redirects' if limit.zero?

    req = Net::HTTP::Get.new(uri)
    req['Accept'] = 'application/json'
    req['User-Agent'] = "finnhub/ruby/#{VERSION}"

    http = Net::HTTP.new(uri.host, uri.port)
    http.use_ssl = (uri.scheme == 'https')
    http.read_timeout = DEFAULT_TIMEOUT
    http.open_timeout = DEFAULT_TIMEOUT

    res = http.request(req)

    break unless res.is_a?(Net::HTTPRedirection)

    uri = URI(res['location'])
    limit -= 1
  end

  handle_response(res)
end

#historical_employee_count(symbol, from, to) ⇒ Object



486
487
488
# File 'lib/finnhub_ruby.rb', line 486

def historical_employee_count(symbol, from, to)
  get('/stock/historical-employee-count', { symbol: symbol, from: from, to: to })
end

#historical_market_cap(symbol, from: nil, to: nil) ⇒ Object



398
399
400
# File 'lib/finnhub_ruby.rb', line 398

def historical_market_cap(symbol, from: nil, to: nil)
  get('/stock/historical-market-cap', { symbol: symbol, from: from, to: to }.compact)
end

#indices_const(params = {}) ⇒ Object



298
299
300
# File 'lib/finnhub_ruby.rb', line 298

def indices_const(params = {})
  get('/index/constituents', params)
end

#indices_hist_const(params = {}) ⇒ Object



302
303
304
# File 'lib/finnhub_ruby.rb', line 302

def indices_hist_const(params = {})
  get('/index/historical-constituents', params)
end

#institutional_ownership(symbol, cusip, from, to) ⇒ Object



462
463
464
# File 'lib/finnhub_ruby.rb', line 462

def institutional_ownership(symbol, cusip, from, to)
  get('/institutional/ownership', { symbol: symbol, cusip: cusip, from: from, to: to })
end

#institutional_portfolio(cik, from, to) ⇒ Object



458
459
460
# File 'lib/finnhub_ruby.rb', line 458

def institutional_portfolio(cik, from, to)
  get('/institutional/portfolio', { cik: cik, from: from, to: to })
end

#institutional_profile(cik: '') ⇒ Object



454
455
456
# File 'lib/finnhub_ruby.rb', line 454

def institutional_profile(cik: '')
  get('/institutional/profile', { cik: cik }.compact)
end

#international_filings(symbol: '', country: '') ⇒ Object



322
323
324
# File 'lib/finnhub_ruby.rb', line 322

def international_filings(symbol: '', country: '')
  get('/stock/international-filings', { symbol: symbol, country: country }.compact)
end

#ipo_calendar(from, to) ⇒ Object



294
295
296
# File 'lib/finnhub_ruby.rb', line 294

def ipo_calendar(from, to)
  get('/calendar/ipo', { from: from, to: to })
end

#isin_change(from, to) ⇒ Object



450
451
452
# File 'lib/finnhub_ruby.rb', line 450

def isin_change(from, to)
  get('/ca/isin-change', { from: from, to: to })
end

#last_bid_ask(symbol) ⇒ Object



334
335
336
# File 'lib/finnhub_ruby.rb', line 334

def last_bid_ask(symbol)
  get('/stock/bidask', { symbol: symbol })
end

#market_holiday(exchange) ⇒ Object



482
483
484
# File 'lib/finnhub_ruby.rb', line 482

def market_holiday(exchange)
  get('/stock/market-holiday', { exchange: exchange })
end

#market_status(exchange) ⇒ Object



478
479
480
# File 'lib/finnhub_ruby.rb', line 478

def market_status(exchange)
  get('/stock/market-status', { exchange: exchange })
end

#mutual_fund_country_exp(symbol) ⇒ Object



362
363
364
# File 'lib/finnhub_ruby.rb', line 362

def mutual_fund_country_exp(symbol)
  get('/mutual-fund/country', { symbol: symbol })
end

#mutual_fund_eet(isin) ⇒ Object



366
367
368
# File 'lib/finnhub_ruby.rb', line 366

def mutual_fund_eet(isin)
  get('/mutual-fund/eet', { isin: isin })
end

#mutual_fund_eet_pai(isin) ⇒ Object



370
371
372
# File 'lib/finnhub_ruby.rb', line 370

def mutual_fund_eet_pai(isin)
  get('/mutual-fund/eet-pai', { isin: isin })
end

#mutual_fund_holdings(symbol: nil, isin: nil, skip: nil) ⇒ Object



354
355
356
# File 'lib/finnhub_ruby.rb', line 354

def mutual_fund_holdings(symbol: nil, isin: nil, skip: nil)
  get('/mutual-fund/holdings', { symbol: symbol, isin: isin, skip: skip }.compact)
end

#mutual_fund_profile(symbol: nil, isin: nil) ⇒ Object



350
351
352
# File 'lib/finnhub_ruby.rb', line 350

def mutual_fund_profile(symbol: nil, isin: nil)
  get('/mutual-fund/profile', { symbol: symbol, isin: isin }.compact)
end

#mutual_fund_sector_exp(symbol) ⇒ Object



358
359
360
# File 'lib/finnhub_ruby.rb', line 358

def mutual_fund_sector_exp(symbol)
  get('/mutual-fund/sector', { symbol: symbol })
end

#news_sentiment(symbol) ⇒ Object



266
267
268
# File 'lib/finnhub_ruby.rb', line 266

def news_sentiment(symbol)
  get('/news-sentiment', { symbol: symbol })
end

#option_chain(params = {}) ⇒ Object



142
143
144
# File 'lib/finnhub_ruby.rb', line 142

def option_chain(params = {})
  get('/stock/option-chain', params)
end

#ownership(symbol, limit: nil) ⇒ Object



270
271
272
# File 'lib/finnhub_ruby.rb', line 270

def ownership(symbol, limit: nil)
  get('/stock/ownership', { symbol: symbol, limit: limit }.compact)
end

#pattern_recognition(symbol, resolution) ⇒ Object



242
243
244
# File 'lib/finnhub_ruby.rb', line 242

def pattern_recognition(symbol, resolution)
  get('/scan/pattern', { symbol: symbol, resolution: resolution })
end

#press_releases(symbol, from: nil, to: nil) ⇒ Object



110
111
112
# File 'lib/finnhub_ruby.rb', line 110

def press_releases(symbol, from: nil, to: nil)
  get('/press-releases', { symbol: symbol, from: from, to: to }.compact)
end

#price_metrics(symbol, date: '') ⇒ Object



442
443
444
# File 'lib/finnhub_ruby.rb', line 442

def price_metrics(symbol, date: '')
  get('/stock/price-metric', { symbol: symbol, date: date })
end

#price_target(symbol) ⇒ Object



134
135
136
# File 'lib/finnhub_ruby.rb', line 134

def price_target(symbol)
  get('/stock/price-target', { symbol: symbol })
end

#quote(symbol) ⇒ Object



86
87
88
# File 'lib/finnhub_ruby.rb', line 86

def quote(symbol)
  get('/quote', symbol: symbol)
end


130
131
132
# File 'lib/finnhub_ruby.rb', line 130

def recommendation_trends(symbol)
  get('/stock/recommendation', { symbol: symbol })
end

#sector_metric(region) ⇒ Object



438
439
440
# File 'lib/finnhub_ruby.rb', line 438

def sector_metric(region)
  get('/sector/metrics', { region: region })
end

#sentiment_analysis(access_number) ⇒ Object



326
327
328
# File 'lib/finnhub_ruby.rb', line 326

def sentiment_analysis(access_number)
  get('/stock/filings-sentiment', { accessNumber: access_number })
end

#similarity_index(symbol: '', cik: '', freq: 'annual') ⇒ Object



330
331
332
# File 'lib/finnhub_ruby.rb', line 330

def similarity_index(symbol: '', cik: '', freq: 'annual')
  get('/stock/similarity-index', { symbol: symbol, cik: cik, freq: freq }.compact)
end

#stock_basic_dividends(symbol) ⇒ Object



122
123
124
# File 'lib/finnhub_ruby.rb', line 122

def stock_basic_dividends(symbol)
  get('/stock/dividend2', { symbol: symbol })
end

#stock_candles(symbol, resolution, from, to, **kwargs) ⇒ Object

def sim_index(params = {})

get('/stock/similarity-index', params)

end



210
211
212
# File 'lib/finnhub_ruby.rb', line 210

def stock_candles(symbol, resolution, from, to, **kwargs)
  get('/stock/candle', { symbol: symbol, resolution: resolution, from: from, to: to }.merge(kwargs))
end

#stock_dividends(symbol, from: nil, to: nil) ⇒ Object



118
119
120
# File 'lib/finnhub_ruby.rb', line 118

def stock_dividends(symbol, from: nil, to: nil)
  get('/stock/dividend', { symbol: symbol, from: from, to: to }.compact)
end

#stock_insider_sentiment(symbol, from, to) ⇒ Object



418
419
420
# File 'lib/finnhub_ruby.rb', line 418

def stock_insider_sentiment(symbol, from, to)
  get('/stock/insider-sentiment', { symbol: symbol, from: from, to: to })
end

#stock_insider_transactions(symbol, from: nil, to: nil) ⇒ Object



346
347
348
# File 'lib/finnhub_ruby.rb', line 346

def stock_insider_transactions(symbol, from: nil, to: nil)
  get('/stock/insider-transactions', { symbol: symbol, from: from, to: to }.compact)
end

#stock_investment_theme(theme) ⇒ Object



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

def stock_investment_theme(theme)
  get('/stock/investment-theme', { theme: theme })
end

#stock_lobbying(symbol, from, to) ⇒ Object



422
423
424
# File 'lib/finnhub_ruby.rb', line 422

def stock_lobbying(symbol, from, to)
  get('/stock/lobbying', { symbol: symbol, from: from, to: to })
end

#stock_nbbo(symbol, date, limit, skip, format: 'json', **kwargs) ⇒ Object



218
219
220
# File 'lib/finnhub_ruby.rb', line 218

def stock_nbbo(symbol, date, limit, skip, format: 'json', **kwargs)
  get('/stock/bbo', { symbol: symbol, date: date, limit: limit, skip: skip, format: format }.merge(kwargs))
end

#stock_presentation(symbol) ⇒ Object



498
499
500
# File 'lib/finnhub_ruby.rb', line 498

def stock_presentation(symbol)
  get('/stock/presentation', { symbol: symbol })
end

#stock_revenue_breakdown(symbol, cik: '') ⇒ Object



374
375
376
# File 'lib/finnhub_ruby.rb', line 374

def stock_revenue_breakdown(symbol, cik: '')
  get('/stock/revenue-breakdown', { symbol: symbol, cik: cik }.compact)
end

#stock_revenue_breakdown2(symbol) ⇒ Object



502
503
504
# File 'lib/finnhub_ruby.rb', line 502

def stock_revenue_breakdown2(symbol)
  get('/stock/revenue-breakdown2', { symbol: symbol })
end

#stock_social_sentiment(symbol, from: nil, to: nil) ⇒ Object



378
379
380
# File 'lib/finnhub_ruby.rb', line 378

def stock_social_sentiment(symbol, from: nil, to: nil)
  get('/stock/social-sentiment', { symbol: symbol, from: from, to: to }.compact)
end

#stock_splits(symbol, from, to) ⇒ Object



254
255
256
# File 'lib/finnhub_ruby.rb', line 254

def stock_splits(symbol, from, to)
  get('/stock/split', { symbol: symbol, from: from, to: to })
end

#stock_supply_chain(symbol) ⇒ Object



386
387
388
# File 'lib/finnhub_ruby.rb', line 386

def stock_supply_chain(symbol)
  get('/stock/supply-chain', { symbol: symbol })
end

#stock_symbol(params = {}) ⇒ Object



194
195
196
# File 'lib/finnhub_ruby.rb', line 194

def stock_symbol(params = {})
  get('/stock/symbol', params)
end

#stock_symbols(exchange, mic: nil, security_type: nil, currency: nil) ⇒ Object



126
127
128
# File 'lib/finnhub_ruby.rb', line 126

def stock_symbols(exchange, mic: nil, security_type: nil, currency: nil)
  get('/stock/symbol', { exchange: exchange, mic: mic, securityType: security_type, currency: currency }.compact)
end

#stock_tick(symbol, date, limit, skip, format: 'json', **kwargs) ⇒ Object



214
215
216
# File 'lib/finnhub_ruby.rb', line 214

def stock_tick(symbol, date, limit, skip, format: 'json', **kwargs)
  get('/stock/tick', { symbol: symbol, date: date, limit: limit, skip: skip, format: format }.merge(kwargs))
end

#stock_usa_spending(symbol, from, to) ⇒ Object



434
435
436
# File 'lib/finnhub_ruby.rb', line 434

def stock_usa_spending(symbol, from, to)
  get('/stock/usa-spending', { symbol: symbol, from: from, to: to })
end

#stock_uspto_patent(symbol, from: nil, to: nil) ⇒ Object



410
411
412
# File 'lib/finnhub_ruby.rb', line 410

def stock_uspto_patent(symbol, from: nil, to: nil)
  get('/stock/uspto-patent', { symbol: symbol, from: from, to: to }.compact)
end

#stock_visa_application(symbol, from: nil, to: nil) ⇒ Object



414
415
416
# File 'lib/finnhub_ruby.rb', line 414

def stock_visa_application(symbol, from: nil, to: nil)
  get('/stock/visa-application', { symbol: symbol, from: from, to: to }.compact)
end

#support_resistance(symbol, resolution) ⇒ Object



246
247
248
# File 'lib/finnhub_ruby.rb', line 246

def support_resistance(symbol, resolution)
  get('/scan/support-resistance', { symbol: symbol, resolution: resolution })
end

#symbol_change(from, to) ⇒ Object



446
447
448
# File 'lib/finnhub_ruby.rb', line 446

def symbol_change(from, to)
  get('/ca/symbol-change', { from: from, to: to })
end

#symbol_search(query) ⇒ Object



342
343
344
# File 'lib/finnhub_ruby.rb', line 342

def symbol_search(query)
  get('/search', { q: query })
end

#technical_indicator(symbol, resolution, from, to, indicator, indicator_fields: {}) ⇒ Object



250
251
252
# File 'lib/finnhub_ruby.rb', line 250

def technical_indicator(symbol, resolution, from, to, indicator, indicator_fields: {})
  get('/indicator', { symbol: symbol, resolution: resolution, from: from, to: to, indicator: indicator }.merge(indicator_fields))
end

#transcripts(id) ⇒ Object



198
199
200
# File 'lib/finnhub_ruby.rb', line 198

def transcripts(id)
  get('/stock/transcripts', { id: id })
end

#transcripts_list(symbol) ⇒ Object



202
203
204
# File 'lib/finnhub_ruby.rb', line 202

def transcripts_list(symbol)
  get('/stock/transcripts/list', { symbol: symbol })
end

#upgrade_downgrade(symbol: nil, from: nil, to: nil) ⇒ Object



138
139
140
# File 'lib/finnhub_ruby.rb', line 138

def upgrade_downgrade(symbol: nil, from: nil, to: nil)
  get('/stock/upgrade-downgrade', { symbol: symbol, from: from, to: to }.compact)
end