finnhub_ruby 1.1.19 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +39 -0
- data/.rspec +2 -0
- data/.rubocop.yml +148 -0
- data/.travis.yml +14 -0
- data/README.md +4 -4
- data/docs/AirlinePriceIndex.md +22 -0
- data/docs/AirlinePriceIndexData.md +24 -0
- data/docs/CompanyESG2.md +28 -0
- data/docs/CompanyProfile.md +6 -0
- data/docs/CountryMetadata.md +9 -1
- data/docs/DefaultApi.md +582 -38
- data/docs/ETFProfileData.md +2 -0
- data/docs/EarningResult.md +2 -2
- data/docs/EarningsEstimatesInfo.md +5 -1
- data/docs/EbitEstimatesInfo.md +5 -1
- data/docs/EbitdaEstimatesInfo.md +5 -1
- data/docs/EmployeeCount.md +20 -0
- data/docs/FilingResponse.md +1 -1
- data/docs/HistoricalCompanyESG.md +20 -0
- data/docs/HistoricalEmployeeCount.md +20 -0
- data/docs/HistoricalMarketCapData.md +22 -0
- data/docs/IndicesConstituents.md +3 -1
- data/docs/IndicesConstituentsBreakdown.md +28 -0
- data/docs/MarketCapData.md +20 -0
- data/docs/MarketHoliday.md +22 -0
- data/docs/MarketHolidayData.md +22 -0
- data/docs/MarketStatus.md +28 -0
- data/docs/MutualFundProfileData.md +2 -0
- data/docs/PriceTarget.md +2 -0
- data/docs/RevenueEstimatesInfo.md +5 -1
- data/docs/SentimentContent.md +30 -0
- data/docs/SocialSentiment.md +2 -4
- data/finnhub_ruby.gemspec +9 -9
- data/git_push.sh +0 -0
- data/lib/finnhub_ruby/version.rb +2 -14
- data/lib/finnhub_ruby.rb +522 -178
- data/test.rb +234 -0
- data/test_release.rb +235 -0
- metadata +31 -521
- data/finnhub_ruby-1.1.10.gem +0 -0
- data/finnhub_ruby-1.1.11.gem +0 -0
- data/finnhub_ruby-1.1.12.gem +0 -0
- data/finnhub_ruby-1.1.13.gem +0 -0
- data/finnhub_ruby-1.1.14.gem +0 -0
- data/finnhub_ruby-1.1.15.gem +0 -0
- data/finnhub_ruby-1.1.16.gem +0 -0
- data/finnhub_ruby-1.1.17.gem +0 -0
- data/finnhub_ruby-1.1.18.gem +0 -0
- data/finnhub_ruby-1.1.7.gem +0 -0
- data/finnhub_ruby-1.1.8.gem +0 -0
- data/finnhub_ruby-1.1.9.gem +0 -0
- data/lib/finnhub_ruby/api/default_api.rb +0 -6370
- data/lib/finnhub_ruby/api_client.rb +0 -391
- data/lib/finnhub_ruby/api_error.rb +0 -57
- data/lib/finnhub_ruby/configuration.rb +0 -277
- data/lib/finnhub_ruby/models/aggregate_indicators.rb +0 -227
- data/lib/finnhub_ruby/models/basic_financials.rb +0 -247
- data/lib/finnhub_ruby/models/bond_candles.rb +0 -243
- data/lib/finnhub_ruby/models/bond_profile.rb +0 -419
- data/lib/finnhub_ruby/models/bond_tick_data.rb +0 -347
- data/lib/finnhub_ruby/models/bond_yield_curve.rb +0 -231
- data/lib/finnhub_ruby/models/bond_yield_curve_info.rb +0 -229
- data/lib/finnhub_ruby/models/breakdown_item.rb +0 -228
- data/lib/finnhub_ruby/models/company.rb +0 -279
- data/lib/finnhub_ruby/models/company_earnings_quality_score.rb +0 -241
- data/lib/finnhub_ruby/models/company_earnings_quality_score_data.rb +0 -279
- data/lib/finnhub_ruby/models/company_esg.rb +0 -268
- data/lib/finnhub_ruby/models/company_executive.rb +0 -231
- data/lib/finnhub_ruby/models/company_news.rb +0 -299
- data/lib/finnhub_ruby/models/company_news_statistics.rb +0 -239
- data/lib/finnhub_ruby/models/company_profile.rb +0 -509
- data/lib/finnhub_ruby/models/company_profile2.rb +0 -329
- data/lib/finnhub_ruby/models/congressional_trading.rb +0 -231
- data/lib/finnhub_ruby/models/congressional_transaction.rb +0 -309
- data/lib/finnhub_ruby/models/country_metadata.rb +0 -289
- data/lib/finnhub_ruby/models/covid_info.rb +0 -249
- data/lib/finnhub_ruby/models/crypto_candles.rb +0 -291
- data/lib/finnhub_ruby/models/crypto_profile.rb +0 -319
- data/lib/finnhub_ruby/models/crypto_symbol.rb +0 -239
- data/lib/finnhub_ruby/models/development.rb +0 -259
- data/lib/finnhub_ruby/models/dividends.rb +0 -299
- data/lib/finnhub_ruby/models/dividends2.rb +0 -231
- data/lib/finnhub_ruby/models/dividends2_basic.rb +0 -231
- data/lib/finnhub_ruby/models/dividends2_info.rb +0 -229
- data/lib/finnhub_ruby/models/document_response.rb +0 -271
- data/lib/finnhub_ruby/models/earning_estimate.rb +0 -259
- data/lib/finnhub_ruby/models/earning_release.rb +0 -299
- data/lib/finnhub_ruby/models/earning_result.rb +0 -289
- data/lib/finnhub_ruby/models/earnings_calendar.rb +0 -221
- data/lib/finnhub_ruby/models/earnings_call_transcripts.rb +0 -303
- data/lib/finnhub_ruby/models/earnings_call_transcripts_list.rb +0 -231
- data/lib/finnhub_ruby/models/earnings_estimates.rb +0 -241
- data/lib/finnhub_ruby/models/earnings_estimates_info.rb +0 -259
- data/lib/finnhub_ruby/models/ebit_estimates.rb +0 -241
- data/lib/finnhub_ruby/models/ebit_estimates_info.rb +0 -259
- data/lib/finnhub_ruby/models/ebitda_estimates.rb +0 -241
- data/lib/finnhub_ruby/models/ebitda_estimates_info.rb +0 -259
- data/lib/finnhub_ruby/models/economic_calendar.rb +0 -221
- data/lib/finnhub_ruby/models/economic_code.rb +0 -249
- data/lib/finnhub_ruby/models/economic_data.rb +0 -231
- data/lib/finnhub_ruby/models/economic_data_info.rb +0 -229
- data/lib/finnhub_ruby/models/economic_event.rb +0 -289
- data/lib/finnhub_ruby/models/estimate.rb +0 -259
- data/lib/finnhub_ruby/models/et_fs_country_exposure.rb +0 -219
- data/lib/finnhub_ruby/models/et_fs_holdings.rb +0 -219
- data/lib/finnhub_ruby/models/et_fs_industry_exposure.rb +0 -219
- data/lib/finnhub_ruby/models/et_fs_profile.rb +0 -216
- data/lib/finnhub_ruby/models/etf_country_exposure_data.rb +0 -229
- data/lib/finnhub_ruby/models/etf_holdings_data.rb +0 -289
- data/lib/finnhub_ruby/models/etf_profile_data.rb +0 -419
- data/lib/finnhub_ruby/models/etf_sector_exposure_data.rb +0 -229
- data/lib/finnhub_ruby/models/etfs_country_exposure.rb +0 -231
- data/lib/finnhub_ruby/models/etfs_holdings.rb +0 -251
- data/lib/finnhub_ruby/models/etfs_profile.rb +0 -228
- data/lib/finnhub_ruby/models/etfs_sector_exposure.rb +0 -231
- data/lib/finnhub_ruby/models/excerpt_response.rb +0 -249
- data/lib/finnhub_ruby/models/fda_comittee_meeting.rb +0 -249
- data/lib/finnhub_ruby/models/filing.rb +0 -289
- data/lib/finnhub_ruby/models/filing_response.rb +0 -339
- data/lib/finnhub_ruby/models/filing_sentiment.rb +0 -299
- data/lib/finnhub_ruby/models/financial_statements.rb +0 -231
- data/lib/finnhub_ruby/models/financials_as_reported.rb +0 -241
- data/lib/finnhub_ruby/models/forex_candles.rb +0 -291
- data/lib/finnhub_ruby/models/forex_symbol.rb +0 -239
- data/lib/finnhub_ruby/models/forexrates.rb +0 -228
- data/lib/finnhub_ruby/models/fund_ownership.rb +0 -231
- data/lib/finnhub_ruby/models/fund_ownership_info.rb +0 -259
- data/lib/finnhub_ruby/models/historical_nbbo.rb +0 -345
- data/lib/finnhub_ruby/models/in_filing_response.rb +0 -351
- data/lib/finnhub_ruby/models/in_filing_search_body.rb +0 -239
- data/lib/finnhub_ruby/models/index_historical_constituent.rb +0 -239
- data/lib/finnhub_ruby/models/indicator.rb +0 -239
- data/lib/finnhub_ruby/models/indices_constituents.rb +0 -231
- data/lib/finnhub_ruby/models/indices_historical_constituents.rb +0 -231
- data/lib/finnhub_ruby/models/insider_sentiments.rb +0 -231
- data/lib/finnhub_ruby/models/insider_sentiments_data.rb +0 -259
- data/lib/finnhub_ruby/models/insider_transactions.rb +0 -231
- data/lib/finnhub_ruby/models/institutional_ownership.rb +0 -241
- data/lib/finnhub_ruby/models/institutional_ownership_group.rb +0 -231
- data/lib/finnhub_ruby/models/institutional_ownership_info.rb +0 -309
- data/lib/finnhub_ruby/models/institutional_portfolio.rb +0 -241
- data/lib/finnhub_ruby/models/institutional_portfolio_group.rb +0 -241
- data/lib/finnhub_ruby/models/institutional_portfolio_info.rb +0 -319
- data/lib/finnhub_ruby/models/institutional_profile.rb +0 -231
- data/lib/finnhub_ruby/models/institutional_profile_info.rb +0 -269
- data/lib/finnhub_ruby/models/international_filing.rb +0 -299
- data/lib/finnhub_ruby/models/investment_theme_portfolio.rb +0 -219
- data/lib/finnhub_ruby/models/investment_themes.rb +0 -231
- data/lib/finnhub_ruby/models/investment_themes_thematic_investing.rb +0 -231
- data/lib/finnhub_ruby/models/investor.rb +0 -249
- data/lib/finnhub_ruby/models/investors_ownership.rb +0 -219
- data/lib/finnhub_ruby/models/ipo_calendar.rb +0 -221
- data/lib/finnhub_ruby/models/ipo_event.rb +0 -289
- data/lib/finnhub_ruby/models/isin_change.rb +0 -241
- data/lib/finnhub_ruby/models/isin_change_info.rb +0 -239
- data/lib/finnhub_ruby/models/key_customers_suppliers.rb +0 -329
- data/lib/finnhub_ruby/models/last_bid_ask.rb +0 -259
- data/lib/finnhub_ruby/models/lobbying_data.rb +0 -359
- data/lib/finnhub_ruby/models/lobbying_result.rb +0 -231
- data/lib/finnhub_ruby/models/major_developments.rb +0 -219
- data/lib/finnhub_ruby/models/major_press_releases.rb +0 -231
- data/lib/finnhub_ruby/models/market_news.rb +0 -299
- data/lib/finnhub_ruby/models/mutual_fund_country_exposure.rb +0 -231
- data/lib/finnhub_ruby/models/mutual_fund_country_exposure_data.rb +0 -229
- data/lib/finnhub_ruby/models/mutual_fund_eet.rb +0 -228
- data/lib/finnhub_ruby/models/mutual_fund_eet_pai.rb +0 -228
- data/lib/finnhub_ruby/models/mutual_fund_holdings.rb +0 -251
- data/lib/finnhub_ruby/models/mutual_fund_holdings_data.rb +0 -289
- data/lib/finnhub_ruby/models/mutual_fund_profile.rb +0 -228
- data/lib/finnhub_ruby/models/mutual_fund_profile_data.rb +0 -479
- data/lib/finnhub_ruby/models/mutual_fund_sector_exposure.rb +0 -231
- data/lib/finnhub_ruby/models/mutual_fund_sector_exposure_data.rb +0 -229
- data/lib/finnhub_ruby/models/mutual_funds_country_exposure.rb +0 -231
- data/lib/finnhub_ruby/models/mutual_funds_holdings.rb +0 -251
- data/lib/finnhub_ruby/models/mutual_funds_profile.rb +0 -228
- data/lib/finnhub_ruby/models/news.rb +0 -299
- data/lib/finnhub_ruby/models/news_sentiment.rb +0 -267
- data/lib/finnhub_ruby/models/ownership.rb +0 -231
- data/lib/finnhub_ruby/models/ownership_info.rb +0 -249
- data/lib/finnhub_ruby/models/pattern_recognition.rb +0 -221
- data/lib/finnhub_ruby/models/press_release.rb +0 -231
- data/lib/finnhub_ruby/models/price_metrics.rb +0 -238
- data/lib/finnhub_ruby/models/price_target.rb +0 -269
- data/lib/finnhub_ruby/models/quote.rb +0 -279
- data/lib/finnhub_ruby/models/recommendation_trend.rb +0 -279
- data/lib/finnhub_ruby/models/reddit_sentiment_content.rb +0 -279
- data/lib/finnhub_ruby/models/report.rb +0 -318
- data/lib/finnhub_ruby/models/revenue_breakdown.rb +0 -241
- data/lib/finnhub_ruby/models/revenue_estimates.rb +0 -241
- data/lib/finnhub_ruby/models/revenue_estimates_info.rb +0 -259
- data/lib/finnhub_ruby/models/search_body.rb +0 -434
- data/lib/finnhub_ruby/models/search_filter.rb +0 -229
- data/lib/finnhub_ruby/models/search_response.rb +0 -251
- data/lib/finnhub_ruby/models/sec_sentiment_analysis.rb +0 -248
- data/lib/finnhub_ruby/models/sector_metric.rb +0 -231
- data/lib/finnhub_ruby/models/sector_metric_data.rb +0 -229
- data/lib/finnhub_ruby/models/sentiment.rb +0 -229
- data/lib/finnhub_ruby/models/similarity_index.rb +0 -241
- data/lib/finnhub_ruby/models/similarity_index_info.rb +0 -329
- data/lib/finnhub_ruby/models/social_sentiment.rb +0 -243
- data/lib/finnhub_ruby/models/split.rb +0 -249
- data/lib/finnhub_ruby/models/stock.rb +0 -249
- data/lib/finnhub_ruby/models/stock_candles.rb +0 -291
- data/lib/finnhub_ruby/models/stock_symbol.rb +0 -309
- data/lib/finnhub_ruby/models/stock_transcripts.rb +0 -259
- data/lib/finnhub_ruby/models/supply_chain_relationships.rb +0 -231
- data/lib/finnhub_ruby/models/support_resistance.rb +0 -221
- data/lib/finnhub_ruby/models/symbol_change.rb +0 -241
- data/lib/finnhub_ruby/models/symbol_change_info.rb +0 -239
- data/lib/finnhub_ruby/models/symbol_lookup.rb +0 -231
- data/lib/finnhub_ruby/models/symbol_lookup_info.rb +0 -249
- data/lib/finnhub_ruby/models/technical_analysis.rb +0 -228
- data/lib/finnhub_ruby/models/tick_data.rb +0 -309
- data/lib/finnhub_ruby/models/transactions.rb +0 -289
- data/lib/finnhub_ruby/models/transcript_content.rb +0 -241
- data/lib/finnhub_ruby/models/transcript_participant.rb +0 -239
- data/lib/finnhub_ruby/models/trend.rb +0 -229
- data/lib/finnhub_ruby/models/twitter_sentiment_content.rb +0 -279
- data/lib/finnhub_ruby/models/upgrade_downgrade.rb +0 -269
- data/lib/finnhub_ruby/models/usa_spending.rb +0 -409
- data/lib/finnhub_ruby/models/usa_spending_result.rb +0 -231
- data/lib/finnhub_ruby/models/uspto_patent.rb +0 -301
- data/lib/finnhub_ruby/models/uspto_patent_result.rb +0 -231
- data/lib/finnhub_ruby/models/visa_application.rb +0 -439
- data/lib/finnhub_ruby/models/visa_application_result.rb +0 -231
- data/spec/api/default_api_spec.rb +0 -724
- data/spec/api_client_spec.rb +0 -226
- data/spec/configuration_spec.rb +0 -42
- data/spec/models/aggregate_indicators_spec.rb +0 -40
- data/spec/models/basic_financials_spec.rb +0 -52
- data/spec/models/bond_candles_spec.rb +0 -46
- data/spec/models/bond_profile_spec.rb +0 -154
- data/spec/models/bond_tick_data_spec.rb +0 -82
- data/spec/models/bond_yield_curve_info_spec.rb +0 -40
- data/spec/models/bond_yield_curve_spec.rb +0 -40
- data/spec/models/breakdown_item_spec.rb +0 -40
- data/spec/models/company_earnings_quality_score_data_spec.rb +0 -70
- data/spec/models/company_earnings_quality_score_spec.rb +0 -46
- data/spec/models/company_esg_spec.rb +0 -64
- data/spec/models/company_executive_spec.rb +0 -40
- data/spec/models/company_news_spec.rb +0 -82
- data/spec/models/company_news_statistics_spec.rb +0 -46
- data/spec/models/company_profile2_spec.rb +0 -100
- data/spec/models/company_profile_spec.rb +0 -196
- data/spec/models/company_spec.rb +0 -70
- data/spec/models/congressional_trading_spec.rb +0 -40
- data/spec/models/congressional_transaction_spec.rb +0 -88
- data/spec/models/country_metadata_spec.rb +0 -64
- data/spec/models/covid_info_spec.rb +0 -52
- data/spec/models/crypto_candles_spec.rb +0 -70
- data/spec/models/crypto_profile_spec.rb +0 -94
- data/spec/models/crypto_symbol_spec.rb +0 -46
- data/spec/models/development_spec.rb +0 -58
- data/spec/models/dividends2_info_spec.rb +0 -40
- data/spec/models/dividends2_spec.rb +0 -40
- data/spec/models/dividends_spec.rb +0 -76
- data/spec/models/document_response_spec.rb +0 -64
- data/spec/models/earning_estimate_spec.rb +0 -58
- data/spec/models/earning_release_spec.rb +0 -82
- data/spec/models/earning_result_spec.rb +0 -64
- data/spec/models/earnings_calendar_spec.rb +0 -34
- data/spec/models/earnings_call_transcripts_list_spec.rb +0 -40
- data/spec/models/earnings_call_transcripts_spec.rb +0 -82
- data/spec/models/earnings_estimates_info_spec.rb +0 -58
- data/spec/models/earnings_estimates_spec.rb +0 -46
- data/spec/models/ebit_estimates_info_spec.rb +0 -58
- data/spec/models/ebit_estimates_spec.rb +0 -46
- data/spec/models/ebitda_estimates_info_spec.rb +0 -58
- data/spec/models/ebitda_estimates_spec.rb +0 -46
- data/spec/models/economic_calendar_spec.rb +0 -34
- data/spec/models/economic_code_spec.rb +0 -52
- data/spec/models/economic_data_info_spec.rb +0 -40
- data/spec/models/economic_data_spec.rb +0 -40
- data/spec/models/economic_event_spec.rb +0 -76
- data/spec/models/estimate_spec.rb +0 -58
- data/spec/models/etf_country_exposure_data_spec.rb +0 -40
- data/spec/models/etf_holdings_data_spec.rb +0 -70
- data/spec/models/etf_profile_data_spec.rb +0 -136
- data/spec/models/etf_sector_exposure_data_spec.rb +0 -40
- data/spec/models/etfs_country_exposure_spec.rb +0 -40
- data/spec/models/etfs_holdings_spec.rb +0 -52
- data/spec/models/etfs_profile_spec.rb +0 -40
- data/spec/models/etfs_sector_exposure_spec.rb +0 -40
- data/spec/models/excerpt_response_spec.rb +0 -52
- data/spec/models/fda_comittee_meeting_spec.rb +0 -52
- data/spec/models/filing_response_spec.rb +0 -106
- data/spec/models/filing_sentiment_spec.rb +0 -82
- data/spec/models/filing_spec.rb +0 -76
- data/spec/models/financial_statements_spec.rb +0 -40
- data/spec/models/financials_as_reported_spec.rb +0 -46
- data/spec/models/forex_candles_spec.rb +0 -70
- data/spec/models/forex_symbol_spec.rb +0 -46
- data/spec/models/forexrates_spec.rb +0 -40
- data/spec/models/fund_ownership_info_spec.rb +0 -58
- data/spec/models/fund_ownership_spec.rb +0 -40
- data/spec/models/historical_nbbo_spec.rb +0 -100
- data/spec/models/in_filing_response_spec.rb +0 -112
- data/spec/models/in_filing_search_body_spec.rb +0 -40
- data/spec/models/index_historical_constituent_spec.rb +0 -46
- data/spec/models/indicator_spec.rb +0 -46
- data/spec/models/indices_constituents_spec.rb +0 -40
- data/spec/models/indices_historical_constituents_spec.rb +0 -40
- data/spec/models/insider_sentiments_data_spec.rb +0 -58
- data/spec/models/insider_sentiments_spec.rb +0 -40
- data/spec/models/insider_transactions_spec.rb +0 -40
- data/spec/models/institutional_ownership_group_spec.rb +0 -40
- data/spec/models/institutional_ownership_info_spec.rb +0 -88
- data/spec/models/institutional_ownership_spec.rb +0 -46
- data/spec/models/institutional_portfolio_group_spec.rb +0 -46
- data/spec/models/institutional_portfolio_info_spec.rb +0 -94
- data/spec/models/institutional_portfolio_spec.rb +0 -46
- data/spec/models/institutional_profile_info_spec.rb +0 -64
- data/spec/models/institutional_profile_spec.rb +0 -40
- data/spec/models/international_filing_spec.rb +0 -82
- data/spec/models/investment_theme_portfolio_spec.rb +0 -34
- data/spec/models/investment_themes_spec.rb +0 -40
- data/spec/models/ipo_calendar_spec.rb +0 -34
- data/spec/models/ipo_event_spec.rb +0 -76
- data/spec/models/isin_change_info_spec.rb +0 -46
- data/spec/models/isin_change_spec.rb +0 -46
- data/spec/models/key_customers_suppliers_spec.rb +0 -52
- data/spec/models/last_bid_ask_spec.rb +0 -58
- data/spec/models/lobbying_data_spec.rb +0 -118
- data/spec/models/lobbying_result_spec.rb +0 -40
- data/spec/models/market_news_spec.rb +0 -82
- data/spec/models/mutual_fund_country_exposure_data_spec.rb +0 -40
- data/spec/models/mutual_fund_country_exposure_spec.rb +0 -40
- data/spec/models/mutual_fund_eet_pai_spec.rb +0 -40
- data/spec/models/mutual_fund_eet_spec.rb +0 -40
- data/spec/models/mutual_fund_holdings_data_spec.rb +0 -70
- data/spec/models/mutual_fund_holdings_spec.rb +0 -52
- data/spec/models/mutual_fund_profile_data_spec.rb +0 -154
- data/spec/models/mutual_fund_profile_spec.rb +0 -40
- data/spec/models/mutual_fund_sector_exposure_data_spec.rb +0 -40
- data/spec/models/mutual_fund_sector_exposure_spec.rb +0 -40
- data/spec/models/news_sentiment_spec.rb +0 -64
- data/spec/models/ownership_info_spec.rb +0 -52
- data/spec/models/ownership_spec.rb +0 -40
- data/spec/models/pattern_recognition_spec.rb +0 -34
- data/spec/models/press_release_spec.rb +0 -40
- data/spec/models/price_metrics_spec.rb +0 -40
- data/spec/models/price_target_spec.rb +0 -64
- data/spec/models/quote_spec.rb +0 -70
- data/spec/models/recommendation_trend_spec.rb +0 -70
- data/spec/models/reddit_sentiment_content_spec.rb +0 -70
- data/spec/models/report_spec.rb +0 -94
- data/spec/models/revenue_breakdown_spec.rb +0 -46
- data/spec/models/revenue_estimates_info_spec.rb +0 -58
- data/spec/models/revenue_estimates_spec.rb +0 -46
- data/spec/models/search_body_spec.rb +0 -160
- data/spec/models/search_filter_spec.rb +0 -40
- data/spec/models/search_response_spec.rb +0 -52
- data/spec/models/sec_sentiment_analysis_spec.rb +0 -52
- data/spec/models/sector_metric_data_spec.rb +0 -40
- data/spec/models/sector_metric_spec.rb +0 -40
- data/spec/models/sentiment_spec.rb +0 -40
- data/spec/models/similarity_index_info_spec.rb +0 -100
- data/spec/models/similarity_index_spec.rb +0 -46
- data/spec/models/social_sentiment_spec.rb +0 -46
- data/spec/models/split_spec.rb +0 -52
- data/spec/models/stock_candles_spec.rb +0 -70
- data/spec/models/stock_symbol_spec.rb +0 -70
- data/spec/models/stock_transcripts_spec.rb +0 -58
- data/spec/models/supply_chain_relationships_spec.rb +0 -40
- data/spec/models/support_resistance_spec.rb +0 -34
- data/spec/models/symbol_change_info_spec.rb +0 -46
- data/spec/models/symbol_change_spec.rb +0 -46
- data/spec/models/symbol_lookup_info_spec.rb +0 -52
- data/spec/models/symbol_lookup_spec.rb +0 -40
- data/spec/models/technical_analysis_spec.rb +0 -40
- data/spec/models/tick_data_spec.rb +0 -82
- data/spec/models/transactions_spec.rb +0 -70
- data/spec/models/transcript_content_spec.rb +0 -46
- data/spec/models/transcript_participant_spec.rb +0 -46
- data/spec/models/trend_spec.rb +0 -40
- data/spec/models/twitter_sentiment_content_spec.rb +0 -70
- data/spec/models/upgrade_downgrade_spec.rb +0 -64
- data/spec/models/usa_spending_result_spec.rb +0 -40
- data/spec/models/usa_spending_spec.rb +0 -148
- data/spec/models/uspto_patent_result_spec.rb +0 -40
- data/spec/models/uspto_patent_spec.rb +0 -82
- data/spec/models/visa_application_result_spec.rb +0 -40
- data/spec/models/visa_application_spec.rb +0 -166
- data/spec/spec_helper.rb +0 -111
data/lib/finnhub_ruby.rb
CHANGED
@@ -1,185 +1,15 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
Generated by: https://openapi-generator.tech
|
9
|
-
OpenAPI Generator version: 5.2.1
|
10
|
-
|
11
|
-
=end
|
12
|
-
|
13
|
-
# Common files
|
14
|
-
require 'finnhub_ruby/api_client'
|
15
|
-
require 'finnhub_ruby/api_error'
|
16
|
-
require 'finnhub_ruby/version'
|
17
|
-
require 'finnhub_ruby/configuration'
|
18
|
-
|
19
|
-
# Models
|
20
|
-
require 'finnhub_ruby/models/aggregate_indicators'
|
21
|
-
require 'finnhub_ruby/models/basic_financials'
|
22
|
-
require 'finnhub_ruby/models/bond_candles'
|
23
|
-
require 'finnhub_ruby/models/bond_profile'
|
24
|
-
require 'finnhub_ruby/models/bond_tick_data'
|
25
|
-
require 'finnhub_ruby/models/bond_yield_curve'
|
26
|
-
require 'finnhub_ruby/models/bond_yield_curve_info'
|
27
|
-
require 'finnhub_ruby/models/breakdown_item'
|
28
|
-
require 'finnhub_ruby/models/company'
|
29
|
-
require 'finnhub_ruby/models/company_esg'
|
30
|
-
require 'finnhub_ruby/models/company_earnings_quality_score'
|
31
|
-
require 'finnhub_ruby/models/company_earnings_quality_score_data'
|
32
|
-
require 'finnhub_ruby/models/company_executive'
|
33
|
-
require 'finnhub_ruby/models/company_news'
|
34
|
-
require 'finnhub_ruby/models/company_news_statistics'
|
35
|
-
require 'finnhub_ruby/models/company_profile'
|
36
|
-
require 'finnhub_ruby/models/company_profile2'
|
37
|
-
require 'finnhub_ruby/models/congressional_trading'
|
38
|
-
require 'finnhub_ruby/models/congressional_transaction'
|
39
|
-
require 'finnhub_ruby/models/country_metadata'
|
40
|
-
require 'finnhub_ruby/models/covid_info'
|
41
|
-
require 'finnhub_ruby/models/crypto_candles'
|
42
|
-
require 'finnhub_ruby/models/crypto_profile'
|
43
|
-
require 'finnhub_ruby/models/crypto_symbol'
|
44
|
-
require 'finnhub_ruby/models/development'
|
45
|
-
require 'finnhub_ruby/models/dividends'
|
46
|
-
require 'finnhub_ruby/models/dividends2'
|
47
|
-
require 'finnhub_ruby/models/dividends2_info'
|
48
|
-
require 'finnhub_ruby/models/document_response'
|
49
|
-
require 'finnhub_ruby/models/etf_country_exposure_data'
|
50
|
-
require 'finnhub_ruby/models/etf_holdings_data'
|
51
|
-
require 'finnhub_ruby/models/etf_profile_data'
|
52
|
-
require 'finnhub_ruby/models/etf_sector_exposure_data'
|
53
|
-
require 'finnhub_ruby/models/etfs_country_exposure'
|
54
|
-
require 'finnhub_ruby/models/etfs_holdings'
|
55
|
-
require 'finnhub_ruby/models/etfs_profile'
|
56
|
-
require 'finnhub_ruby/models/etfs_sector_exposure'
|
57
|
-
require 'finnhub_ruby/models/earning_release'
|
58
|
-
require 'finnhub_ruby/models/earning_result'
|
59
|
-
require 'finnhub_ruby/models/earnings_calendar'
|
60
|
-
require 'finnhub_ruby/models/earnings_call_transcripts'
|
61
|
-
require 'finnhub_ruby/models/earnings_call_transcripts_list'
|
62
|
-
require 'finnhub_ruby/models/earnings_estimates'
|
63
|
-
require 'finnhub_ruby/models/earnings_estimates_info'
|
64
|
-
require 'finnhub_ruby/models/ebit_estimates'
|
65
|
-
require 'finnhub_ruby/models/ebit_estimates_info'
|
66
|
-
require 'finnhub_ruby/models/ebitda_estimates'
|
67
|
-
require 'finnhub_ruby/models/ebitda_estimates_info'
|
68
|
-
require 'finnhub_ruby/models/economic_calendar'
|
69
|
-
require 'finnhub_ruby/models/economic_code'
|
70
|
-
require 'finnhub_ruby/models/economic_data'
|
71
|
-
require 'finnhub_ruby/models/economic_data_info'
|
72
|
-
require 'finnhub_ruby/models/economic_event'
|
73
|
-
require 'finnhub_ruby/models/excerpt_response'
|
74
|
-
require 'finnhub_ruby/models/fda_comittee_meeting'
|
75
|
-
require 'finnhub_ruby/models/filing'
|
76
|
-
require 'finnhub_ruby/models/filing_response'
|
77
|
-
require 'finnhub_ruby/models/filing_sentiment'
|
78
|
-
require 'finnhub_ruby/models/financial_statements'
|
79
|
-
require 'finnhub_ruby/models/financials_as_reported'
|
80
|
-
require 'finnhub_ruby/models/forex_candles'
|
81
|
-
require 'finnhub_ruby/models/forex_symbol'
|
82
|
-
require 'finnhub_ruby/models/forexrates'
|
83
|
-
require 'finnhub_ruby/models/fund_ownership'
|
84
|
-
require 'finnhub_ruby/models/fund_ownership_info'
|
85
|
-
require 'finnhub_ruby/models/historical_nbbo'
|
86
|
-
require 'finnhub_ruby/models/ipo_calendar'
|
87
|
-
require 'finnhub_ruby/models/ipo_event'
|
88
|
-
require 'finnhub_ruby/models/in_filing_response'
|
89
|
-
require 'finnhub_ruby/models/in_filing_search_body'
|
90
|
-
require 'finnhub_ruby/models/index_historical_constituent'
|
91
|
-
require 'finnhub_ruby/models/indicator'
|
92
|
-
require 'finnhub_ruby/models/indices_constituents'
|
93
|
-
require 'finnhub_ruby/models/indices_historical_constituents'
|
94
|
-
require 'finnhub_ruby/models/insider_sentiments'
|
95
|
-
require 'finnhub_ruby/models/insider_sentiments_data'
|
96
|
-
require 'finnhub_ruby/models/insider_transactions'
|
97
|
-
require 'finnhub_ruby/models/institutional_ownership'
|
98
|
-
require 'finnhub_ruby/models/institutional_ownership_group'
|
99
|
-
require 'finnhub_ruby/models/institutional_ownership_info'
|
100
|
-
require 'finnhub_ruby/models/institutional_portfolio'
|
101
|
-
require 'finnhub_ruby/models/institutional_portfolio_group'
|
102
|
-
require 'finnhub_ruby/models/institutional_portfolio_info'
|
103
|
-
require 'finnhub_ruby/models/institutional_profile'
|
104
|
-
require 'finnhub_ruby/models/institutional_profile_info'
|
105
|
-
require 'finnhub_ruby/models/international_filing'
|
106
|
-
require 'finnhub_ruby/models/investment_theme_portfolio'
|
107
|
-
require 'finnhub_ruby/models/investment_themes'
|
108
|
-
require 'finnhub_ruby/models/isin_change'
|
109
|
-
require 'finnhub_ruby/models/isin_change_info'
|
110
|
-
require 'finnhub_ruby/models/key_customers_suppliers'
|
111
|
-
require 'finnhub_ruby/models/last_bid_ask'
|
112
|
-
require 'finnhub_ruby/models/lobbying_data'
|
113
|
-
require 'finnhub_ruby/models/lobbying_result'
|
114
|
-
require 'finnhub_ruby/models/market_news'
|
115
|
-
require 'finnhub_ruby/models/mutual_fund_country_exposure'
|
116
|
-
require 'finnhub_ruby/models/mutual_fund_country_exposure_data'
|
117
|
-
require 'finnhub_ruby/models/mutual_fund_eet'
|
118
|
-
require 'finnhub_ruby/models/mutual_fund_eet_pai'
|
119
|
-
require 'finnhub_ruby/models/mutual_fund_holdings'
|
120
|
-
require 'finnhub_ruby/models/mutual_fund_holdings_data'
|
121
|
-
require 'finnhub_ruby/models/mutual_fund_profile'
|
122
|
-
require 'finnhub_ruby/models/mutual_fund_profile_data'
|
123
|
-
require 'finnhub_ruby/models/mutual_fund_sector_exposure'
|
124
|
-
require 'finnhub_ruby/models/mutual_fund_sector_exposure_data'
|
125
|
-
require 'finnhub_ruby/models/news_sentiment'
|
126
|
-
require 'finnhub_ruby/models/ownership'
|
127
|
-
require 'finnhub_ruby/models/ownership_info'
|
128
|
-
require 'finnhub_ruby/models/pattern_recognition'
|
129
|
-
require 'finnhub_ruby/models/press_release'
|
130
|
-
require 'finnhub_ruby/models/price_metrics'
|
131
|
-
require 'finnhub_ruby/models/price_target'
|
132
|
-
require 'finnhub_ruby/models/quote'
|
133
|
-
require 'finnhub_ruby/models/recommendation_trend'
|
134
|
-
require 'finnhub_ruby/models/reddit_sentiment_content'
|
135
|
-
require 'finnhub_ruby/models/report'
|
136
|
-
require 'finnhub_ruby/models/revenue_breakdown'
|
137
|
-
require 'finnhub_ruby/models/revenue_estimates'
|
138
|
-
require 'finnhub_ruby/models/revenue_estimates_info'
|
139
|
-
require 'finnhub_ruby/models/sec_sentiment_analysis'
|
140
|
-
require 'finnhub_ruby/models/search_body'
|
141
|
-
require 'finnhub_ruby/models/search_filter'
|
142
|
-
require 'finnhub_ruby/models/search_response'
|
143
|
-
require 'finnhub_ruby/models/sector_metric'
|
144
|
-
require 'finnhub_ruby/models/sector_metric_data'
|
145
|
-
require 'finnhub_ruby/models/sentiment'
|
146
|
-
require 'finnhub_ruby/models/similarity_index'
|
147
|
-
require 'finnhub_ruby/models/similarity_index_info'
|
148
|
-
require 'finnhub_ruby/models/social_sentiment'
|
149
|
-
require 'finnhub_ruby/models/split'
|
150
|
-
require 'finnhub_ruby/models/stock_candles'
|
151
|
-
require 'finnhub_ruby/models/stock_symbol'
|
152
|
-
require 'finnhub_ruby/models/stock_transcripts'
|
153
|
-
require 'finnhub_ruby/models/supply_chain_relationships'
|
154
|
-
require 'finnhub_ruby/models/support_resistance'
|
155
|
-
require 'finnhub_ruby/models/symbol_change'
|
156
|
-
require 'finnhub_ruby/models/symbol_change_info'
|
157
|
-
require 'finnhub_ruby/models/symbol_lookup'
|
158
|
-
require 'finnhub_ruby/models/symbol_lookup_info'
|
159
|
-
require 'finnhub_ruby/models/technical_analysis'
|
160
|
-
require 'finnhub_ruby/models/tick_data'
|
161
|
-
require 'finnhub_ruby/models/transactions'
|
162
|
-
require 'finnhub_ruby/models/transcript_content'
|
163
|
-
require 'finnhub_ruby/models/transcript_participant'
|
164
|
-
require 'finnhub_ruby/models/trend'
|
165
|
-
require 'finnhub_ruby/models/twitter_sentiment_content'
|
166
|
-
require 'finnhub_ruby/models/upgrade_downgrade'
|
167
|
-
require 'finnhub_ruby/models/usa_spending'
|
168
|
-
require 'finnhub_ruby/models/usa_spending_result'
|
169
|
-
require 'finnhub_ruby/models/uspto_patent'
|
170
|
-
require 'finnhub_ruby/models/uspto_patent_result'
|
171
|
-
require 'finnhub_ruby/models/visa_application'
|
172
|
-
require 'finnhub_ruby/models/visa_application_result'
|
173
|
-
|
174
|
-
# APIs
|
175
|
-
require 'finnhub_ruby/api/default_api'
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'finnhub_ruby/version'
|
4
|
+
require 'net/http'
|
5
|
+
require 'uri'
|
6
|
+
require 'json'
|
176
7
|
|
177
8
|
module FinnhubRuby
|
178
9
|
class << self
|
179
10
|
# Customize default settings for the SDK using block.
|
180
11
|
# FinnhubRuby.configure do |config|
|
181
|
-
# config.
|
182
|
-
# config.password = "xxx"
|
12
|
+
# config.api_key['api_key'] = "YOUR API KEY"
|
183
13
|
# end
|
184
14
|
# If no block given, return the default Configuration object.
|
185
15
|
def configure
|
@@ -190,4 +20,518 @@ module FinnhubRuby
|
|
190
20
|
end
|
191
21
|
end
|
192
22
|
end
|
193
|
-
|
23
|
+
|
24
|
+
class FinnhubAPIException < StandardError; end
|
25
|
+
class FinnhubRequestException < StandardError; end
|
26
|
+
|
27
|
+
class Configuration
|
28
|
+
attr_accessor :api_key
|
29
|
+
|
30
|
+
def initialize
|
31
|
+
@api_key = {}
|
32
|
+
end
|
33
|
+
|
34
|
+
def self.default
|
35
|
+
@default ||= Configuration.new
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class DefaultApi
|
40
|
+
API_URL = 'https://api.finnhub.io/api/v1'
|
41
|
+
DEFAULT_TIMEOUT = 10
|
42
|
+
|
43
|
+
def initialize(api_client = nil)
|
44
|
+
# api_client is unused, but kept for compatibility with openapi-generator pattern
|
45
|
+
@config = Configuration.default
|
46
|
+
end
|
47
|
+
|
48
|
+
def get(path, params = {})
|
49
|
+
# Ensure exactly one slash between base and path
|
50
|
+
base = API_URL.chomp('/')
|
51
|
+
path = path.start_with?('/') ? path : "/#{path}"
|
52
|
+
url = "#{base}#{path}"
|
53
|
+
uri = URI.parse(url)
|
54
|
+
params = params.dup
|
55
|
+
params['token'] = @config.api_key['api_key']
|
56
|
+
uri.query = URI.encode_www_form(params)
|
57
|
+
|
58
|
+
# Some endpoints redirect to another endpoint, so we need to handle that
|
59
|
+
limit = 2
|
60
|
+
res = nil
|
61
|
+
|
62
|
+
loop do
|
63
|
+
raise FinnhubRequestException, 'Too many redirects' if limit.zero?
|
64
|
+
|
65
|
+
req = Net::HTTP::Get.new(uri)
|
66
|
+
req['Accept'] = 'application/json'
|
67
|
+
req['User-Agent'] = "finnhub/ruby/#{VERSION}"
|
68
|
+
|
69
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
70
|
+
http.use_ssl = (uri.scheme == 'https')
|
71
|
+
http.read_timeout = DEFAULT_TIMEOUT
|
72
|
+
http.open_timeout = DEFAULT_TIMEOUT
|
73
|
+
|
74
|
+
res = http.request(req)
|
75
|
+
|
76
|
+
break unless res.is_a?(Net::HTTPRedirection)
|
77
|
+
|
78
|
+
uri = URI(res['location'])
|
79
|
+
limit -= 1
|
80
|
+
end
|
81
|
+
|
82
|
+
handle_response(res)
|
83
|
+
end
|
84
|
+
|
85
|
+
def quote(symbol)
|
86
|
+
get('/quote', symbol: symbol)
|
87
|
+
end
|
88
|
+
|
89
|
+
def company_profile(params = {})
|
90
|
+
get('/stock/profile', params)
|
91
|
+
end
|
92
|
+
|
93
|
+
def company_profile2(params = {})
|
94
|
+
get('/stock/profile2', params)
|
95
|
+
end
|
96
|
+
|
97
|
+
def aggregate_indicator(symbol, resolution)
|
98
|
+
get('/scan/technical-indicator', { symbol: symbol, resolution: resolution })
|
99
|
+
end
|
100
|
+
|
101
|
+
def crypto_exchanges
|
102
|
+
get('/crypto/exchange')
|
103
|
+
end
|
104
|
+
|
105
|
+
def forex_exchanges
|
106
|
+
get('/forex/exchange')
|
107
|
+
end
|
108
|
+
|
109
|
+
def press_releases(symbol, from: nil, to: nil)
|
110
|
+
get('/press-releases', { symbol: symbol, from: from, to: to }.compact)
|
111
|
+
end
|
112
|
+
|
113
|
+
def company_executive(symbol)
|
114
|
+
get('/stock/executive', { symbol: symbol })
|
115
|
+
end
|
116
|
+
|
117
|
+
def stock_dividends(symbol, from: nil, to: nil)
|
118
|
+
get('/stock/dividend', { symbol: symbol, from: from, to: to }.compact)
|
119
|
+
end
|
120
|
+
|
121
|
+
def stock_basic_dividends(symbol)
|
122
|
+
get('/stock/dividend2', { symbol: symbol })
|
123
|
+
end
|
124
|
+
|
125
|
+
def stock_symbols(exchange, mic: nil, security_type: nil, currency: nil)
|
126
|
+
get('/stock/symbol', { exchange: exchange, mic: mic, securityType: security_type, currency: currency }.compact)
|
127
|
+
end
|
128
|
+
|
129
|
+
def recommendation_trends(symbol)
|
130
|
+
get('/stock/recommendation', { symbol: symbol })
|
131
|
+
end
|
132
|
+
|
133
|
+
def price_target(symbol)
|
134
|
+
get('/stock/price-target', { symbol: symbol })
|
135
|
+
end
|
136
|
+
|
137
|
+
def upgrade_downgrade(symbol: nil, from: nil, to: nil)
|
138
|
+
get('/stock/upgrade-downgrade', { symbol: symbol, from: from, to: to }.compact)
|
139
|
+
end
|
140
|
+
|
141
|
+
def option_chain(params = {})
|
142
|
+
get('/stock/option-chain', params)
|
143
|
+
end
|
144
|
+
|
145
|
+
def company_peers(symbol)
|
146
|
+
get('/stock/peers', { symbol: symbol })
|
147
|
+
end
|
148
|
+
|
149
|
+
def company_basic_financials(symbol, metric)
|
150
|
+
get('/stock/metric', { symbol: symbol, metric: metric })
|
151
|
+
end
|
152
|
+
|
153
|
+
def financials(symbol, statement, freq)
|
154
|
+
get('/stock/financials', { symbol: symbol, statement: statement, freq: freq })
|
155
|
+
end
|
156
|
+
|
157
|
+
def financials_reported(params = {})
|
158
|
+
get('/stock/financials-reported', params)
|
159
|
+
end
|
160
|
+
|
161
|
+
def fund_ownership(symbol, limit: nil)
|
162
|
+
get('/stock/fund-ownership', { symbol: symbol, limit: limit }.compact)
|
163
|
+
end
|
164
|
+
|
165
|
+
def company_earnings(symbol, limit: nil)
|
166
|
+
get('/stock/earnings', { symbol: symbol, limit: limit }.compact)
|
167
|
+
end
|
168
|
+
|
169
|
+
def company_revenue_estimates(symbol, freq: nil)
|
170
|
+
get('/stock/revenue-estimate', { symbol: symbol, freq: freq }.compact)
|
171
|
+
end
|
172
|
+
|
173
|
+
def company_ebitda_estimates(symbol, freq: nil)
|
174
|
+
get('/stock/ebitda-estimate', { symbol: symbol, freq: freq }.compact)
|
175
|
+
end
|
176
|
+
|
177
|
+
def company_ebit_estimates(symbol, freq: nil)
|
178
|
+
get('/stock/ebit-estimate', { symbol: symbol, freq: freq }.compact)
|
179
|
+
end
|
180
|
+
|
181
|
+
def company_eps_estimates(symbol, freq: nil)
|
182
|
+
get('/stock/eps-estimate', { symbol: symbol, freq: freq }.compact)
|
183
|
+
end
|
184
|
+
|
185
|
+
def exchange
|
186
|
+
get('/stock/exchange')
|
187
|
+
end
|
188
|
+
|
189
|
+
def filings(symbol: '', cik: '', access_number: '', form: '', from: '', to: '')
|
190
|
+
get('/stock/filings', { symbol: symbol, cik: cik, accessNumber: access_number, form: form, from: from, to: to }.compact)
|
191
|
+
end
|
192
|
+
|
193
|
+
def stock_symbol(params = {})
|
194
|
+
get('/stock/symbol', params)
|
195
|
+
end
|
196
|
+
|
197
|
+
def transcripts(id)
|
198
|
+
get('/stock/transcripts', { id: id })
|
199
|
+
end
|
200
|
+
|
201
|
+
def transcripts_list(symbol)
|
202
|
+
get('/stock/transcripts/list', { symbol: symbol })
|
203
|
+
end
|
204
|
+
|
205
|
+
# def sim_index(params = {})
|
206
|
+
# get('/stock/similarity-index', params)
|
207
|
+
# end
|
208
|
+
|
209
|
+
def stock_candles(symbol, resolution, from, to, **kwargs)
|
210
|
+
get('/stock/candle', { symbol: symbol, resolution: resolution, from: from, to: to }.merge(kwargs))
|
211
|
+
end
|
212
|
+
|
213
|
+
def stock_tick(symbol, date, limit, skip, format: 'json', **kwargs)
|
214
|
+
get('/stock/tick', { symbol: symbol, date: date, limit: limit, skip: skip, format: format }.merge(kwargs))
|
215
|
+
end
|
216
|
+
|
217
|
+
def stock_nbbo(symbol, date, limit, skip, format: 'json', **kwargs)
|
218
|
+
get('/stock/bbo', { symbol: symbol, date: date, limit: limit, skip: skip, format: format }.merge(kwargs))
|
219
|
+
end
|
220
|
+
|
221
|
+
def forex_rates(params = {})
|
222
|
+
get('/forex/rates', params)
|
223
|
+
end
|
224
|
+
|
225
|
+
def forex_symbols(exchange)
|
226
|
+
get('/forex/symbol', { exchange: exchange })
|
227
|
+
end
|
228
|
+
|
229
|
+
def forex_candles(symbol, resolution, from, to, format: 'json')
|
230
|
+
get('/forex/candle', { symbol: symbol, resolution: resolution, from: from, to: to, format: format })
|
231
|
+
end
|
232
|
+
|
233
|
+
def crypto_symbols(exchange)
|
234
|
+
get('/crypto/symbol', { exchange: exchange })
|
235
|
+
end
|
236
|
+
|
237
|
+
def crypto_candles(symbol, resolution, from, to, format: 'json')
|
238
|
+
get('/crypto/candle', { symbol: symbol, resolution: resolution, from: from, to: to, format: format })
|
239
|
+
end
|
240
|
+
|
241
|
+
def pattern_recognition(symbol, resolution)
|
242
|
+
get('/scan/pattern', { symbol: symbol, resolution: resolution })
|
243
|
+
end
|
244
|
+
|
245
|
+
def support_resistance(symbol, resolution)
|
246
|
+
get('/scan/support-resistance', { symbol: symbol, resolution: resolution })
|
247
|
+
end
|
248
|
+
|
249
|
+
def technical_indicator(symbol, resolution, from, to, indicator, indicator_fields: {})
|
250
|
+
get('/indicator', { symbol: symbol, resolution: resolution, from: from, to: to, indicator: indicator }.merge(indicator_fields))
|
251
|
+
end
|
252
|
+
|
253
|
+
def stock_splits(symbol, from, to)
|
254
|
+
get('/stock/split', { symbol: symbol, from: from, to: to })
|
255
|
+
end
|
256
|
+
|
257
|
+
def general_news(category, min_id: 0)
|
258
|
+
get('/news', { category: category, minId: min_id })
|
259
|
+
end
|
260
|
+
|
261
|
+
def company_news(symbol, from, to)
|
262
|
+
get('/company-news', { symbol: symbol, from: from, to: to })
|
263
|
+
end
|
264
|
+
|
265
|
+
def news_sentiment(symbol)
|
266
|
+
get('/news-sentiment', { symbol: symbol })
|
267
|
+
end
|
268
|
+
|
269
|
+
def ownership(symbol, limit: nil)
|
270
|
+
get('/stock/ownership', { symbol: symbol, limit: limit }.compact)
|
271
|
+
end
|
272
|
+
|
273
|
+
def country
|
274
|
+
get('/country')
|
275
|
+
end
|
276
|
+
|
277
|
+
def economic_code
|
278
|
+
get('/economic/code')
|
279
|
+
end
|
280
|
+
|
281
|
+
def economic_data(code)
|
282
|
+
get('/economic', { code: code })
|
283
|
+
end
|
284
|
+
|
285
|
+
def economic_calendar(from: nil, to: nil)
|
286
|
+
get('/calendar/economic', { from: from, to: to }.compact)
|
287
|
+
end
|
288
|
+
|
289
|
+
def earnings_calendar(from:, to:, symbol: '', international: false)
|
290
|
+
get('/calendar/earnings', { from: from, to: to, symbol: symbol, international: international })
|
291
|
+
end
|
292
|
+
|
293
|
+
def ipo_calendar(from, to)
|
294
|
+
get('/calendar/ipo', { from: from, to: to })
|
295
|
+
end
|
296
|
+
|
297
|
+
def indices_const(params = {})
|
298
|
+
get('/index/constituents', params)
|
299
|
+
end
|
300
|
+
|
301
|
+
def indices_hist_const(params = {})
|
302
|
+
get('/index/historical-constituents', params)
|
303
|
+
end
|
304
|
+
|
305
|
+
def etfs_profile(symbol: nil, isin: nil)
|
306
|
+
get('/etf/profile', { symbol: symbol, isin: isin }.compact)
|
307
|
+
end
|
308
|
+
|
309
|
+
def etfs_holdings(symbol: nil, isin: nil, skip: nil, date: nil)
|
310
|
+
get('/etf/holdings', { symbol: symbol, isin: isin, skip: skip, date: date }.compact)
|
311
|
+
end
|
312
|
+
|
313
|
+
def etfs_sector_exp(symbol)
|
314
|
+
get('/etf/sector', { symbol: symbol })
|
315
|
+
end
|
316
|
+
|
317
|
+
def etfs_country_exp(symbol)
|
318
|
+
get('/etf/country', { symbol: symbol })
|
319
|
+
end
|
320
|
+
|
321
|
+
def international_filings(symbol: '', country: '')
|
322
|
+
get('/stock/international-filings', { symbol: symbol, country: country }.compact)
|
323
|
+
end
|
324
|
+
|
325
|
+
def sentiment_analysis(access_number)
|
326
|
+
get('/stock/filings-sentiment', { accessNumber: access_number })
|
327
|
+
end
|
328
|
+
|
329
|
+
def similarity_index(symbol: '', cik: '', freq: 'annual')
|
330
|
+
get('/stock/similarity-index', { symbol: symbol, cik: cik, freq: freq }.compact)
|
331
|
+
end
|
332
|
+
|
333
|
+
def last_bid_ask(symbol)
|
334
|
+
get('/stock/bidask', { symbol: symbol })
|
335
|
+
end
|
336
|
+
|
337
|
+
def fda_calendar
|
338
|
+
get('/fda-advisory-committee-calendar')
|
339
|
+
end
|
340
|
+
|
341
|
+
def symbol_search(query)
|
342
|
+
get('/search', { q: query })
|
343
|
+
end
|
344
|
+
|
345
|
+
def stock_insider_transactions(symbol, from: nil, to: nil)
|
346
|
+
get('/stock/insider-transactions', { symbol: symbol, from: from, to: to }.compact)
|
347
|
+
end
|
348
|
+
|
349
|
+
def mutual_fund_profile(symbol: nil, isin: nil)
|
350
|
+
get('/mutual-fund/profile', { symbol: symbol, isin: isin }.compact)
|
351
|
+
end
|
352
|
+
|
353
|
+
def mutual_fund_holdings(symbol: nil, isin: nil, skip: nil)
|
354
|
+
get('/mutual-fund/holdings', { symbol: symbol, isin: isin, skip: skip }.compact)
|
355
|
+
end
|
356
|
+
|
357
|
+
def mutual_fund_sector_exp(symbol)
|
358
|
+
get('/mutual-fund/sector', { symbol: symbol })
|
359
|
+
end
|
360
|
+
|
361
|
+
def mutual_fund_country_exp(symbol)
|
362
|
+
get('/mutual-fund/country', { symbol: symbol })
|
363
|
+
end
|
364
|
+
|
365
|
+
def mutual_fund_eet(isin)
|
366
|
+
get('/mutual-fund/eet', { isin: isin })
|
367
|
+
end
|
368
|
+
|
369
|
+
def mutual_fund_eet_pai(isin)
|
370
|
+
get('/mutual-fund/eet-pai', { isin: isin })
|
371
|
+
end
|
372
|
+
|
373
|
+
def stock_revenue_breakdown(symbol, cik: '')
|
374
|
+
get('/stock/revenue-breakdown', { symbol: symbol, cik: cik }.compact)
|
375
|
+
end
|
376
|
+
|
377
|
+
def stock_social_sentiment(symbol, from: nil, to: nil)
|
378
|
+
get('/stock/social-sentiment', { symbol: symbol, from: from, to: to }.compact)
|
379
|
+
end
|
380
|
+
|
381
|
+
def stock_investment_theme(theme)
|
382
|
+
get('/stock/investment-theme', { theme: theme })
|
383
|
+
end
|
384
|
+
|
385
|
+
def stock_supply_chain(symbol)
|
386
|
+
get('/stock/supply-chain', { symbol: symbol })
|
387
|
+
end
|
388
|
+
|
389
|
+
def company_esg_score(symbol)
|
390
|
+
get('/stock/esg', { symbol: symbol })
|
391
|
+
end
|
392
|
+
|
393
|
+
def company_historical_esg_score(symbol)
|
394
|
+
get('/stock/historical-esg', { symbol: symbol })
|
395
|
+
end
|
396
|
+
|
397
|
+
def historical_market_cap(symbol, from: nil, to: nil)
|
398
|
+
get('/stock/historical-market-cap', { symbol: symbol, from: from, to: to }.compact)
|
399
|
+
end
|
400
|
+
|
401
|
+
def company_earnings_quality_score(symbol, freq)
|
402
|
+
get('/stock/earnings-quality-score', { symbol: symbol, freq: freq })
|
403
|
+
end
|
404
|
+
|
405
|
+
def crypto_profile(symbol)
|
406
|
+
get('/crypto/profile', { symbol: symbol })
|
407
|
+
end
|
408
|
+
|
409
|
+
def stock_uspto_patent(symbol, from: nil, to: nil)
|
410
|
+
get('/stock/uspto-patent', { symbol: symbol, from: from, to: to }.compact)
|
411
|
+
end
|
412
|
+
|
413
|
+
def stock_visa_application(symbol, from: nil, to: nil)
|
414
|
+
get('/stock/visa-application', { symbol: symbol, from: from, to: to }.compact)
|
415
|
+
end
|
416
|
+
|
417
|
+
def stock_insider_sentiment(symbol, from, to)
|
418
|
+
get('/stock/insider-sentiment', { symbol: symbol, from: from, to: to })
|
419
|
+
end
|
420
|
+
|
421
|
+
def stock_lobbying(symbol, from, to)
|
422
|
+
get('/stock/lobbying', { symbol: symbol, from: from, to: to })
|
423
|
+
end
|
424
|
+
|
425
|
+
def bond_profile(params = {})
|
426
|
+
get('/bond/profile', params)
|
427
|
+
end
|
428
|
+
|
429
|
+
def bond_price(isin, from, to)
|
430
|
+
get('/bond/price', { isin: isin, from: from, to: to })
|
431
|
+
end
|
432
|
+
|
433
|
+
def stock_usa_spending(symbol, from, to)
|
434
|
+
get('/stock/usa-spending', { symbol: symbol, from: from, to: to })
|
435
|
+
end
|
436
|
+
|
437
|
+
def sector_metric(region)
|
438
|
+
get('/sector/metrics', { region: region })
|
439
|
+
end
|
440
|
+
|
441
|
+
def price_metrics(symbol, date: '')
|
442
|
+
get('/stock/price-metric', { symbol: symbol, date: date })
|
443
|
+
end
|
444
|
+
|
445
|
+
def symbol_change(from, to)
|
446
|
+
get('/ca/symbol-change', { from: from, to: to })
|
447
|
+
end
|
448
|
+
|
449
|
+
def isin_change(from, to)
|
450
|
+
get('/ca/isin-change', { from: from, to: to })
|
451
|
+
end
|
452
|
+
|
453
|
+
def institutional_profile(cik: '')
|
454
|
+
get('/institutional/profile', { cik: cik }.compact)
|
455
|
+
end
|
456
|
+
|
457
|
+
def institutional_portfolio(cik, from, to)
|
458
|
+
get('/institutional/portfolio', { cik: cik, from: from, to: to })
|
459
|
+
end
|
460
|
+
|
461
|
+
def institutional_ownership(symbol, cusip, from, to)
|
462
|
+
get('/institutional/ownership', { symbol: symbol, cusip: cusip, from: from, to: to })
|
463
|
+
end
|
464
|
+
|
465
|
+
def congressional_trading(symbol, from, to)
|
466
|
+
get('/stock/congressional-trading', { symbol: symbol, from: from, to: to })
|
467
|
+
end
|
468
|
+
|
469
|
+
def bond_tick(isin, date, limit, skip, exchange: 'trace', format: 'json', **kwargs)
|
470
|
+
get('/bond/tick', { isin: isin, date: date, limit: limit, skip: skip, exchange: exchange, format: format }.merge(kwargs))
|
471
|
+
end
|
472
|
+
|
473
|
+
def bond_yield_curve(code)
|
474
|
+
get('/bond/yield-curve', { code: code })
|
475
|
+
end
|
476
|
+
|
477
|
+
def market_status(exchange)
|
478
|
+
get('/stock/market-status', { exchange: exchange })
|
479
|
+
end
|
480
|
+
|
481
|
+
def market_holiday(exchange)
|
482
|
+
get('/stock/market-holiday', { exchange: exchange })
|
483
|
+
end
|
484
|
+
|
485
|
+
def historical_employee_count(symbol, from, to)
|
486
|
+
get('/stock/historical-employee-count', { symbol: symbol, from: from, to: to })
|
487
|
+
end
|
488
|
+
|
489
|
+
def airline_price_index(airline, from, to)
|
490
|
+
get('/airline/price-index', { airline: airline, from: from, to: to })
|
491
|
+
end
|
492
|
+
|
493
|
+
def earnings_call_live(from, to, symbol: '')
|
494
|
+
get('/stock/earnings-call-live', { symbol: symbol, from: from, to: to })
|
495
|
+
end
|
496
|
+
|
497
|
+
def stock_presentation(symbol)
|
498
|
+
get('/stock/presentation', { symbol: symbol })
|
499
|
+
end
|
500
|
+
|
501
|
+
def stock_revenue_breakdown2(symbol)
|
502
|
+
get('/stock/revenue-breakdown2', { symbol: symbol })
|
503
|
+
end
|
504
|
+
|
505
|
+
def covid19
|
506
|
+
get('/covid19/us')
|
507
|
+
end
|
508
|
+
|
509
|
+
def bank_branch(symbol)
|
510
|
+
get('/bank-branch', { symbol: symbol })
|
511
|
+
end
|
512
|
+
|
513
|
+
private
|
514
|
+
|
515
|
+
def handle_response(res)
|
516
|
+
case res
|
517
|
+
when Net::HTTPSuccess
|
518
|
+
content_type = res['Content-Type'] || ''
|
519
|
+
if content_type.include?('application/json')
|
520
|
+
JSON.parse(res.body)
|
521
|
+
elsif content_type.include?('text/csv') || content_type.include?('text/plain')
|
522
|
+
res.body
|
523
|
+
else
|
524
|
+
raise FinnhubRequestException, "Invalid Response: #{res.body}"
|
525
|
+
end
|
526
|
+
else
|
527
|
+
begin
|
528
|
+
json = JSON.parse(res.body)
|
529
|
+
msg = json['error'] || res.body
|
530
|
+
rescue JSON::ParserError
|
531
|
+
msg = res.body
|
532
|
+
end
|
533
|
+
raise FinnhubAPIException, "FinnhubAPIException(status_code: #{res.code}): #{msg}"
|
534
|
+
end
|
535
|
+
end
|
536
|
+
end
|
537
|
+
end
|