Class: FinnhubRuby::DefaultApi
- Inherits:
-
Object
- Object
- FinnhubRuby::DefaultApi
- Defined in:
- lib/finnhub_ruby.rb
Constant Summary collapse
- API_URL =
'https://api.finnhub.io/api/v1'- DEFAULT_TIMEOUT =
10
Instance Method Summary collapse
- #aggregate_indicator(symbol, resolution) ⇒ Object
- #airline_price_index(airline, from, to) ⇒ Object
- #bank_branch(symbol) ⇒ Object
- #bond_price(isin, from, to) ⇒ Object
- #bond_profile(params = {}) ⇒ Object
- #bond_tick(isin, date, limit, skip, exchange: 'trace', format: 'json', **kwargs) ⇒ Object
- #bond_yield_curve(code) ⇒ Object
- #company_basic_financials(symbol, metric) ⇒ Object
- #company_earnings(symbol, limit: nil) ⇒ Object
- #company_earnings_quality_score(symbol, freq) ⇒ Object
- #company_ebit_estimates(symbol, freq: nil) ⇒ Object
- #company_ebitda_estimates(symbol, freq: nil) ⇒ Object
- #company_eps_estimates(symbol, freq: nil) ⇒ Object
- #company_esg_score(symbol) ⇒ Object
- #company_executive(symbol) ⇒ Object
- #company_historical_esg_score(symbol) ⇒ Object
- #company_news(symbol, from, to) ⇒ Object
- #company_peers(symbol) ⇒ Object
- #company_profile(params = {}) ⇒ Object
- #company_profile2(params = {}) ⇒ Object
- #company_revenue_estimates(symbol, freq: nil) ⇒ Object
- #congressional_trading(symbol, from, to) ⇒ Object
- #country ⇒ Object
- #covid19 ⇒ Object
- #crypto_candles(symbol, resolution, from, to, format: 'json') ⇒ Object
- #crypto_exchanges ⇒ Object
- #crypto_profile(symbol) ⇒ Object
- #crypto_symbols(exchange) ⇒ Object
- #earnings_calendar(from:, to:, symbol: '', international: false) ⇒ Object
- #earnings_call_live(from, to, symbol: '') ⇒ Object
- #economic_calendar(from: nil, to: nil) ⇒ Object
- #economic_code ⇒ Object
- #economic_data(code) ⇒ Object
- #etfs_country_exp(symbol) ⇒ Object
- #etfs_holdings(symbol: nil, isin: nil, skip: nil, date: nil) ⇒ Object
- #etfs_profile(symbol: nil, isin: nil) ⇒ Object
- #etfs_sector_exp(symbol) ⇒ Object
- #exchange ⇒ Object
- #fda_calendar ⇒ Object
- #filings(symbol: '', cik: '', access_number: '', form: '', from: '', to: '') ⇒ Object
- #financials(symbol, statement, freq, preliminary: nil) ⇒ Object
- #financials_reported(params = {}) ⇒ Object
- #forex_candles(symbol, resolution, from, to, format: 'json') ⇒ Object
- #forex_exchanges ⇒ Object
- #forex_rates(params = {}) ⇒ Object
- #forex_symbols(exchange) ⇒ Object
- #fund_ownership(symbol, limit: nil) ⇒ Object
- #general_news(category, min_id: 0) ⇒ Object
- #get(path, params = {}) ⇒ Object
- #historical_employee_count(symbol, from, to) ⇒ Object
- #historical_market_cap(symbol, from: nil, to: nil) ⇒ Object
- #indices_const(params = {}) ⇒ Object
- #indices_hist_const(params = {}) ⇒ Object
-
#initialize(api_client = nil) ⇒ DefaultApi
constructor
A new instance of DefaultApi.
- #institutional_ownership(symbol, cusip, from, to) ⇒ Object
- #institutional_portfolio(cik, from, to) ⇒ Object
- #institutional_profile(cik: '') ⇒ Object
- #international_filings(symbol: '', country: '') ⇒ Object
- #ipo_calendar(from, to) ⇒ Object
- #isin_change(from, to) ⇒ Object
- #last_bid_ask(symbol) ⇒ Object
- #market_holiday(exchange) ⇒ Object
- #market_status(exchange) ⇒ Object
- #mutual_fund_country_exp(symbol) ⇒ Object
- #mutual_fund_eet(isin) ⇒ Object
- #mutual_fund_eet_pai(isin) ⇒ Object
- #mutual_fund_holdings(symbol: nil, isin: nil, skip: nil) ⇒ Object
- #mutual_fund_profile(symbol: nil, isin: nil) ⇒ Object
- #mutual_fund_sector_exp(symbol) ⇒ Object
- #news_sentiment(symbol) ⇒ Object
- #option_chain(params = {}) ⇒ Object
- #ownership(symbol, limit: nil) ⇒ Object
- #pattern_recognition(symbol, resolution) ⇒ Object
- #press_releases(symbol, from: nil, to: nil) ⇒ Object
- #price_metrics(symbol, date: '') ⇒ Object
- #price_target(symbol) ⇒ Object
- #quote(symbol) ⇒ Object
- #recommendation_trends(symbol) ⇒ Object
- #sector_metric(region) ⇒ Object
- #sentiment_analysis(access_number) ⇒ Object
- #similarity_index(symbol: '', cik: '', freq: 'annual') ⇒ Object
- #stock_basic_dividends(symbol) ⇒ Object
-
#stock_candles(symbol, resolution, from, to, **kwargs) ⇒ Object
def sim_index(params = {}) get(‘/stock/similarity-index’, params) end.
- #stock_dividends(symbol, from: nil, to: nil) ⇒ Object
- #stock_insider_sentiment(symbol, from, to) ⇒ Object
- #stock_insider_transactions(symbol, from: nil, to: nil) ⇒ Object
- #stock_investment_theme(theme) ⇒ Object
- #stock_lobbying(symbol, from, to) ⇒ Object
- #stock_nbbo(symbol, date, limit, skip, format: 'json', **kwargs) ⇒ Object
- #stock_newsroom(symbol, from: nil, to: nil) ⇒ Object
- #stock_presentation(symbol) ⇒ Object
- #stock_revenue_breakdown(symbol, cik: '') ⇒ Object
- #stock_revenue_breakdown2(symbol) ⇒ Object
- #stock_social_sentiment(symbol, from: nil, to: nil) ⇒ Object
- #stock_splits(symbol, from, to) ⇒ Object
- #stock_supply_chain(symbol) ⇒ Object
- #stock_symbol(params = {}) ⇒ Object
- #stock_symbols(exchange, mic: nil, security_type: nil, currency: nil) ⇒ Object
- #stock_tick(symbol, date, limit, skip, format: 'json', **kwargs) ⇒ Object
- #stock_usa_spending(symbol, from, to) ⇒ Object
- #stock_uspto_patent(symbol, from: nil, to: nil) ⇒ Object
- #stock_visa_application(symbol, from: nil, to: nil) ⇒ Object
- #support_resistance(symbol, resolution) ⇒ Object
- #symbol_change(from, to) ⇒ Object
- #symbol_search(query) ⇒ Object
- #technical_indicator(symbol, resolution, from, to, indicator, indicator_fields: {}) ⇒ Object
- #transcripts(id) ⇒ Object
- #transcripts_list(symbol) ⇒ Object
- #upgrade_downgrade(symbol: nil, from: nil, to: nil) ⇒ Object
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
97 98 99 |
# File 'lib/finnhub_ruby.rb', line 97 def aggregate_indicator(symbol, resolution) get('/scan/technical-indicator', { symbol: symbol, resolution: resolution }) end |
#airline_price_index(airline, from, to) ⇒ Object
493 494 495 |
# File 'lib/finnhub_ruby.rb', line 493 def airline_price_index(airline, from, to) get('/airline/price-index', { airline: airline, from: from, to: to }) end |
#bank_branch(symbol) ⇒ Object
513 514 515 |
# File 'lib/finnhub_ruby.rb', line 513 def bank_branch(symbol) get('/bank-branch', { symbol: symbol }) end |
#bond_price(isin, from, to) ⇒ Object
433 434 435 |
# File 'lib/finnhub_ruby.rb', line 433 def bond_price(isin, from, to) get('/bond/price', { isin: isin, from: from, to: to }) end |
#bond_profile(params = {}) ⇒ Object
429 430 431 |
# File 'lib/finnhub_ruby.rb', line 429 def bond_profile(params = {}) get('/bond/profile', params) end |
#bond_tick(isin, date, limit, skip, exchange: 'trace', format: 'json', **kwargs) ⇒ Object
473 474 475 |
# File 'lib/finnhub_ruby.rb', line 473 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
477 478 479 |
# File 'lib/finnhub_ruby.rb', line 477 def bond_yield_curve(code) get('/bond/yield-curve', { code: code }) end |
#company_basic_financials(symbol, metric) ⇒ Object
149 150 151 |
# File 'lib/finnhub_ruby.rb', line 149 def company_basic_financials(symbol, metric) get('/stock/metric', { symbol: symbol, metric: metric }) end |
#company_earnings(symbol, limit: nil) ⇒ Object
165 166 167 |
# File 'lib/finnhub_ruby.rb', line 165 def company_earnings(symbol, limit: nil) get('/stock/earnings', { symbol: symbol, limit: limit }.compact) end |
#company_earnings_quality_score(symbol, freq) ⇒ Object
405 406 407 |
# File 'lib/finnhub_ruby.rb', line 405 def company_earnings_quality_score(symbol, freq) get('/stock/earnings-quality-score', { symbol: symbol, freq: freq }) end |
#company_ebit_estimates(symbol, freq: nil) ⇒ Object
177 178 179 |
# File 'lib/finnhub_ruby.rb', line 177 def company_ebit_estimates(symbol, freq: nil) get('/stock/ebit-estimate', { symbol: symbol, freq: freq }.compact) end |
#company_ebitda_estimates(symbol, freq: nil) ⇒ Object
173 174 175 |
# File 'lib/finnhub_ruby.rb', line 173 def company_ebitda_estimates(symbol, freq: nil) get('/stock/ebitda-estimate', { symbol: symbol, freq: freq }.compact) end |
#company_eps_estimates(symbol, freq: nil) ⇒ Object
181 182 183 |
# File 'lib/finnhub_ruby.rb', line 181 def company_eps_estimates(symbol, freq: nil) get('/stock/eps-estimate', { symbol: symbol, freq: freq }.compact) end |
#company_esg_score(symbol) ⇒ Object
393 394 395 |
# File 'lib/finnhub_ruby.rb', line 393 def company_esg_score(symbol) get('/stock/esg', { symbol: symbol }) end |
#company_executive(symbol) ⇒ Object
113 114 115 |
# File 'lib/finnhub_ruby.rb', line 113 def company_executive(symbol) get('/stock/executive', { symbol: symbol }) end |
#company_historical_esg_score(symbol) ⇒ Object
397 398 399 |
# File 'lib/finnhub_ruby.rb', line 397 def company_historical_esg_score(symbol) get('/stock/historical-esg', { symbol: symbol }) end |
#company_news(symbol, from, to) ⇒ Object
261 262 263 |
# File 'lib/finnhub_ruby.rb', line 261 def company_news(symbol, from, to) get('/company-news', { symbol: symbol, from: from, to: to }) end |
#company_peers(symbol) ⇒ Object
145 146 147 |
# File 'lib/finnhub_ruby.rb', line 145 def company_peers(symbol) get('/stock/peers', { symbol: symbol }) end |
#company_profile(params = {}) ⇒ Object
89 90 91 |
# File 'lib/finnhub_ruby.rb', line 89 def company_profile(params = {}) get('/stock/profile', params) end |
#company_profile2(params = {}) ⇒ Object
93 94 95 |
# File 'lib/finnhub_ruby.rb', line 93 def company_profile2(params = {}) get('/stock/profile2', params) end |
#company_revenue_estimates(symbol, freq: nil) ⇒ Object
169 170 171 |
# File 'lib/finnhub_ruby.rb', line 169 def company_revenue_estimates(symbol, freq: nil) get('/stock/revenue-estimate', { symbol: symbol, freq: freq }.compact) end |
#congressional_trading(symbol, from, to) ⇒ Object
469 470 471 |
# File 'lib/finnhub_ruby.rb', line 469 def congressional_trading(symbol, from, to) get('/stock/congressional-trading', { symbol: symbol, from: from, to: to }) end |
#country ⇒ Object
277 278 279 |
# File 'lib/finnhub_ruby.rb', line 277 def country get('/country') end |
#covid19 ⇒ Object
509 510 511 |
# File 'lib/finnhub_ruby.rb', line 509 def covid19 get('/covid19/us') end |
#crypto_candles(symbol, resolution, from, to, format: 'json') ⇒ Object
237 238 239 |
# File 'lib/finnhub_ruby.rb', line 237 def crypto_candles(symbol, resolution, from, to, format: 'json') get('/crypto/candle', { symbol: symbol, resolution: resolution, from: from, to: to, format: format }) end |
#crypto_exchanges ⇒ Object
101 102 103 |
# File 'lib/finnhub_ruby.rb', line 101 def crypto_exchanges get('/crypto/exchange') end |
#crypto_profile(symbol) ⇒ Object
409 410 411 |
# File 'lib/finnhub_ruby.rb', line 409 def crypto_profile(symbol) get('/crypto/profile', { symbol: symbol }) end |
#crypto_symbols(exchange) ⇒ Object
233 234 235 |
# File 'lib/finnhub_ruby.rb', line 233 def crypto_symbols(exchange) get('/crypto/symbol', { exchange: exchange }) end |
#earnings_calendar(from:, to:, symbol: '', international: false) ⇒ Object
293 294 295 |
# File 'lib/finnhub_ruby.rb', line 293 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
497 498 499 |
# File 'lib/finnhub_ruby.rb', line 497 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
289 290 291 |
# File 'lib/finnhub_ruby.rb', line 289 def economic_calendar(from: nil, to: nil) get('/calendar/economic', { from: from, to: to }.compact) end |
#economic_code ⇒ Object
281 282 283 |
# File 'lib/finnhub_ruby.rb', line 281 def economic_code get('/economic/code') end |
#economic_data(code) ⇒ Object
285 286 287 |
# File 'lib/finnhub_ruby.rb', line 285 def economic_data(code) get('/economic', { code: code }) end |
#etfs_country_exp(symbol) ⇒ Object
321 322 323 |
# File 'lib/finnhub_ruby.rb', line 321 def etfs_country_exp(symbol) get('/etf/country', { symbol: symbol }) end |
#etfs_holdings(symbol: nil, isin: nil, skip: nil, date: nil) ⇒ Object
313 314 315 |
# File 'lib/finnhub_ruby.rb', line 313 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
309 310 311 |
# File 'lib/finnhub_ruby.rb', line 309 def etfs_profile(symbol: nil, isin: nil) get('/etf/profile', { symbol: symbol, isin: isin }.compact) end |
#etfs_sector_exp(symbol) ⇒ Object
317 318 319 |
# File 'lib/finnhub_ruby.rb', line 317 def etfs_sector_exp(symbol) get('/etf/sector', { symbol: symbol }) end |
#exchange ⇒ Object
185 186 187 |
# File 'lib/finnhub_ruby.rb', line 185 def exchange get('/stock/exchange') end |
#fda_calendar ⇒ Object
341 342 343 |
# File 'lib/finnhub_ruby.rb', line 341 def fda_calendar get('/fda-advisory-committee-calendar') end |
#filings(symbol: '', cik: '', access_number: '', form: '', from: '', to: '') ⇒ Object
189 190 191 |
# File 'lib/finnhub_ruby.rb', line 189 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, preliminary: nil) ⇒ Object
153 154 155 |
# File 'lib/finnhub_ruby.rb', line 153 def financials(symbol, statement, freq, preliminary: nil) get('/stock/financials', { symbol: symbol, statement: statement, freq: freq, preliminary: preliminary }.compact) end |
#financials_reported(params = {}) ⇒ Object
157 158 159 |
# File 'lib/finnhub_ruby.rb', line 157 def financials_reported(params = {}) get('/stock/financials-reported', params) end |
#forex_candles(symbol, resolution, from, to, format: 'json') ⇒ Object
229 230 231 |
# File 'lib/finnhub_ruby.rb', line 229 def forex_candles(symbol, resolution, from, to, format: 'json') get('/forex/candle', { symbol: symbol, resolution: resolution, from: from, to: to, format: format }) end |
#forex_exchanges ⇒ Object
105 106 107 |
# File 'lib/finnhub_ruby.rb', line 105 def forex_exchanges get('/forex/exchange') end |
#forex_rates(params = {}) ⇒ Object
221 222 223 |
# File 'lib/finnhub_ruby.rb', line 221 def forex_rates(params = {}) get('/forex/rates', params) end |
#forex_symbols(exchange) ⇒ Object
225 226 227 |
# File 'lib/finnhub_ruby.rb', line 225 def forex_symbols(exchange) get('/forex/symbol', { exchange: exchange }) end |
#fund_ownership(symbol, limit: nil) ⇒ Object
161 162 163 |
# File 'lib/finnhub_ruby.rb', line 161 def fund_ownership(symbol, limit: nil) get('/stock/fund-ownership', { symbol: symbol, limit: limit }.compact) end |
#general_news(category, min_id: 0) ⇒ Object
257 258 259 |
# File 'lib/finnhub_ruby.rb', line 257 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 |
# 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) # 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
489 490 491 |
# File 'lib/finnhub_ruby.rb', line 489 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
401 402 403 |
# File 'lib/finnhub_ruby.rb', line 401 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
301 302 303 |
# File 'lib/finnhub_ruby.rb', line 301 def indices_const(params = {}) get('/index/constituents', params) end |
#indices_hist_const(params = {}) ⇒ Object
305 306 307 |
# File 'lib/finnhub_ruby.rb', line 305 def indices_hist_const(params = {}) get('/index/historical-constituents', params) end |
#institutional_ownership(symbol, cusip, from, to) ⇒ Object
465 466 467 |
# File 'lib/finnhub_ruby.rb', line 465 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
461 462 463 |
# File 'lib/finnhub_ruby.rb', line 461 def institutional_portfolio(cik, from, to) get('/institutional/portfolio', { cik: cik, from: from, to: to }) end |
#institutional_profile(cik: '') ⇒ Object
457 458 459 |
# File 'lib/finnhub_ruby.rb', line 457 def institutional_profile(cik: '') get('/institutional/profile', { cik: cik }.compact) end |
#international_filings(symbol: '', country: '') ⇒ Object
325 326 327 |
# File 'lib/finnhub_ruby.rb', line 325 def international_filings(symbol: '', country: '') get('/stock/international-filings', { symbol: symbol, country: country }.compact) end |
#ipo_calendar(from, to) ⇒ Object
297 298 299 |
# File 'lib/finnhub_ruby.rb', line 297 def ipo_calendar(from, to) get('/calendar/ipo', { from: from, to: to }) end |
#isin_change(from, to) ⇒ Object
453 454 455 |
# File 'lib/finnhub_ruby.rb', line 453 def isin_change(from, to) get('/ca/isin-change', { from: from, to: to }) end |
#last_bid_ask(symbol) ⇒ Object
337 338 339 |
# File 'lib/finnhub_ruby.rb', line 337 def last_bid_ask(symbol) get('/stock/bidask', { symbol: symbol }) end |
#market_holiday(exchange) ⇒ Object
485 486 487 |
# File 'lib/finnhub_ruby.rb', line 485 def market_holiday(exchange) get('/stock/market-holiday', { exchange: exchange }) end |
#market_status(exchange) ⇒ Object
481 482 483 |
# File 'lib/finnhub_ruby.rb', line 481 def market_status(exchange) get('/stock/market-status', { exchange: exchange }) end |
#mutual_fund_country_exp(symbol) ⇒ Object
365 366 367 |
# File 'lib/finnhub_ruby.rb', line 365 def mutual_fund_country_exp(symbol) get('/mutual-fund/country', { symbol: symbol }) end |
#mutual_fund_eet(isin) ⇒ Object
369 370 371 |
# File 'lib/finnhub_ruby.rb', line 369 def mutual_fund_eet(isin) get('/mutual-fund/eet', { isin: isin }) end |
#mutual_fund_eet_pai(isin) ⇒ Object
373 374 375 |
# File 'lib/finnhub_ruby.rb', line 373 def mutual_fund_eet_pai(isin) get('/mutual-fund/eet-pai', { isin: isin }) end |
#mutual_fund_holdings(symbol: nil, isin: nil, skip: nil) ⇒ Object
357 358 359 |
# File 'lib/finnhub_ruby.rb', line 357 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
353 354 355 |
# File 'lib/finnhub_ruby.rb', line 353 def mutual_fund_profile(symbol: nil, isin: nil) get('/mutual-fund/profile', { symbol: symbol, isin: isin }.compact) end |
#mutual_fund_sector_exp(symbol) ⇒ Object
361 362 363 |
# File 'lib/finnhub_ruby.rb', line 361 def mutual_fund_sector_exp(symbol) get('/mutual-fund/sector', { symbol: symbol }) end |
#news_sentiment(symbol) ⇒ Object
269 270 271 |
# File 'lib/finnhub_ruby.rb', line 269 def news_sentiment(symbol) get('/news-sentiment', { symbol: symbol }) end |
#option_chain(params = {}) ⇒ Object
141 142 143 |
# File 'lib/finnhub_ruby.rb', line 141 def option_chain(params = {}) get('/stock/option-chain', params) end |
#ownership(symbol, limit: nil) ⇒ Object
273 274 275 |
# File 'lib/finnhub_ruby.rb', line 273 def ownership(symbol, limit: nil) get('/stock/ownership', { symbol: symbol, limit: limit }.compact) end |
#pattern_recognition(symbol, resolution) ⇒ Object
241 242 243 |
# File 'lib/finnhub_ruby.rb', line 241 def pattern_recognition(symbol, resolution) get('/scan/pattern', { symbol: symbol, resolution: resolution }) end |
#press_releases(symbol, from: nil, to: nil) ⇒ Object
109 110 111 |
# File 'lib/finnhub_ruby.rb', line 109 def press_releases(symbol, from: nil, to: nil) get('/press-releases', { symbol: symbol, from: from, to: to }.compact) end |
#price_metrics(symbol, date: '') ⇒ Object
445 446 447 |
# File 'lib/finnhub_ruby.rb', line 445 def price_metrics(symbol, date: '') get('/stock/price-metric', { symbol: symbol, date: date }) end |
#price_target(symbol) ⇒ Object
133 134 135 |
# File 'lib/finnhub_ruby.rb', line 133 def price_target(symbol) get('/stock/price-target', { symbol: symbol }) end |
#quote(symbol) ⇒ Object
85 86 87 |
# File 'lib/finnhub_ruby.rb', line 85 def quote(symbol) get('/quote', symbol: symbol) end |
#recommendation_trends(symbol) ⇒ Object
129 130 131 |
# File 'lib/finnhub_ruby.rb', line 129 def recommendation_trends(symbol) get('/stock/recommendation', { symbol: symbol }) end |
#sector_metric(region) ⇒ Object
441 442 443 |
# File 'lib/finnhub_ruby.rb', line 441 def sector_metric(region) get('/sector/metrics', { region: region }) end |
#sentiment_analysis(access_number) ⇒ Object
329 330 331 |
# File 'lib/finnhub_ruby.rb', line 329 def sentiment_analysis(access_number) get('/stock/filings-sentiment', { accessNumber: access_number }) end |
#similarity_index(symbol: '', cik: '', freq: 'annual') ⇒ Object
333 334 335 |
# File 'lib/finnhub_ruby.rb', line 333 def similarity_index(symbol: '', cik: '', freq: 'annual') get('/stock/similarity-index', { symbol: symbol, cik: cik, freq: freq }.compact) end |
#stock_basic_dividends(symbol) ⇒ Object
121 122 123 |
# File 'lib/finnhub_ruby.rb', line 121 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
209 210 211 |
# File 'lib/finnhub_ruby.rb', line 209 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
117 118 119 |
# File 'lib/finnhub_ruby.rb', line 117 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
421 422 423 |
# File 'lib/finnhub_ruby.rb', line 421 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
349 350 351 |
# File 'lib/finnhub_ruby.rb', line 349 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
385 386 387 |
# File 'lib/finnhub_ruby.rb', line 385 def stock_investment_theme(theme) get('/stock/investment-theme', { theme: theme }) end |
#stock_lobbying(symbol, from, to) ⇒ Object
425 426 427 |
# File 'lib/finnhub_ruby.rb', line 425 def (symbol, from, to) get('/stock/lobbying', { symbol: symbol, from: from, to: to }) end |
#stock_nbbo(symbol, date, limit, skip, format: 'json', **kwargs) ⇒ Object
217 218 219 |
# File 'lib/finnhub_ruby.rb', line 217 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_newsroom(symbol, from: nil, to: nil) ⇒ Object
265 266 267 |
# File 'lib/finnhub_ruby.rb', line 265 def stock_newsroom(symbol, from: nil, to: nil) get('/stock/newsroom', { symbol: symbol, from: from, to: to }.compact) end |
#stock_presentation(symbol) ⇒ Object
501 502 503 |
# File 'lib/finnhub_ruby.rb', line 501 def stock_presentation(symbol) get('/stock/presentation', { symbol: symbol }) end |
#stock_revenue_breakdown(symbol, cik: '') ⇒ Object
377 378 379 |
# File 'lib/finnhub_ruby.rb', line 377 def stock_revenue_breakdown(symbol, cik: '') get('/stock/revenue-breakdown', { symbol: symbol, cik: cik }.compact) end |
#stock_revenue_breakdown2(symbol) ⇒ Object
505 506 507 |
# File 'lib/finnhub_ruby.rb', line 505 def stock_revenue_breakdown2(symbol) get('/stock/revenue-breakdown2', { symbol: symbol }) end |
#stock_social_sentiment(symbol, from: nil, to: nil) ⇒ Object
381 382 383 |
# File 'lib/finnhub_ruby.rb', line 381 def (symbol, from: nil, to: nil) get('/stock/social-sentiment', { symbol: symbol, from: from, to: to }.compact) end |
#stock_splits(symbol, from, to) ⇒ Object
253 254 255 |
# File 'lib/finnhub_ruby.rb', line 253 def stock_splits(symbol, from, to) get('/stock/split', { symbol: symbol, from: from, to: to }) end |
#stock_supply_chain(symbol) ⇒ Object
389 390 391 |
# File 'lib/finnhub_ruby.rb', line 389 def stock_supply_chain(symbol) get('/stock/supply-chain', { symbol: symbol }) end |
#stock_symbol(params = {}) ⇒ Object
193 194 195 |
# File 'lib/finnhub_ruby.rb', line 193 def stock_symbol(params = {}) get('/stock/symbol', params) end |
#stock_symbols(exchange, mic: nil, security_type: nil, currency: nil) ⇒ Object
125 126 127 |
# File 'lib/finnhub_ruby.rb', line 125 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
213 214 215 |
# File 'lib/finnhub_ruby.rb', line 213 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
437 438 439 |
# File 'lib/finnhub_ruby.rb', line 437 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
413 414 415 |
# File 'lib/finnhub_ruby.rb', line 413 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
417 418 419 |
# File 'lib/finnhub_ruby.rb', line 417 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
245 246 247 |
# File 'lib/finnhub_ruby.rb', line 245 def support_resistance(symbol, resolution) get('/scan/support-resistance', { symbol: symbol, resolution: resolution }) end |
#symbol_change(from, to) ⇒ Object
449 450 451 |
# File 'lib/finnhub_ruby.rb', line 449 def symbol_change(from, to) get('/ca/symbol-change', { from: from, to: to }) end |
#symbol_search(query) ⇒ Object
345 346 347 |
# File 'lib/finnhub_ruby.rb', line 345 def symbol_search(query) get('/search', { q: query }) end |
#technical_indicator(symbol, resolution, from, to, indicator, indicator_fields: {}) ⇒ Object
249 250 251 |
# File 'lib/finnhub_ruby.rb', line 249 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
197 198 199 |
# File 'lib/finnhub_ruby.rb', line 197 def transcripts(id) get('/stock/transcripts', { id: id }) end |
#transcripts_list(symbol) ⇒ Object
201 202 203 |
# File 'lib/finnhub_ruby.rb', line 201 def transcripts_list(symbol) get('/stock/transcripts/list', { symbol: symbol }) end |
#upgrade_downgrade(symbol: nil, from: nil, to: nil) ⇒ Object
137 138 139 |
# File 'lib/finnhub_ruby.rb', line 137 def upgrade_downgrade(symbol: nil, from: nil, to: nil) get('/stock/upgrade-downgrade', { symbol: symbol, from: from, to: to }.compact) end |