finnhub_ruby 1.0.0
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 +7 -0
- data/Gemfile +9 -0
- data/LICENSE +201 -0
- data/README.md +164 -0
- data/Rakefile +10 -0
- data/docs/AggregateIndicators.md +19 -0
- data/docs/BasicFinancials.md +21 -0
- data/docs/Company.md +29 -0
- data/docs/CompanyExecutive.md +19 -0
- data/docs/CompanyNewsStatistics.md +21 -0
- data/docs/CompanyProfile.md +71 -0
- data/docs/CompanyProfile2.md +39 -0
- data/docs/CountryMetadata.md +27 -0
- data/docs/CovidInfo.md +23 -0
- data/docs/CryptoCandles.md +29 -0
- data/docs/CryptoSymbol.md +21 -0
- data/docs/DefaultApi.md +2662 -0
- data/docs/Development.md +23 -0
- data/docs/Dividends.md +31 -0
- data/docs/EarningEstimate.md +25 -0
- data/docs/EarningRelease.md +33 -0
- data/docs/EarningResult.md +23 -0
- data/docs/EarningsCalendar.md +17 -0
- data/docs/EarningsCallTranscripts.md +33 -0
- data/docs/EarningsCallTranscriptsList.md +19 -0
- data/docs/EarningsEstimates.md +21 -0
- data/docs/EconomicCalendar.md +17 -0
- data/docs/EconomicCode.md +23 -0
- data/docs/EconomicData.md +19 -0
- data/docs/EconomicEvent.md +31 -0
- data/docs/Estimate.md +25 -0
- data/docs/Filing.md +31 -0
- data/docs/FinancialStatements.md +19 -0
- data/docs/FinancialsAsReported.md +21 -0
- data/docs/ForexCandles.md +29 -0
- data/docs/ForexSymbol.md +21 -0
- data/docs/Forexrates.md +19 -0
- data/docs/FundOwnership.md +19 -0
- data/docs/IPOCalendar.md +17 -0
- data/docs/IPOEvent.md +31 -0
- data/docs/Indicator.md +21 -0
- data/docs/Investor.md +23 -0
- data/docs/InvestorsOwnership.md +19 -0
- data/docs/LastBidAsk.md +25 -0
- data/docs/MajorDevelopments.md +19 -0
- data/docs/News.md +33 -0
- data/docs/NewsSentiment.md +27 -0
- data/docs/PatternRecognition.md +17 -0
- data/docs/PriceTarget.md +27 -0
- data/docs/Quote.md +25 -0
- data/docs/RecommendationTrend.md +29 -0
- data/docs/Report.md +37 -0
- data/docs/RevenueEstimates.md +21 -0
- data/docs/Sentiment.md +19 -0
- data/docs/Split.md +23 -0
- data/docs/Stock.md +21 -0
- data/docs/StockCandles.md +29 -0
- data/docs/StockTranscripts.md +25 -0
- data/docs/SupportResistance.md +17 -0
- data/docs/TechnicalAnalysis.md +19 -0
- data/docs/TickData.md +31 -0
- data/docs/TranscriptContent.md +19 -0
- data/docs/TranscriptParticipant.md +19 -0
- data/docs/Trend.md +17 -0
- data/docs/UpgradeDowngrade.md +27 -0
- data/finnhub_ruby-0.0.1.gem +0 -0
- data/finnhub_ruby-0.0.2.gem +0 -0
- data/finnhub_ruby.gemspec +39 -0
- data/git_push.sh +58 -0
- data/lib/finnhub_ruby.rb +99 -0
- data/lib/finnhub_ruby/api/default_api.rb +3142 -0
- data/lib/finnhub_ruby/api_client.rb +389 -0
- data/lib/finnhub_ruby/api_error.rb +57 -0
- data/lib/finnhub_ruby/configuration.rb +248 -0
- data/lib/finnhub_ruby/models/aggregate_indicators.rb +215 -0
- data/lib/finnhub_ruby/models/basic_financials.rb +226 -0
- data/lib/finnhub_ruby/models/company.rb +267 -0
- data/lib/finnhub_ruby/models/company_executive.rb +219 -0
- data/lib/finnhub_ruby/models/company_news_statistics.rb +227 -0
- data/lib/finnhub_ruby/models/company_profile.rb +477 -0
- data/lib/finnhub_ruby/models/company_profile2.rb +317 -0
- data/lib/finnhub_ruby/models/country_metadata.rb +257 -0
- data/lib/finnhub_ruby/models/covid_info.rb +237 -0
- data/lib/finnhub_ruby/models/crypto_candles.rb +279 -0
- data/lib/finnhub_ruby/models/crypto_symbol.rb +227 -0
- data/lib/finnhub_ruby/models/development.rb +237 -0
- data/lib/finnhub_ruby/models/dividends.rb +277 -0
- data/lib/finnhub_ruby/models/earning_estimate.rb +247 -0
- data/lib/finnhub_ruby/models/earning_release.rb +287 -0
- data/lib/finnhub_ruby/models/earning_result.rb +237 -0
- data/lib/finnhub_ruby/models/earnings_calendar.rb +209 -0
- data/lib/finnhub_ruby/models/earnings_call_transcripts.rb +291 -0
- data/lib/finnhub_ruby/models/earnings_call_transcripts_list.rb +219 -0
- data/lib/finnhub_ruby/models/earnings_estimates.rb +229 -0
- data/lib/finnhub_ruby/models/economic_calendar.rb +209 -0
- data/lib/finnhub_ruby/models/economic_code.rb +237 -0
- data/lib/finnhub_ruby/models/economic_data.rb +219 -0
- data/lib/finnhub_ruby/models/economic_event.rb +277 -0
- data/lib/finnhub_ruby/models/estimate.rb +247 -0
- data/lib/finnhub_ruby/models/filing.rb +277 -0
- data/lib/finnhub_ruby/models/financial_statements.rb +219 -0
- data/lib/finnhub_ruby/models/financials_as_reported.rb +229 -0
- data/lib/finnhub_ruby/models/forex_candles.rb +279 -0
- data/lib/finnhub_ruby/models/forex_symbol.rb +227 -0
- data/lib/finnhub_ruby/models/forexrates.rb +216 -0
- data/lib/finnhub_ruby/models/fund_ownership.rb +219 -0
- data/lib/finnhub_ruby/models/indicator.rb +227 -0
- data/lib/finnhub_ruby/models/investor.rb +237 -0
- data/lib/finnhub_ruby/models/investors_ownership.rb +219 -0
- data/lib/finnhub_ruby/models/ipo_calendar.rb +209 -0
- data/lib/finnhub_ruby/models/ipo_event.rb +277 -0
- data/lib/finnhub_ruby/models/last_bid_ask.rb +247 -0
- data/lib/finnhub_ruby/models/major_developments.rb +219 -0
- data/lib/finnhub_ruby/models/news.rb +287 -0
- data/lib/finnhub_ruby/models/news_sentiment.rb +255 -0
- data/lib/finnhub_ruby/models/pattern_recognition.rb +209 -0
- data/lib/finnhub_ruby/models/price_target.rb +257 -0
- data/lib/finnhub_ruby/models/quote.rb +247 -0
- data/lib/finnhub_ruby/models/recommendation_trend.rb +267 -0
- data/lib/finnhub_ruby/models/report.rb +306 -0
- data/lib/finnhub_ruby/models/revenue_estimates.rb +229 -0
- data/lib/finnhub_ruby/models/sentiment.rb +217 -0
- data/lib/finnhub_ruby/models/split.rb +237 -0
- data/lib/finnhub_ruby/models/stock.rb +227 -0
- data/lib/finnhub_ruby/models/stock_candles.rb +279 -0
- data/lib/finnhub_ruby/models/stock_transcripts.rb +247 -0
- data/lib/finnhub_ruby/models/support_resistance.rb +209 -0
- data/lib/finnhub_ruby/models/technical_analysis.rb +216 -0
- data/lib/finnhub_ruby/models/tick_data.rb +285 -0
- data/lib/finnhub_ruby/models/transcript_content.rb +219 -0
- data/lib/finnhub_ruby/models/transcript_participant.rb +217 -0
- data/lib/finnhub_ruby/models/trend.rb +207 -0
- data/lib/finnhub_ruby/models/upgrade_downgrade.rb +257 -0
- data/lib/finnhub_ruby/version.rb +15 -0
- data/release.sh +2 -0
- data/spec/api/default_api_spec.rb +638 -0
- data/spec/api_client_spec.rb +226 -0
- data/spec/configuration_spec.rb +42 -0
- data/spec/models/aggregate_indicators_spec.rb +47 -0
- data/spec/models/basic_financials_spec.rb +53 -0
- data/spec/models/company_executive_spec.rb +47 -0
- data/spec/models/company_news_statistics_spec.rb +53 -0
- data/spec/models/company_profile2_spec.rb +107 -0
- data/spec/models/company_profile_spec.rb +203 -0
- data/spec/models/company_spec.rb +77 -0
- data/spec/models/country_metadata_spec.rb +71 -0
- data/spec/models/covid_info_spec.rb +59 -0
- data/spec/models/crypto_candles_spec.rb +77 -0
- data/spec/models/crypto_symbol_spec.rb +53 -0
- data/spec/models/development_spec.rb +59 -0
- data/spec/models/dividends_spec.rb +83 -0
- data/spec/models/earning_estimate_spec.rb +65 -0
- data/spec/models/earning_release_spec.rb +89 -0
- data/spec/models/earning_result_spec.rb +59 -0
- data/spec/models/earnings_calendar_spec.rb +41 -0
- data/spec/models/earnings_call_transcripts_list_spec.rb +47 -0
- data/spec/models/earnings_call_transcripts_spec.rb +89 -0
- data/spec/models/earnings_estimates_spec.rb +53 -0
- data/spec/models/economic_calendar_spec.rb +41 -0
- data/spec/models/economic_code_spec.rb +59 -0
- data/spec/models/economic_data_spec.rb +47 -0
- data/spec/models/economic_event_spec.rb +83 -0
- data/spec/models/estimate_spec.rb +65 -0
- data/spec/models/filing_spec.rb +83 -0
- data/spec/models/financial_statements_spec.rb +47 -0
- data/spec/models/financials_as_reported_spec.rb +53 -0
- data/spec/models/forex_candles_spec.rb +77 -0
- data/spec/models/forex_symbol_spec.rb +53 -0
- data/spec/models/forexrates_spec.rb +47 -0
- data/spec/models/fund_ownership_spec.rb +47 -0
- data/spec/models/indicator_spec.rb +53 -0
- data/spec/models/investor_spec.rb +59 -0
- data/spec/models/investors_ownership_spec.rb +47 -0
- data/spec/models/ipo_calendar_spec.rb +41 -0
- data/spec/models/ipo_event_spec.rb +83 -0
- data/spec/models/last_bid_ask_spec.rb +65 -0
- data/spec/models/major_developments_spec.rb +47 -0
- data/spec/models/news_sentiment_spec.rb +71 -0
- data/spec/models/news_spec.rb +89 -0
- data/spec/models/pattern_recognition_spec.rb +41 -0
- data/spec/models/price_target_spec.rb +71 -0
- data/spec/models/quote_spec.rb +65 -0
- data/spec/models/recommendation_trend_spec.rb +77 -0
- data/spec/models/report_spec.rb +101 -0
- data/spec/models/revenue_estimates_spec.rb +53 -0
- data/spec/models/sentiment_spec.rb +47 -0
- data/spec/models/split_spec.rb +59 -0
- data/spec/models/stock_candles_spec.rb +77 -0
- data/spec/models/stock_spec.rb +53 -0
- data/spec/models/stock_transcripts_spec.rb +65 -0
- data/spec/models/support_resistance_spec.rb +41 -0
- data/spec/models/technical_analysis_spec.rb +47 -0
- data/spec/models/tick_data_spec.rb +83 -0
- data/spec/models/transcript_content_spec.rb +47 -0
- data/spec/models/transcript_participant_spec.rb +47 -0
- data/spec/models/trend_spec.rb +41 -0
- data/spec/models/upgrade_downgrade_spec.rb +71 -0
- data/spec/spec_helper.rb +111 -0
- data/test.rb +139 -0
- metadata +364 -0
@@ -0,0 +1,3142 @@
|
|
1
|
+
=begin
|
2
|
+
#Finnhub API
|
3
|
+
|
4
|
+
#No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
5
|
+
|
6
|
+
The version of the OpenAPI document: 1.0.0
|
7
|
+
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
OpenAPI Generator version: 4.3.1
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module FinnhubRuby
|
16
|
+
class DefaultApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Aggregate Indicators
|
23
|
+
# Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v.
|
24
|
+
# @param symbol [String] symbol
|
25
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
26
|
+
# @param [Hash] opts the optional parameters
|
27
|
+
# @return [AggregateIndicators]
|
28
|
+
def aggregate_indicator(symbol, resolution, opts = {})
|
29
|
+
data, _status_code, _headers = aggregate_indicator_with_http_info(symbol, resolution, opts)
|
30
|
+
data
|
31
|
+
end
|
32
|
+
|
33
|
+
# Aggregate Indicators
|
34
|
+
# Get aggregate signal of multiple technical indicators such as MACD, RSI, Moving Average v.v.
|
35
|
+
# @param symbol [String] symbol
|
36
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
37
|
+
# @param [Hash] opts the optional parameters
|
38
|
+
# @return [Array<(AggregateIndicators, Integer, Hash)>] AggregateIndicators data, response status code and response headers
|
39
|
+
def aggregate_indicator_with_http_info(symbol, resolution, opts = {})
|
40
|
+
if @api_client.config.debugging
|
41
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.aggregate_indicator ...'
|
42
|
+
end
|
43
|
+
# verify the required parameter 'symbol' is set
|
44
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
45
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.aggregate_indicator"
|
46
|
+
end
|
47
|
+
# verify the required parameter 'resolution' is set
|
48
|
+
if @api_client.config.client_side_validation && resolution.nil?
|
49
|
+
fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.aggregate_indicator"
|
50
|
+
end
|
51
|
+
# resource path
|
52
|
+
local_var_path = '/scan/technical-indicator'
|
53
|
+
|
54
|
+
# query parameters
|
55
|
+
query_params = opts[:query_params] || {}
|
56
|
+
query_params[:'symbol'] = symbol
|
57
|
+
query_params[:'resolution'] = resolution
|
58
|
+
|
59
|
+
# header parameters
|
60
|
+
header_params = opts[:header_params] || {}
|
61
|
+
# HTTP header 'Accept' (if needed)
|
62
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
63
|
+
|
64
|
+
# form parameters
|
65
|
+
form_params = opts[:form_params] || {}
|
66
|
+
|
67
|
+
# http body (model)
|
68
|
+
post_body = opts[:body]
|
69
|
+
|
70
|
+
# return_type
|
71
|
+
return_type = opts[:return_type] || 'AggregateIndicators'
|
72
|
+
|
73
|
+
# auth_names
|
74
|
+
auth_names = opts[:auth_names] || ['api_key']
|
75
|
+
|
76
|
+
new_options = opts.merge(
|
77
|
+
:header_params => header_params,
|
78
|
+
:query_params => query_params,
|
79
|
+
:form_params => form_params,
|
80
|
+
:body => post_body,
|
81
|
+
:auth_names => auth_names,
|
82
|
+
:return_type => return_type
|
83
|
+
)
|
84
|
+
|
85
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
86
|
+
if @api_client.config.debugging
|
87
|
+
@api_client.config.logger.debug "API called: DefaultApi#aggregate_indicator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
88
|
+
end
|
89
|
+
return data, status_code, headers
|
90
|
+
end
|
91
|
+
|
92
|
+
# Basic Financials
|
93
|
+
# Get company basic financials such as margin, P/E ratio, 52-week high/low etc.
|
94
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
95
|
+
# @param metric [String] Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code>
|
96
|
+
# @param [Hash] opts the optional parameters
|
97
|
+
# @return [BasicFinancials]
|
98
|
+
def company_basic_financials(symbol, metric, opts = {})
|
99
|
+
data, _status_code, _headers = company_basic_financials_with_http_info(symbol, metric, opts)
|
100
|
+
data
|
101
|
+
end
|
102
|
+
|
103
|
+
# Basic Financials
|
104
|
+
# Get company basic financials such as margin, P/E ratio, 52-week high/low etc.
|
105
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
106
|
+
# @param metric [String] Metric type. Can be 1 of the following values <code>all, price, valuation, margin</code>
|
107
|
+
# @param [Hash] opts the optional parameters
|
108
|
+
# @return [Array<(BasicFinancials, Integer, Hash)>] BasicFinancials data, response status code and response headers
|
109
|
+
def company_basic_financials_with_http_info(symbol, metric, opts = {})
|
110
|
+
if @api_client.config.debugging
|
111
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_basic_financials ...'
|
112
|
+
end
|
113
|
+
# verify the required parameter 'symbol' is set
|
114
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
115
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_basic_financials"
|
116
|
+
end
|
117
|
+
# verify the required parameter 'metric' is set
|
118
|
+
if @api_client.config.client_side_validation && metric.nil?
|
119
|
+
fail ArgumentError, "Missing the required parameter 'metric' when calling DefaultApi.company_basic_financials"
|
120
|
+
end
|
121
|
+
# resource path
|
122
|
+
local_var_path = '/stock/metric'
|
123
|
+
|
124
|
+
# query parameters
|
125
|
+
query_params = opts[:query_params] || {}
|
126
|
+
query_params[:'symbol'] = symbol
|
127
|
+
query_params[:'metric'] = metric
|
128
|
+
|
129
|
+
# header parameters
|
130
|
+
header_params = opts[:header_params] || {}
|
131
|
+
# HTTP header 'Accept' (if needed)
|
132
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
133
|
+
|
134
|
+
# form parameters
|
135
|
+
form_params = opts[:form_params] || {}
|
136
|
+
|
137
|
+
# http body (model)
|
138
|
+
post_body = opts[:body]
|
139
|
+
|
140
|
+
# return_type
|
141
|
+
return_type = opts[:return_type] || 'BasicFinancials'
|
142
|
+
|
143
|
+
# auth_names
|
144
|
+
auth_names = opts[:auth_names] || ['api_key']
|
145
|
+
|
146
|
+
new_options = opts.merge(
|
147
|
+
:header_params => header_params,
|
148
|
+
:query_params => query_params,
|
149
|
+
:form_params => form_params,
|
150
|
+
:body => post_body,
|
151
|
+
:auth_names => auth_names,
|
152
|
+
:return_type => return_type
|
153
|
+
)
|
154
|
+
|
155
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
156
|
+
if @api_client.config.debugging
|
157
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_basic_financials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
158
|
+
end
|
159
|
+
return data, status_code, headers
|
160
|
+
end
|
161
|
+
|
162
|
+
# Earnings Surprises
|
163
|
+
# Get company historical quarterly earnings surprise going back to 2000.
|
164
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
165
|
+
# @param [Hash] opts the optional parameters
|
166
|
+
# @option opts [Integer] :limit Limit number of period returned. Leave blank to get the full history.
|
167
|
+
# @return [Array<EarningResult>]
|
168
|
+
def company_earnings(symbol, opts = {})
|
169
|
+
data, _status_code, _headers = company_earnings_with_http_info(symbol, opts)
|
170
|
+
data
|
171
|
+
end
|
172
|
+
|
173
|
+
# Earnings Surprises
|
174
|
+
# Get company historical quarterly earnings surprise going back to 2000.
|
175
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
176
|
+
# @param [Hash] opts the optional parameters
|
177
|
+
# @option opts [Integer] :limit Limit number of period returned. Leave blank to get the full history.
|
178
|
+
# @return [Array<(Array<EarningResult>, Integer, Hash)>] Array<EarningResult> data, response status code and response headers
|
179
|
+
def company_earnings_with_http_info(symbol, opts = {})
|
180
|
+
if @api_client.config.debugging
|
181
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_earnings ...'
|
182
|
+
end
|
183
|
+
# verify the required parameter 'symbol' is set
|
184
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
185
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_earnings"
|
186
|
+
end
|
187
|
+
# resource path
|
188
|
+
local_var_path = '/stock/earnings'
|
189
|
+
|
190
|
+
# query parameters
|
191
|
+
query_params = opts[:query_params] || {}
|
192
|
+
query_params[:'symbol'] = symbol
|
193
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
194
|
+
|
195
|
+
# header parameters
|
196
|
+
header_params = opts[:header_params] || {}
|
197
|
+
# HTTP header 'Accept' (if needed)
|
198
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
199
|
+
|
200
|
+
# form parameters
|
201
|
+
form_params = opts[:form_params] || {}
|
202
|
+
|
203
|
+
# http body (model)
|
204
|
+
post_body = opts[:body]
|
205
|
+
|
206
|
+
# return_type
|
207
|
+
return_type = opts[:return_type] || 'Array<EarningResult>'
|
208
|
+
|
209
|
+
# auth_names
|
210
|
+
auth_names = opts[:auth_names] || ['api_key']
|
211
|
+
|
212
|
+
new_options = opts.merge(
|
213
|
+
:header_params => header_params,
|
214
|
+
:query_params => query_params,
|
215
|
+
:form_params => form_params,
|
216
|
+
:body => post_body,
|
217
|
+
:auth_names => auth_names,
|
218
|
+
:return_type => return_type
|
219
|
+
)
|
220
|
+
|
221
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
222
|
+
if @api_client.config.debugging
|
223
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_earnings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
224
|
+
end
|
225
|
+
return data, status_code, headers
|
226
|
+
end
|
227
|
+
|
228
|
+
# Earnings Estimates
|
229
|
+
# Get company's EPS estimates.
|
230
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
231
|
+
# @param [Hash] opts the optional parameters
|
232
|
+
# @option opts [String] :freq Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
|
233
|
+
# @return [EarningsEstimates]
|
234
|
+
def company_eps_estimates(symbol, opts = {})
|
235
|
+
data, _status_code, _headers = company_eps_estimates_with_http_info(symbol, opts)
|
236
|
+
data
|
237
|
+
end
|
238
|
+
|
239
|
+
# Earnings Estimates
|
240
|
+
# Get company's EPS estimates.
|
241
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
242
|
+
# @param [Hash] opts the optional parameters
|
243
|
+
# @option opts [String] :freq Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
|
244
|
+
# @return [Array<(EarningsEstimates, Integer, Hash)>] EarningsEstimates data, response status code and response headers
|
245
|
+
def company_eps_estimates_with_http_info(symbol, opts = {})
|
246
|
+
if @api_client.config.debugging
|
247
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_eps_estimates ...'
|
248
|
+
end
|
249
|
+
# verify the required parameter 'symbol' is set
|
250
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
251
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_eps_estimates"
|
252
|
+
end
|
253
|
+
# resource path
|
254
|
+
local_var_path = '/stock/eps-estimate'
|
255
|
+
|
256
|
+
# query parameters
|
257
|
+
query_params = opts[:query_params] || {}
|
258
|
+
query_params[:'symbol'] = symbol
|
259
|
+
query_params[:'freq'] = opts[:'freq'] if !opts[:'freq'].nil?
|
260
|
+
|
261
|
+
# header parameters
|
262
|
+
header_params = opts[:header_params] || {}
|
263
|
+
# HTTP header 'Accept' (if needed)
|
264
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
265
|
+
|
266
|
+
# form parameters
|
267
|
+
form_params = opts[:form_params] || {}
|
268
|
+
|
269
|
+
# http body (model)
|
270
|
+
post_body = opts[:body]
|
271
|
+
|
272
|
+
# return_type
|
273
|
+
return_type = opts[:return_type] || 'EarningsEstimates'
|
274
|
+
|
275
|
+
# auth_names
|
276
|
+
auth_names = opts[:auth_names] || ['api_key']
|
277
|
+
|
278
|
+
new_options = opts.merge(
|
279
|
+
:header_params => header_params,
|
280
|
+
:query_params => query_params,
|
281
|
+
:form_params => form_params,
|
282
|
+
:body => post_body,
|
283
|
+
:auth_names => auth_names,
|
284
|
+
:return_type => return_type
|
285
|
+
)
|
286
|
+
|
287
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
288
|
+
if @api_client.config.debugging
|
289
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_eps_estimates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
290
|
+
end
|
291
|
+
return data, status_code, headers
|
292
|
+
end
|
293
|
+
|
294
|
+
# Company Executive
|
295
|
+
# Get a list of company's executives and members of the Board.
|
296
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
297
|
+
# @param [Hash] opts the optional parameters
|
298
|
+
# @return [CompanyExecutive]
|
299
|
+
def company_executive(symbol, opts = {})
|
300
|
+
data, _status_code, _headers = company_executive_with_http_info(symbol, opts)
|
301
|
+
data
|
302
|
+
end
|
303
|
+
|
304
|
+
# Company Executive
|
305
|
+
# Get a list of company's executives and members of the Board.
|
306
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
307
|
+
# @param [Hash] opts the optional parameters
|
308
|
+
# @return [Array<(CompanyExecutive, Integer, Hash)>] CompanyExecutive data, response status code and response headers
|
309
|
+
def company_executive_with_http_info(symbol, opts = {})
|
310
|
+
if @api_client.config.debugging
|
311
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_executive ...'
|
312
|
+
end
|
313
|
+
# verify the required parameter 'symbol' is set
|
314
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
315
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_executive"
|
316
|
+
end
|
317
|
+
# resource path
|
318
|
+
local_var_path = '/stock/executive'
|
319
|
+
|
320
|
+
# query parameters
|
321
|
+
query_params = opts[:query_params] || {}
|
322
|
+
query_params[:'symbol'] = symbol
|
323
|
+
|
324
|
+
# header parameters
|
325
|
+
header_params = opts[:header_params] || {}
|
326
|
+
# HTTP header 'Accept' (if needed)
|
327
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
328
|
+
|
329
|
+
# form parameters
|
330
|
+
form_params = opts[:form_params] || {}
|
331
|
+
|
332
|
+
# http body (model)
|
333
|
+
post_body = opts[:body]
|
334
|
+
|
335
|
+
# return_type
|
336
|
+
return_type = opts[:return_type] || 'CompanyExecutive'
|
337
|
+
|
338
|
+
# auth_names
|
339
|
+
auth_names = opts[:auth_names] || ['api_key']
|
340
|
+
|
341
|
+
new_options = opts.merge(
|
342
|
+
:header_params => header_params,
|
343
|
+
:query_params => query_params,
|
344
|
+
:form_params => form_params,
|
345
|
+
:body => post_body,
|
346
|
+
:auth_names => auth_names,
|
347
|
+
:return_type => return_type
|
348
|
+
)
|
349
|
+
|
350
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
351
|
+
if @api_client.config.debugging
|
352
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_executive\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
353
|
+
end
|
354
|
+
return data, status_code, headers
|
355
|
+
end
|
356
|
+
|
357
|
+
# Company News
|
358
|
+
# List latest company news by symbol. This endpoint is only available for North American companies.
|
359
|
+
# @param symbol [String] Company symbol.
|
360
|
+
# @param from [Date] From date <code>YYYY-MM-DD</code>.
|
361
|
+
# @param to [Date] To date <code>YYYY-MM-DD</code>.
|
362
|
+
# @param [Hash] opts the optional parameters
|
363
|
+
# @return [Array<News>]
|
364
|
+
def company_news(symbol, from, to, opts = {})
|
365
|
+
data, _status_code, _headers = company_news_with_http_info(symbol, from, to, opts)
|
366
|
+
data
|
367
|
+
end
|
368
|
+
|
369
|
+
# Company News
|
370
|
+
# List latest company news by symbol. This endpoint is only available for North American companies.
|
371
|
+
# @param symbol [String] Company symbol.
|
372
|
+
# @param from [Date] From date <code>YYYY-MM-DD</code>.
|
373
|
+
# @param to [Date] To date <code>YYYY-MM-DD</code>.
|
374
|
+
# @param [Hash] opts the optional parameters
|
375
|
+
# @return [Array<(Array<News>, Integer, Hash)>] Array<News> data, response status code and response headers
|
376
|
+
def company_news_with_http_info(symbol, from, to, opts = {})
|
377
|
+
if @api_client.config.debugging
|
378
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_news ...'
|
379
|
+
end
|
380
|
+
# verify the required parameter 'symbol' is set
|
381
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
382
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_news"
|
383
|
+
end
|
384
|
+
# verify the required parameter 'from' is set
|
385
|
+
if @api_client.config.client_side_validation && from.nil?
|
386
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.company_news"
|
387
|
+
end
|
388
|
+
# verify the required parameter 'to' is set
|
389
|
+
if @api_client.config.client_side_validation && to.nil?
|
390
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.company_news"
|
391
|
+
end
|
392
|
+
# resource path
|
393
|
+
local_var_path = '/company-news'
|
394
|
+
|
395
|
+
# query parameters
|
396
|
+
query_params = opts[:query_params] || {}
|
397
|
+
query_params[:'symbol'] = symbol
|
398
|
+
query_params[:'from'] = from
|
399
|
+
query_params[:'to'] = to
|
400
|
+
|
401
|
+
# header parameters
|
402
|
+
header_params = opts[:header_params] || {}
|
403
|
+
# HTTP header 'Accept' (if needed)
|
404
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
405
|
+
|
406
|
+
# form parameters
|
407
|
+
form_params = opts[:form_params] || {}
|
408
|
+
|
409
|
+
# http body (model)
|
410
|
+
post_body = opts[:body]
|
411
|
+
|
412
|
+
# return_type
|
413
|
+
return_type = opts[:return_type] || 'Array<News>'
|
414
|
+
|
415
|
+
# auth_names
|
416
|
+
auth_names = opts[:auth_names] || ['api_key']
|
417
|
+
|
418
|
+
new_options = opts.merge(
|
419
|
+
:header_params => header_params,
|
420
|
+
:query_params => query_params,
|
421
|
+
:form_params => form_params,
|
422
|
+
:body => post_body,
|
423
|
+
:auth_names => auth_names,
|
424
|
+
:return_type => return_type
|
425
|
+
)
|
426
|
+
|
427
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
428
|
+
if @api_client.config.debugging
|
429
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
430
|
+
end
|
431
|
+
return data, status_code, headers
|
432
|
+
end
|
433
|
+
|
434
|
+
# Peers
|
435
|
+
# Get company peers. Return a list of peers in the same country and GICS sub-industry
|
436
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
437
|
+
# @param [Hash] opts the optional parameters
|
438
|
+
# @return [Array<String>]
|
439
|
+
def company_peers(symbol, opts = {})
|
440
|
+
data, _status_code, _headers = company_peers_with_http_info(symbol, opts)
|
441
|
+
data
|
442
|
+
end
|
443
|
+
|
444
|
+
# Peers
|
445
|
+
# Get company peers. Return a list of peers in the same country and GICS sub-industry
|
446
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
447
|
+
# @param [Hash] opts the optional parameters
|
448
|
+
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
449
|
+
def company_peers_with_http_info(symbol, opts = {})
|
450
|
+
if @api_client.config.debugging
|
451
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_peers ...'
|
452
|
+
end
|
453
|
+
# verify the required parameter 'symbol' is set
|
454
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
455
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_peers"
|
456
|
+
end
|
457
|
+
# resource path
|
458
|
+
local_var_path = '/stock/peers'
|
459
|
+
|
460
|
+
# query parameters
|
461
|
+
query_params = opts[:query_params] || {}
|
462
|
+
query_params[:'symbol'] = symbol
|
463
|
+
|
464
|
+
# header parameters
|
465
|
+
header_params = opts[:header_params] || {}
|
466
|
+
# HTTP header 'Accept' (if needed)
|
467
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
468
|
+
|
469
|
+
# form parameters
|
470
|
+
form_params = opts[:form_params] || {}
|
471
|
+
|
472
|
+
# http body (model)
|
473
|
+
post_body = opts[:body]
|
474
|
+
|
475
|
+
# return_type
|
476
|
+
return_type = opts[:return_type] || 'Array<String>'
|
477
|
+
|
478
|
+
# auth_names
|
479
|
+
auth_names = opts[:auth_names] || ['api_key']
|
480
|
+
|
481
|
+
new_options = opts.merge(
|
482
|
+
:header_params => header_params,
|
483
|
+
:query_params => query_params,
|
484
|
+
:form_params => form_params,
|
485
|
+
:body => post_body,
|
486
|
+
:auth_names => auth_names,
|
487
|
+
:return_type => return_type
|
488
|
+
)
|
489
|
+
|
490
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
491
|
+
if @api_client.config.debugging
|
492
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_peers\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
493
|
+
end
|
494
|
+
return data, status_code, headers
|
495
|
+
end
|
496
|
+
|
497
|
+
# Company Profile
|
498
|
+
# Get general information of a company. You can query by symbol, ISIN or CUSIP
|
499
|
+
# @param [Hash] opts the optional parameters
|
500
|
+
# @option opts [String] :symbol Symbol of the company: AAPL e.g.
|
501
|
+
# @option opts [String] :isin ISIN
|
502
|
+
# @option opts [String] :cusip CUSIP
|
503
|
+
# @return [CompanyProfile]
|
504
|
+
def company_profile(opts = {})
|
505
|
+
data, _status_code, _headers = company_profile_with_http_info(opts)
|
506
|
+
data
|
507
|
+
end
|
508
|
+
|
509
|
+
# Company Profile
|
510
|
+
# Get general information of a company. You can query by symbol, ISIN or CUSIP
|
511
|
+
# @param [Hash] opts the optional parameters
|
512
|
+
# @option opts [String] :symbol Symbol of the company: AAPL e.g.
|
513
|
+
# @option opts [String] :isin ISIN
|
514
|
+
# @option opts [String] :cusip CUSIP
|
515
|
+
# @return [Array<(CompanyProfile, Integer, Hash)>] CompanyProfile data, response status code and response headers
|
516
|
+
def company_profile_with_http_info(opts = {})
|
517
|
+
if @api_client.config.debugging
|
518
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_profile ...'
|
519
|
+
end
|
520
|
+
# resource path
|
521
|
+
local_var_path = '/stock/profile'
|
522
|
+
|
523
|
+
# query parameters
|
524
|
+
query_params = opts[:query_params] || {}
|
525
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
526
|
+
query_params[:'isin'] = opts[:'isin'] if !opts[:'isin'].nil?
|
527
|
+
query_params[:'cusip'] = opts[:'cusip'] if !opts[:'cusip'].nil?
|
528
|
+
|
529
|
+
# header parameters
|
530
|
+
header_params = opts[:header_params] || {}
|
531
|
+
# HTTP header 'Accept' (if needed)
|
532
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
533
|
+
|
534
|
+
# form parameters
|
535
|
+
form_params = opts[:form_params] || {}
|
536
|
+
|
537
|
+
# http body (model)
|
538
|
+
post_body = opts[:body]
|
539
|
+
|
540
|
+
# return_type
|
541
|
+
return_type = opts[:return_type] || 'CompanyProfile'
|
542
|
+
|
543
|
+
# auth_names
|
544
|
+
auth_names = opts[:auth_names] || ['api_key']
|
545
|
+
|
546
|
+
new_options = opts.merge(
|
547
|
+
:header_params => header_params,
|
548
|
+
:query_params => query_params,
|
549
|
+
:form_params => form_params,
|
550
|
+
:body => post_body,
|
551
|
+
:auth_names => auth_names,
|
552
|
+
:return_type => return_type
|
553
|
+
)
|
554
|
+
|
555
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
556
|
+
if @api_client.config.debugging
|
557
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_profile\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
558
|
+
end
|
559
|
+
return data, status_code, headers
|
560
|
+
end
|
561
|
+
|
562
|
+
# Company Profile 2
|
563
|
+
# Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of <a href=\"#company-profile\">Company Profile</a>.
|
564
|
+
# @param [Hash] opts the optional parameters
|
565
|
+
# @option opts [String] :symbol Symbol of the company: AAPL e.g.
|
566
|
+
# @option opts [String] :isin ISIN
|
567
|
+
# @option opts [String] :cusip CUSIP
|
568
|
+
# @return [CompanyProfile2]
|
569
|
+
def company_profile2(opts = {})
|
570
|
+
data, _status_code, _headers = company_profile2_with_http_info(opts)
|
571
|
+
data
|
572
|
+
end
|
573
|
+
|
574
|
+
# Company Profile 2
|
575
|
+
# Get general information of a company. You can query by symbol, ISIN or CUSIP. This is the free version of <a href=\"#company-profile\">Company Profile</a>.
|
576
|
+
# @param [Hash] opts the optional parameters
|
577
|
+
# @option opts [String] :symbol Symbol of the company: AAPL e.g.
|
578
|
+
# @option opts [String] :isin ISIN
|
579
|
+
# @option opts [String] :cusip CUSIP
|
580
|
+
# @return [Array<(CompanyProfile2, Integer, Hash)>] CompanyProfile2 data, response status code and response headers
|
581
|
+
def company_profile2_with_http_info(opts = {})
|
582
|
+
if @api_client.config.debugging
|
583
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_profile2 ...'
|
584
|
+
end
|
585
|
+
# resource path
|
586
|
+
local_var_path = '/stock/profile2'
|
587
|
+
|
588
|
+
# query parameters
|
589
|
+
query_params = opts[:query_params] || {}
|
590
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
591
|
+
query_params[:'isin'] = opts[:'isin'] if !opts[:'isin'].nil?
|
592
|
+
query_params[:'cusip'] = opts[:'cusip'] if !opts[:'cusip'].nil?
|
593
|
+
|
594
|
+
# header parameters
|
595
|
+
header_params = opts[:header_params] || {}
|
596
|
+
# HTTP header 'Accept' (if needed)
|
597
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
598
|
+
|
599
|
+
# form parameters
|
600
|
+
form_params = opts[:form_params] || {}
|
601
|
+
|
602
|
+
# http body (model)
|
603
|
+
post_body = opts[:body]
|
604
|
+
|
605
|
+
# return_type
|
606
|
+
return_type = opts[:return_type] || 'CompanyProfile2'
|
607
|
+
|
608
|
+
# auth_names
|
609
|
+
auth_names = opts[:auth_names] || ['api_key']
|
610
|
+
|
611
|
+
new_options = opts.merge(
|
612
|
+
:header_params => header_params,
|
613
|
+
:query_params => query_params,
|
614
|
+
:form_params => form_params,
|
615
|
+
:body => post_body,
|
616
|
+
:auth_names => auth_names,
|
617
|
+
:return_type => return_type
|
618
|
+
)
|
619
|
+
|
620
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
621
|
+
if @api_client.config.debugging
|
622
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_profile2\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
623
|
+
end
|
624
|
+
return data, status_code, headers
|
625
|
+
end
|
626
|
+
|
627
|
+
# Revenue Estimates
|
628
|
+
# Get company's revenue estimates.
|
629
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
630
|
+
# @param [Hash] opts the optional parameters
|
631
|
+
# @option opts [String] :freq Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
|
632
|
+
# @return [RevenueEstimates]
|
633
|
+
def company_revenue_estimates(symbol, opts = {})
|
634
|
+
data, _status_code, _headers = company_revenue_estimates_with_http_info(symbol, opts)
|
635
|
+
data
|
636
|
+
end
|
637
|
+
|
638
|
+
# Revenue Estimates
|
639
|
+
# Get company's revenue estimates.
|
640
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
641
|
+
# @param [Hash] opts the optional parameters
|
642
|
+
# @option opts [String] :freq Can take 1 of the following values: <code>annual, quarterly</code>. Default to <code>quarterly</code>
|
643
|
+
# @return [Array<(RevenueEstimates, Integer, Hash)>] RevenueEstimates data, response status code and response headers
|
644
|
+
def company_revenue_estimates_with_http_info(symbol, opts = {})
|
645
|
+
if @api_client.config.debugging
|
646
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.company_revenue_estimates ...'
|
647
|
+
end
|
648
|
+
# verify the required parameter 'symbol' is set
|
649
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
650
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.company_revenue_estimates"
|
651
|
+
end
|
652
|
+
# resource path
|
653
|
+
local_var_path = '/stock/revenue-estimate'
|
654
|
+
|
655
|
+
# query parameters
|
656
|
+
query_params = opts[:query_params] || {}
|
657
|
+
query_params[:'symbol'] = symbol
|
658
|
+
query_params[:'freq'] = opts[:'freq'] if !opts[:'freq'].nil?
|
659
|
+
|
660
|
+
# header parameters
|
661
|
+
header_params = opts[:header_params] || {}
|
662
|
+
# HTTP header 'Accept' (if needed)
|
663
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
664
|
+
|
665
|
+
# form parameters
|
666
|
+
form_params = opts[:form_params] || {}
|
667
|
+
|
668
|
+
# http body (model)
|
669
|
+
post_body = opts[:body]
|
670
|
+
|
671
|
+
# return_type
|
672
|
+
return_type = opts[:return_type] || 'RevenueEstimates'
|
673
|
+
|
674
|
+
# auth_names
|
675
|
+
auth_names = opts[:auth_names] || ['api_key']
|
676
|
+
|
677
|
+
new_options = opts.merge(
|
678
|
+
:header_params => header_params,
|
679
|
+
:query_params => query_params,
|
680
|
+
:form_params => form_params,
|
681
|
+
:body => post_body,
|
682
|
+
:auth_names => auth_names,
|
683
|
+
:return_type => return_type
|
684
|
+
)
|
685
|
+
|
686
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
687
|
+
if @api_client.config.debugging
|
688
|
+
@api_client.config.logger.debug "API called: DefaultApi#company_revenue_estimates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
689
|
+
end
|
690
|
+
return data, status_code, headers
|
691
|
+
end
|
692
|
+
|
693
|
+
# Country Metadata
|
694
|
+
# List all countries and metadata.
|
695
|
+
# @param [Hash] opts the optional parameters
|
696
|
+
# @return [Array<CountryMetadata>]
|
697
|
+
def country(opts = {})
|
698
|
+
data, _status_code, _headers = country_with_http_info(opts)
|
699
|
+
data
|
700
|
+
end
|
701
|
+
|
702
|
+
# Country Metadata
|
703
|
+
# List all countries and metadata.
|
704
|
+
# @param [Hash] opts the optional parameters
|
705
|
+
# @return [Array<(Array<CountryMetadata>, Integer, Hash)>] Array<CountryMetadata> data, response status code and response headers
|
706
|
+
def country_with_http_info(opts = {})
|
707
|
+
if @api_client.config.debugging
|
708
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.country ...'
|
709
|
+
end
|
710
|
+
# resource path
|
711
|
+
local_var_path = '/country'
|
712
|
+
|
713
|
+
# query parameters
|
714
|
+
query_params = opts[:query_params] || {}
|
715
|
+
|
716
|
+
# header parameters
|
717
|
+
header_params = opts[:header_params] || {}
|
718
|
+
# HTTP header 'Accept' (if needed)
|
719
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
720
|
+
|
721
|
+
# form parameters
|
722
|
+
form_params = opts[:form_params] || {}
|
723
|
+
|
724
|
+
# http body (model)
|
725
|
+
post_body = opts[:body]
|
726
|
+
|
727
|
+
# return_type
|
728
|
+
return_type = opts[:return_type] || 'Array<CountryMetadata>'
|
729
|
+
|
730
|
+
# auth_names
|
731
|
+
auth_names = opts[:auth_names] || ['api_key']
|
732
|
+
|
733
|
+
new_options = opts.merge(
|
734
|
+
:header_params => header_params,
|
735
|
+
:query_params => query_params,
|
736
|
+
:form_params => form_params,
|
737
|
+
:body => post_body,
|
738
|
+
:auth_names => auth_names,
|
739
|
+
:return_type => return_type
|
740
|
+
)
|
741
|
+
|
742
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
743
|
+
if @api_client.config.debugging
|
744
|
+
@api_client.config.logger.debug "API called: DefaultApi#country\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
745
|
+
end
|
746
|
+
return data, status_code, headers
|
747
|
+
end
|
748
|
+
|
749
|
+
# COVID-19
|
750
|
+
# Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API <a href=\"https://rapidapi.com/Finnhub/api/finnhub-real-time-covid-19\" target=\"_blank\" rel=\"nofollow\">here</a>
|
751
|
+
# @param [Hash] opts the optional parameters
|
752
|
+
# @return [Array<CovidInfo>]
|
753
|
+
def covid19(opts = {})
|
754
|
+
data, _status_code, _headers = covid19_with_http_info(opts)
|
755
|
+
data
|
756
|
+
end
|
757
|
+
|
758
|
+
# COVID-19
|
759
|
+
# Get real-time updates on the number of COVID-19 (Corona virus) cases in the US with a state-by-state breakdown. Data is sourced from CDC and reputable sources. You can also access this API <a href=\"https://rapidapi.com/Finnhub/api/finnhub-real-time-covid-19\" target=\"_blank\" rel=\"nofollow\">here</a>
|
760
|
+
# @param [Hash] opts the optional parameters
|
761
|
+
# @return [Array<(Array<CovidInfo>, Integer, Hash)>] Array<CovidInfo> data, response status code and response headers
|
762
|
+
def covid19_with_http_info(opts = {})
|
763
|
+
if @api_client.config.debugging
|
764
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.covid19 ...'
|
765
|
+
end
|
766
|
+
# resource path
|
767
|
+
local_var_path = '/covid19/us'
|
768
|
+
|
769
|
+
# query parameters
|
770
|
+
query_params = opts[:query_params] || {}
|
771
|
+
|
772
|
+
# header parameters
|
773
|
+
header_params = opts[:header_params] || {}
|
774
|
+
# HTTP header 'Accept' (if needed)
|
775
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
776
|
+
|
777
|
+
# form parameters
|
778
|
+
form_params = opts[:form_params] || {}
|
779
|
+
|
780
|
+
# http body (model)
|
781
|
+
post_body = opts[:body]
|
782
|
+
|
783
|
+
# return_type
|
784
|
+
return_type = opts[:return_type] || 'Array<CovidInfo>'
|
785
|
+
|
786
|
+
# auth_names
|
787
|
+
auth_names = opts[:auth_names] || ['api_key']
|
788
|
+
|
789
|
+
new_options = opts.merge(
|
790
|
+
:header_params => header_params,
|
791
|
+
:query_params => query_params,
|
792
|
+
:form_params => form_params,
|
793
|
+
:body => post_body,
|
794
|
+
:auth_names => auth_names,
|
795
|
+
:return_type => return_type
|
796
|
+
)
|
797
|
+
|
798
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
799
|
+
if @api_client.config.debugging
|
800
|
+
@api_client.config.logger.debug "API called: DefaultApi#covid19\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
801
|
+
end
|
802
|
+
return data, status_code, headers
|
803
|
+
end
|
804
|
+
|
805
|
+
# Crypto Candles
|
806
|
+
# Get candlestick data for crypto symbols.
|
807
|
+
# @param symbol [String] Use symbol returned in <code>/crypto/symbol</code> endpoint for this field.
|
808
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
809
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
810
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
811
|
+
# @param [Hash] opts the optional parameters
|
812
|
+
# @return [CryptoCandles]
|
813
|
+
def crypto_candles(symbol, resolution, from, to, opts = {})
|
814
|
+
data, _status_code, _headers = crypto_candles_with_http_info(symbol, resolution, from, to, opts)
|
815
|
+
data
|
816
|
+
end
|
817
|
+
|
818
|
+
# Crypto Candles
|
819
|
+
# Get candlestick data for crypto symbols.
|
820
|
+
# @param symbol [String] Use symbol returned in <code>/crypto/symbol</code> endpoint for this field.
|
821
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
822
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
823
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
824
|
+
# @param [Hash] opts the optional parameters
|
825
|
+
# @return [Array<(CryptoCandles, Integer, Hash)>] CryptoCandles data, response status code and response headers
|
826
|
+
def crypto_candles_with_http_info(symbol, resolution, from, to, opts = {})
|
827
|
+
if @api_client.config.debugging
|
828
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.crypto_candles ...'
|
829
|
+
end
|
830
|
+
# verify the required parameter 'symbol' is set
|
831
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
832
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.crypto_candles"
|
833
|
+
end
|
834
|
+
# verify the required parameter 'resolution' is set
|
835
|
+
if @api_client.config.client_side_validation && resolution.nil?
|
836
|
+
fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.crypto_candles"
|
837
|
+
end
|
838
|
+
# verify the required parameter 'from' is set
|
839
|
+
if @api_client.config.client_side_validation && from.nil?
|
840
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.crypto_candles"
|
841
|
+
end
|
842
|
+
# verify the required parameter 'to' is set
|
843
|
+
if @api_client.config.client_side_validation && to.nil?
|
844
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.crypto_candles"
|
845
|
+
end
|
846
|
+
# resource path
|
847
|
+
local_var_path = '/crypto/candle'
|
848
|
+
|
849
|
+
# query parameters
|
850
|
+
query_params = opts[:query_params] || {}
|
851
|
+
query_params[:'symbol'] = symbol
|
852
|
+
query_params[:'resolution'] = resolution
|
853
|
+
query_params[:'from'] = from
|
854
|
+
query_params[:'to'] = to
|
855
|
+
|
856
|
+
# header parameters
|
857
|
+
header_params = opts[:header_params] || {}
|
858
|
+
# HTTP header 'Accept' (if needed)
|
859
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
860
|
+
|
861
|
+
# form parameters
|
862
|
+
form_params = opts[:form_params] || {}
|
863
|
+
|
864
|
+
# http body (model)
|
865
|
+
post_body = opts[:body]
|
866
|
+
|
867
|
+
# return_type
|
868
|
+
return_type = opts[:return_type] || 'CryptoCandles'
|
869
|
+
|
870
|
+
# auth_names
|
871
|
+
auth_names = opts[:auth_names] || ['api_key']
|
872
|
+
|
873
|
+
new_options = opts.merge(
|
874
|
+
:header_params => header_params,
|
875
|
+
:query_params => query_params,
|
876
|
+
:form_params => form_params,
|
877
|
+
:body => post_body,
|
878
|
+
:auth_names => auth_names,
|
879
|
+
:return_type => return_type
|
880
|
+
)
|
881
|
+
|
882
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
883
|
+
if @api_client.config.debugging
|
884
|
+
@api_client.config.logger.debug "API called: DefaultApi#crypto_candles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
885
|
+
end
|
886
|
+
return data, status_code, headers
|
887
|
+
end
|
888
|
+
|
889
|
+
# Crypto Exchanges
|
890
|
+
# List supported crypto exchanges
|
891
|
+
# @param [Hash] opts the optional parameters
|
892
|
+
# @return [Array<String>]
|
893
|
+
def crypto_exchanges(opts = {})
|
894
|
+
data, _status_code, _headers = crypto_exchanges_with_http_info(opts)
|
895
|
+
data
|
896
|
+
end
|
897
|
+
|
898
|
+
# Crypto Exchanges
|
899
|
+
# List supported crypto exchanges
|
900
|
+
# @param [Hash] opts the optional parameters
|
901
|
+
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
902
|
+
def crypto_exchanges_with_http_info(opts = {})
|
903
|
+
if @api_client.config.debugging
|
904
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.crypto_exchanges ...'
|
905
|
+
end
|
906
|
+
# resource path
|
907
|
+
local_var_path = '/crypto/exchange'
|
908
|
+
|
909
|
+
# query parameters
|
910
|
+
query_params = opts[:query_params] || {}
|
911
|
+
|
912
|
+
# header parameters
|
913
|
+
header_params = opts[:header_params] || {}
|
914
|
+
# HTTP header 'Accept' (if needed)
|
915
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
916
|
+
|
917
|
+
# form parameters
|
918
|
+
form_params = opts[:form_params] || {}
|
919
|
+
|
920
|
+
# http body (model)
|
921
|
+
post_body = opts[:body]
|
922
|
+
|
923
|
+
# return_type
|
924
|
+
return_type = opts[:return_type] || 'Array<String>'
|
925
|
+
|
926
|
+
# auth_names
|
927
|
+
auth_names = opts[:auth_names] || ['api_key']
|
928
|
+
|
929
|
+
new_options = opts.merge(
|
930
|
+
:header_params => header_params,
|
931
|
+
:query_params => query_params,
|
932
|
+
:form_params => form_params,
|
933
|
+
:body => post_body,
|
934
|
+
:auth_names => auth_names,
|
935
|
+
:return_type => return_type
|
936
|
+
)
|
937
|
+
|
938
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
939
|
+
if @api_client.config.debugging
|
940
|
+
@api_client.config.logger.debug "API called: DefaultApi#crypto_exchanges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
941
|
+
end
|
942
|
+
return data, status_code, headers
|
943
|
+
end
|
944
|
+
|
945
|
+
# Crypto Symbol
|
946
|
+
# List supported crypto symbols by exchange
|
947
|
+
# @param exchange [String] Exchange you want to get the list of symbols from.
|
948
|
+
# @param [Hash] opts the optional parameters
|
949
|
+
# @return [Array<CryptoSymbol>]
|
950
|
+
def crypto_symbols(exchange, opts = {})
|
951
|
+
data, _status_code, _headers = crypto_symbols_with_http_info(exchange, opts)
|
952
|
+
data
|
953
|
+
end
|
954
|
+
|
955
|
+
# Crypto Symbol
|
956
|
+
# List supported crypto symbols by exchange
|
957
|
+
# @param exchange [String] Exchange you want to get the list of symbols from.
|
958
|
+
# @param [Hash] opts the optional parameters
|
959
|
+
# @return [Array<(Array<CryptoSymbol>, Integer, Hash)>] Array<CryptoSymbol> data, response status code and response headers
|
960
|
+
def crypto_symbols_with_http_info(exchange, opts = {})
|
961
|
+
if @api_client.config.debugging
|
962
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.crypto_symbols ...'
|
963
|
+
end
|
964
|
+
# verify the required parameter 'exchange' is set
|
965
|
+
if @api_client.config.client_side_validation && exchange.nil?
|
966
|
+
fail ArgumentError, "Missing the required parameter 'exchange' when calling DefaultApi.crypto_symbols"
|
967
|
+
end
|
968
|
+
# resource path
|
969
|
+
local_var_path = '/crypto/symbol'
|
970
|
+
|
971
|
+
# query parameters
|
972
|
+
query_params = opts[:query_params] || {}
|
973
|
+
query_params[:'exchange'] = exchange
|
974
|
+
|
975
|
+
# header parameters
|
976
|
+
header_params = opts[:header_params] || {}
|
977
|
+
# HTTP header 'Accept' (if needed)
|
978
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
979
|
+
|
980
|
+
# form parameters
|
981
|
+
form_params = opts[:form_params] || {}
|
982
|
+
|
983
|
+
# http body (model)
|
984
|
+
post_body = opts[:body]
|
985
|
+
|
986
|
+
# return_type
|
987
|
+
return_type = opts[:return_type] || 'Array<CryptoSymbol>'
|
988
|
+
|
989
|
+
# auth_names
|
990
|
+
auth_names = opts[:auth_names] || ['api_key']
|
991
|
+
|
992
|
+
new_options = opts.merge(
|
993
|
+
:header_params => header_params,
|
994
|
+
:query_params => query_params,
|
995
|
+
:form_params => form_params,
|
996
|
+
:body => post_body,
|
997
|
+
:auth_names => auth_names,
|
998
|
+
:return_type => return_type
|
999
|
+
)
|
1000
|
+
|
1001
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1002
|
+
if @api_client.config.debugging
|
1003
|
+
@api_client.config.logger.debug "API called: DefaultApi#crypto_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1004
|
+
end
|
1005
|
+
return data, status_code, headers
|
1006
|
+
end
|
1007
|
+
|
1008
|
+
# Earnings Calendar
|
1009
|
+
# Get historical and coming earnings release dating back to 2003. You can setup <a href=\"#webhook\">webhook</a> to receive real-time earnings update.
|
1010
|
+
# @param [Hash] opts the optional parameters
|
1011
|
+
# @option opts [Date] :from From date: 2020-03-15.
|
1012
|
+
# @option opts [Date] :to To date: 2020-03-16.
|
1013
|
+
# @option opts [String] :symbol Filter by symbol: AAPL.
|
1014
|
+
# @option opts [AnyType] :international Set to <code>true</code> to include international markets. Default value is <code>false</code>
|
1015
|
+
# @return [EarningsCalendar]
|
1016
|
+
def earnings_calendar(opts = {})
|
1017
|
+
data, _status_code, _headers = earnings_calendar_with_http_info(opts)
|
1018
|
+
data
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
# Earnings Calendar
|
1022
|
+
# Get historical and coming earnings release dating back to 2003. You can setup <a href=\"#webhook\">webhook</a> to receive real-time earnings update.
|
1023
|
+
# @param [Hash] opts the optional parameters
|
1024
|
+
# @option opts [Date] :from From date: 2020-03-15.
|
1025
|
+
# @option opts [Date] :to To date: 2020-03-16.
|
1026
|
+
# @option opts [String] :symbol Filter by symbol: AAPL.
|
1027
|
+
# @option opts [AnyType] :international Set to <code>true</code> to include international markets. Default value is <code>false</code>
|
1028
|
+
# @return [Array<(EarningsCalendar, Integer, Hash)>] EarningsCalendar data, response status code and response headers
|
1029
|
+
def earnings_calendar_with_http_info(opts = {})
|
1030
|
+
if @api_client.config.debugging
|
1031
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.earnings_calendar ...'
|
1032
|
+
end
|
1033
|
+
# resource path
|
1034
|
+
local_var_path = '/calendar/earnings'
|
1035
|
+
|
1036
|
+
# query parameters
|
1037
|
+
query_params = opts[:query_params] || {}
|
1038
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
1039
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
1040
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
1041
|
+
query_params[:'international'] = opts[:'international'] if !opts[:'international'].nil?
|
1042
|
+
|
1043
|
+
# header parameters
|
1044
|
+
header_params = opts[:header_params] || {}
|
1045
|
+
# HTTP header 'Accept' (if needed)
|
1046
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1047
|
+
|
1048
|
+
# form parameters
|
1049
|
+
form_params = opts[:form_params] || {}
|
1050
|
+
|
1051
|
+
# http body (model)
|
1052
|
+
post_body = opts[:body]
|
1053
|
+
|
1054
|
+
# return_type
|
1055
|
+
return_type = opts[:return_type] || 'EarningsCalendar'
|
1056
|
+
|
1057
|
+
# auth_names
|
1058
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1059
|
+
|
1060
|
+
new_options = opts.merge(
|
1061
|
+
:header_params => header_params,
|
1062
|
+
:query_params => query_params,
|
1063
|
+
:form_params => form_params,
|
1064
|
+
:body => post_body,
|
1065
|
+
:auth_names => auth_names,
|
1066
|
+
:return_type => return_type
|
1067
|
+
)
|
1068
|
+
|
1069
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1070
|
+
if @api_client.config.debugging
|
1071
|
+
@api_client.config.logger.debug "API called: DefaultApi#earnings_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1072
|
+
end
|
1073
|
+
return data, status_code, headers
|
1074
|
+
end
|
1075
|
+
|
1076
|
+
# Economic Code
|
1077
|
+
# List codes of supported economic data.
|
1078
|
+
# @param [Hash] opts the optional parameters
|
1079
|
+
# @return [Array<EconomicCode>]
|
1080
|
+
def economic_code(opts = {})
|
1081
|
+
data, _status_code, _headers = economic_code_with_http_info(opts)
|
1082
|
+
data
|
1083
|
+
end
|
1084
|
+
|
1085
|
+
# Economic Code
|
1086
|
+
# List codes of supported economic data.
|
1087
|
+
# @param [Hash] opts the optional parameters
|
1088
|
+
# @return [Array<(Array<EconomicCode>, Integer, Hash)>] Array<EconomicCode> data, response status code and response headers
|
1089
|
+
def economic_code_with_http_info(opts = {})
|
1090
|
+
if @api_client.config.debugging
|
1091
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.economic_code ...'
|
1092
|
+
end
|
1093
|
+
# resource path
|
1094
|
+
local_var_path = '/economic/code'
|
1095
|
+
|
1096
|
+
# query parameters
|
1097
|
+
query_params = opts[:query_params] || {}
|
1098
|
+
|
1099
|
+
# header parameters
|
1100
|
+
header_params = opts[:header_params] || {}
|
1101
|
+
# HTTP header 'Accept' (if needed)
|
1102
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1103
|
+
|
1104
|
+
# form parameters
|
1105
|
+
form_params = opts[:form_params] || {}
|
1106
|
+
|
1107
|
+
# http body (model)
|
1108
|
+
post_body = opts[:body]
|
1109
|
+
|
1110
|
+
# return_type
|
1111
|
+
return_type = opts[:return_type] || 'Array<EconomicCode>'
|
1112
|
+
|
1113
|
+
# auth_names
|
1114
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1115
|
+
|
1116
|
+
new_options = opts.merge(
|
1117
|
+
:header_params => header_params,
|
1118
|
+
:query_params => query_params,
|
1119
|
+
:form_params => form_params,
|
1120
|
+
:body => post_body,
|
1121
|
+
:auth_names => auth_names,
|
1122
|
+
:return_type => return_type
|
1123
|
+
)
|
1124
|
+
|
1125
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1126
|
+
if @api_client.config.debugging
|
1127
|
+
@api_client.config.logger.debug "API called: DefaultApi#economic_code\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1128
|
+
end
|
1129
|
+
return data, status_code, headers
|
1130
|
+
end
|
1131
|
+
|
1132
|
+
# Economic Data
|
1133
|
+
# Get economic data.
|
1134
|
+
# @param code [String] Economic code.
|
1135
|
+
# @param [Hash] opts the optional parameters
|
1136
|
+
# @return [EconomicData]
|
1137
|
+
def economic_data(code, opts = {})
|
1138
|
+
data, _status_code, _headers = economic_data_with_http_info(code, opts)
|
1139
|
+
data
|
1140
|
+
end
|
1141
|
+
|
1142
|
+
# Economic Data
|
1143
|
+
# Get economic data.
|
1144
|
+
# @param code [String] Economic code.
|
1145
|
+
# @param [Hash] opts the optional parameters
|
1146
|
+
# @return [Array<(EconomicData, Integer, Hash)>] EconomicData data, response status code and response headers
|
1147
|
+
def economic_data_with_http_info(code, opts = {})
|
1148
|
+
if @api_client.config.debugging
|
1149
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.economic_data ...'
|
1150
|
+
end
|
1151
|
+
# verify the required parameter 'code' is set
|
1152
|
+
if @api_client.config.client_side_validation && code.nil?
|
1153
|
+
fail ArgumentError, "Missing the required parameter 'code' when calling DefaultApi.economic_data"
|
1154
|
+
end
|
1155
|
+
# resource path
|
1156
|
+
local_var_path = '/economic'
|
1157
|
+
|
1158
|
+
# query parameters
|
1159
|
+
query_params = opts[:query_params] || {}
|
1160
|
+
query_params[:'code'] = code
|
1161
|
+
|
1162
|
+
# header parameters
|
1163
|
+
header_params = opts[:header_params] || {}
|
1164
|
+
# HTTP header 'Accept' (if needed)
|
1165
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1166
|
+
|
1167
|
+
# form parameters
|
1168
|
+
form_params = opts[:form_params] || {}
|
1169
|
+
|
1170
|
+
# http body (model)
|
1171
|
+
post_body = opts[:body]
|
1172
|
+
|
1173
|
+
# return_type
|
1174
|
+
return_type = opts[:return_type] || 'EconomicData'
|
1175
|
+
|
1176
|
+
# auth_names
|
1177
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1178
|
+
|
1179
|
+
new_options = opts.merge(
|
1180
|
+
:header_params => header_params,
|
1181
|
+
:query_params => query_params,
|
1182
|
+
:form_params => form_params,
|
1183
|
+
:body => post_body,
|
1184
|
+
:auth_names => auth_names,
|
1185
|
+
:return_type => return_type
|
1186
|
+
)
|
1187
|
+
|
1188
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1189
|
+
if @api_client.config.debugging
|
1190
|
+
@api_client.config.logger.debug "API called: DefaultApi#economic_data\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1191
|
+
end
|
1192
|
+
return data, status_code, headers
|
1193
|
+
end
|
1194
|
+
|
1195
|
+
# Filings
|
1196
|
+
# List company's filing. Limit to 250 documents at a time. This data is available for bulk download on <a href=\"https://www.kaggle.com/finnhub/sec-filings\" target=\"_blank\">Kaggle SEC Filings database</a>.
|
1197
|
+
# @param [Hash] opts the optional parameters
|
1198
|
+
# @option opts [String] :symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings.
|
1199
|
+
# @option opts [String] :cik CIK.
|
1200
|
+
# @option opts [String] :access_number Access number of a specific report you want to retrieve data from.
|
1201
|
+
# @option opts [String] :form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company.
|
1202
|
+
# @option opts [Date] :from From date: 2020-03-15.
|
1203
|
+
# @option opts [Date] :to To date: 2020-03-16.
|
1204
|
+
# @return [Array<Filing>]
|
1205
|
+
def filings(opts = {})
|
1206
|
+
data, _status_code, _headers = filings_with_http_info(opts)
|
1207
|
+
data
|
1208
|
+
end
|
1209
|
+
|
1210
|
+
# Filings
|
1211
|
+
# List company's filing. Limit to 250 documents at a time. This data is available for bulk download on <a href=\"https://www.kaggle.com/finnhub/sec-filings\" target=\"_blank\">Kaggle SEC Filings database</a>.
|
1212
|
+
# @param [Hash] opts the optional parameters
|
1213
|
+
# @option opts [String] :symbol Symbol. Leave <code>symbol</code>,<code>cik</code> and <code>accessNumber</code> empty to list latest filings.
|
1214
|
+
# @option opts [String] :cik CIK.
|
1215
|
+
# @option opts [String] :access_number Access number of a specific report you want to retrieve data from.
|
1216
|
+
# @option opts [String] :form Filter by form. You can use this value <code>NT 10-K</code> to find non-timely filings for a company.
|
1217
|
+
# @option opts [Date] :from From date: 2020-03-15.
|
1218
|
+
# @option opts [Date] :to To date: 2020-03-16.
|
1219
|
+
# @return [Array<(Array<Filing>, Integer, Hash)>] Array<Filing> data, response status code and response headers
|
1220
|
+
def filings_with_http_info(opts = {})
|
1221
|
+
if @api_client.config.debugging
|
1222
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.filings ...'
|
1223
|
+
end
|
1224
|
+
# resource path
|
1225
|
+
local_var_path = '/stock/filings'
|
1226
|
+
|
1227
|
+
# query parameters
|
1228
|
+
query_params = opts[:query_params] || {}
|
1229
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
1230
|
+
query_params[:'cik'] = opts[:'cik'] if !opts[:'cik'].nil?
|
1231
|
+
query_params[:'accessNumber'] = opts[:'access_number'] if !opts[:'access_number'].nil?
|
1232
|
+
query_params[:'form'] = opts[:'form'] if !opts[:'form'].nil?
|
1233
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
1234
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
1235
|
+
|
1236
|
+
# header parameters
|
1237
|
+
header_params = opts[:header_params] || {}
|
1238
|
+
# HTTP header 'Accept' (if needed)
|
1239
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1240
|
+
|
1241
|
+
# form parameters
|
1242
|
+
form_params = opts[:form_params] || {}
|
1243
|
+
|
1244
|
+
# http body (model)
|
1245
|
+
post_body = opts[:body]
|
1246
|
+
|
1247
|
+
# return_type
|
1248
|
+
return_type = opts[:return_type] || 'Array<Filing>'
|
1249
|
+
|
1250
|
+
# auth_names
|
1251
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1252
|
+
|
1253
|
+
new_options = opts.merge(
|
1254
|
+
:header_params => header_params,
|
1255
|
+
:query_params => query_params,
|
1256
|
+
:form_params => form_params,
|
1257
|
+
:body => post_body,
|
1258
|
+
:auth_names => auth_names,
|
1259
|
+
:return_type => return_type
|
1260
|
+
)
|
1261
|
+
|
1262
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1263
|
+
if @api_client.config.debugging
|
1264
|
+
@api_client.config.logger.debug "API called: DefaultApi#filings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1265
|
+
end
|
1266
|
+
return data, status_code, headers
|
1267
|
+
end
|
1268
|
+
|
1269
|
+
# Financial Statements
|
1270
|
+
# Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years.
|
1271
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
1272
|
+
# @param statement [String] Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively.
|
1273
|
+
# @param freq [String] Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow.
|
1274
|
+
# @param [Hash] opts the optional parameters
|
1275
|
+
# @return [FinancialStatements]
|
1276
|
+
def financials(symbol, statement, freq, opts = {})
|
1277
|
+
data, _status_code, _headers = financials_with_http_info(symbol, statement, freq, opts)
|
1278
|
+
data
|
1279
|
+
end
|
1280
|
+
|
1281
|
+
# Financial Statements
|
1282
|
+
# Get standardized balance sheet, income statement and cash flow for global companies going back 30+ years.
|
1283
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
1284
|
+
# @param statement [String] Statement can take 1 of these values <code>bs, ic, cf</code> for Balance Sheet, Income Statement, Cash Flow respectively.
|
1285
|
+
# @param freq [String] Frequency can take 1 of these values <code>annual, quarterly, ttm, ytd</code>. TTM (Trailing Twelve Months) option is available for Income Statement and Cash Flow. YTD (Year To Date) option is only available for Cash Flow.
|
1286
|
+
# @param [Hash] opts the optional parameters
|
1287
|
+
# @return [Array<(FinancialStatements, Integer, Hash)>] FinancialStatements data, response status code and response headers
|
1288
|
+
def financials_with_http_info(symbol, statement, freq, opts = {})
|
1289
|
+
if @api_client.config.debugging
|
1290
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.financials ...'
|
1291
|
+
end
|
1292
|
+
# verify the required parameter 'symbol' is set
|
1293
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
1294
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.financials"
|
1295
|
+
end
|
1296
|
+
# verify the required parameter 'statement' is set
|
1297
|
+
if @api_client.config.client_side_validation && statement.nil?
|
1298
|
+
fail ArgumentError, "Missing the required parameter 'statement' when calling DefaultApi.financials"
|
1299
|
+
end
|
1300
|
+
# verify the required parameter 'freq' is set
|
1301
|
+
if @api_client.config.client_side_validation && freq.nil?
|
1302
|
+
fail ArgumentError, "Missing the required parameter 'freq' when calling DefaultApi.financials"
|
1303
|
+
end
|
1304
|
+
# resource path
|
1305
|
+
local_var_path = '/stock/financials'
|
1306
|
+
|
1307
|
+
# query parameters
|
1308
|
+
query_params = opts[:query_params] || {}
|
1309
|
+
query_params[:'symbol'] = symbol
|
1310
|
+
query_params[:'statement'] = statement
|
1311
|
+
query_params[:'freq'] = freq
|
1312
|
+
|
1313
|
+
# header parameters
|
1314
|
+
header_params = opts[:header_params] || {}
|
1315
|
+
# HTTP header 'Accept' (if needed)
|
1316
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1317
|
+
|
1318
|
+
# form parameters
|
1319
|
+
form_params = opts[:form_params] || {}
|
1320
|
+
|
1321
|
+
# http body (model)
|
1322
|
+
post_body = opts[:body]
|
1323
|
+
|
1324
|
+
# return_type
|
1325
|
+
return_type = opts[:return_type] || 'FinancialStatements'
|
1326
|
+
|
1327
|
+
# auth_names
|
1328
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1329
|
+
|
1330
|
+
new_options = opts.merge(
|
1331
|
+
:header_params => header_params,
|
1332
|
+
:query_params => query_params,
|
1333
|
+
:form_params => form_params,
|
1334
|
+
:body => post_body,
|
1335
|
+
:auth_names => auth_names,
|
1336
|
+
:return_type => return_type
|
1337
|
+
)
|
1338
|
+
|
1339
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1340
|
+
if @api_client.config.debugging
|
1341
|
+
@api_client.config.logger.debug "API called: DefaultApi#financials\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1342
|
+
end
|
1343
|
+
return data, status_code, headers
|
1344
|
+
end
|
1345
|
+
|
1346
|
+
# Financials As Reported
|
1347
|
+
# Get financials as reported. This data is available for bulk download on <a href=\"https://www.kaggle.com/finnhub/reported-financials\" target=\"_blank\">Kaggle SEC Financials database</a>.
|
1348
|
+
# @param [Hash] opts the optional parameters
|
1349
|
+
# @option opts [String] :symbol Symbol.
|
1350
|
+
# @option opts [String] :cik CIK.
|
1351
|
+
# @option opts [String] :access_number Access number of a specific report you want to retrieve financials from.
|
1352
|
+
# @option opts [String] :freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>.
|
1353
|
+
# @return [FinancialsAsReported]
|
1354
|
+
def financials_reported(opts = {})
|
1355
|
+
data, _status_code, _headers = financials_reported_with_http_info(opts)
|
1356
|
+
data
|
1357
|
+
end
|
1358
|
+
|
1359
|
+
# Financials As Reported
|
1360
|
+
# Get financials as reported. This data is available for bulk download on <a href=\"https://www.kaggle.com/finnhub/reported-financials\" target=\"_blank\">Kaggle SEC Financials database</a>.
|
1361
|
+
# @param [Hash] opts the optional parameters
|
1362
|
+
# @option opts [String] :symbol Symbol.
|
1363
|
+
# @option opts [String] :cik CIK.
|
1364
|
+
# @option opts [String] :access_number Access number of a specific report you want to retrieve financials from.
|
1365
|
+
# @option opts [String] :freq Frequency. Can be either <code>annual</code> or <code>quarterly</code>. Default to <code>annual</code>.
|
1366
|
+
# @return [Array<(FinancialsAsReported, Integer, Hash)>] FinancialsAsReported data, response status code and response headers
|
1367
|
+
def financials_reported_with_http_info(opts = {})
|
1368
|
+
if @api_client.config.debugging
|
1369
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.financials_reported ...'
|
1370
|
+
end
|
1371
|
+
# resource path
|
1372
|
+
local_var_path = '/stock/financials-reported'
|
1373
|
+
|
1374
|
+
# query parameters
|
1375
|
+
query_params = opts[:query_params] || {}
|
1376
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
1377
|
+
query_params[:'cik'] = opts[:'cik'] if !opts[:'cik'].nil?
|
1378
|
+
query_params[:'accessNumber'] = opts[:'access_number'] if !opts[:'access_number'].nil?
|
1379
|
+
query_params[:'freq'] = opts[:'freq'] if !opts[:'freq'].nil?
|
1380
|
+
|
1381
|
+
# header parameters
|
1382
|
+
header_params = opts[:header_params] || {}
|
1383
|
+
# HTTP header 'Accept' (if needed)
|
1384
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1385
|
+
|
1386
|
+
# form parameters
|
1387
|
+
form_params = opts[:form_params] || {}
|
1388
|
+
|
1389
|
+
# http body (model)
|
1390
|
+
post_body = opts[:body]
|
1391
|
+
|
1392
|
+
# return_type
|
1393
|
+
return_type = opts[:return_type] || 'FinancialsAsReported'
|
1394
|
+
|
1395
|
+
# auth_names
|
1396
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1397
|
+
|
1398
|
+
new_options = opts.merge(
|
1399
|
+
:header_params => header_params,
|
1400
|
+
:query_params => query_params,
|
1401
|
+
:form_params => form_params,
|
1402
|
+
:body => post_body,
|
1403
|
+
:auth_names => auth_names,
|
1404
|
+
:return_type => return_type
|
1405
|
+
)
|
1406
|
+
|
1407
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1408
|
+
if @api_client.config.debugging
|
1409
|
+
@api_client.config.logger.debug "API called: DefaultApi#financials_reported\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1410
|
+
end
|
1411
|
+
return data, status_code, headers
|
1412
|
+
end
|
1413
|
+
|
1414
|
+
# Forex Candles
|
1415
|
+
# Get candlestick data for forex symbols.
|
1416
|
+
# @param symbol [String] Use symbol returned in <code>/forex/symbol</code> endpoint for this field.
|
1417
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
1418
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
1419
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
1420
|
+
# @param [Hash] opts the optional parameters
|
1421
|
+
# @return [ForexCandles]
|
1422
|
+
def forex_candles(symbol, resolution, from, to, opts = {})
|
1423
|
+
data, _status_code, _headers = forex_candles_with_http_info(symbol, resolution, from, to, opts)
|
1424
|
+
data
|
1425
|
+
end
|
1426
|
+
|
1427
|
+
# Forex Candles
|
1428
|
+
# Get candlestick data for forex symbols.
|
1429
|
+
# @param symbol [String] Use symbol returned in <code>/forex/symbol</code> endpoint for this field.
|
1430
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
1431
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
1432
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
1433
|
+
# @param [Hash] opts the optional parameters
|
1434
|
+
# @return [Array<(ForexCandles, Integer, Hash)>] ForexCandles data, response status code and response headers
|
1435
|
+
def forex_candles_with_http_info(symbol, resolution, from, to, opts = {})
|
1436
|
+
if @api_client.config.debugging
|
1437
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.forex_candles ...'
|
1438
|
+
end
|
1439
|
+
# verify the required parameter 'symbol' is set
|
1440
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
1441
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.forex_candles"
|
1442
|
+
end
|
1443
|
+
# verify the required parameter 'resolution' is set
|
1444
|
+
if @api_client.config.client_side_validation && resolution.nil?
|
1445
|
+
fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.forex_candles"
|
1446
|
+
end
|
1447
|
+
# verify the required parameter 'from' is set
|
1448
|
+
if @api_client.config.client_side_validation && from.nil?
|
1449
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.forex_candles"
|
1450
|
+
end
|
1451
|
+
# verify the required parameter 'to' is set
|
1452
|
+
if @api_client.config.client_side_validation && to.nil?
|
1453
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.forex_candles"
|
1454
|
+
end
|
1455
|
+
# resource path
|
1456
|
+
local_var_path = '/forex/candle'
|
1457
|
+
|
1458
|
+
# query parameters
|
1459
|
+
query_params = opts[:query_params] || {}
|
1460
|
+
query_params[:'symbol'] = symbol
|
1461
|
+
query_params[:'resolution'] = resolution
|
1462
|
+
query_params[:'from'] = from
|
1463
|
+
query_params[:'to'] = to
|
1464
|
+
|
1465
|
+
# header parameters
|
1466
|
+
header_params = opts[:header_params] || {}
|
1467
|
+
# HTTP header 'Accept' (if needed)
|
1468
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1469
|
+
|
1470
|
+
# form parameters
|
1471
|
+
form_params = opts[:form_params] || {}
|
1472
|
+
|
1473
|
+
# http body (model)
|
1474
|
+
post_body = opts[:body]
|
1475
|
+
|
1476
|
+
# return_type
|
1477
|
+
return_type = opts[:return_type] || 'ForexCandles'
|
1478
|
+
|
1479
|
+
# auth_names
|
1480
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1481
|
+
|
1482
|
+
new_options = opts.merge(
|
1483
|
+
:header_params => header_params,
|
1484
|
+
:query_params => query_params,
|
1485
|
+
:form_params => form_params,
|
1486
|
+
:body => post_body,
|
1487
|
+
:auth_names => auth_names,
|
1488
|
+
:return_type => return_type
|
1489
|
+
)
|
1490
|
+
|
1491
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1492
|
+
if @api_client.config.debugging
|
1493
|
+
@api_client.config.logger.debug "API called: DefaultApi#forex_candles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1494
|
+
end
|
1495
|
+
return data, status_code, headers
|
1496
|
+
end
|
1497
|
+
|
1498
|
+
# Forex Exchanges
|
1499
|
+
# List supported forex exchanges
|
1500
|
+
# @param [Hash] opts the optional parameters
|
1501
|
+
# @return [Array<String>]
|
1502
|
+
def forex_exchanges(opts = {})
|
1503
|
+
data, _status_code, _headers = forex_exchanges_with_http_info(opts)
|
1504
|
+
data
|
1505
|
+
end
|
1506
|
+
|
1507
|
+
# Forex Exchanges
|
1508
|
+
# List supported forex exchanges
|
1509
|
+
# @param [Hash] opts the optional parameters
|
1510
|
+
# @return [Array<(Array<String>, Integer, Hash)>] Array<String> data, response status code and response headers
|
1511
|
+
def forex_exchanges_with_http_info(opts = {})
|
1512
|
+
if @api_client.config.debugging
|
1513
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.forex_exchanges ...'
|
1514
|
+
end
|
1515
|
+
# resource path
|
1516
|
+
local_var_path = '/forex/exchange'
|
1517
|
+
|
1518
|
+
# query parameters
|
1519
|
+
query_params = opts[:query_params] || {}
|
1520
|
+
|
1521
|
+
# header parameters
|
1522
|
+
header_params = opts[:header_params] || {}
|
1523
|
+
# HTTP header 'Accept' (if needed)
|
1524
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1525
|
+
|
1526
|
+
# form parameters
|
1527
|
+
form_params = opts[:form_params] || {}
|
1528
|
+
|
1529
|
+
# http body (model)
|
1530
|
+
post_body = opts[:body]
|
1531
|
+
|
1532
|
+
# return_type
|
1533
|
+
return_type = opts[:return_type] || 'Array<String>'
|
1534
|
+
|
1535
|
+
# auth_names
|
1536
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1537
|
+
|
1538
|
+
new_options = opts.merge(
|
1539
|
+
:header_params => header_params,
|
1540
|
+
:query_params => query_params,
|
1541
|
+
:form_params => form_params,
|
1542
|
+
:body => post_body,
|
1543
|
+
:auth_names => auth_names,
|
1544
|
+
:return_type => return_type
|
1545
|
+
)
|
1546
|
+
|
1547
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1548
|
+
if @api_client.config.debugging
|
1549
|
+
@api_client.config.logger.debug "API called: DefaultApi#forex_exchanges\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1550
|
+
end
|
1551
|
+
return data, status_code, headers
|
1552
|
+
end
|
1553
|
+
|
1554
|
+
# Forex rates
|
1555
|
+
# Get rates for all forex pairs. Ideal for currency conversion
|
1556
|
+
# @param [Hash] opts the optional parameters
|
1557
|
+
# @option opts [String] :base Base currency. Default to EUR.
|
1558
|
+
# @return [Forexrates]
|
1559
|
+
def forex_rates(opts = {})
|
1560
|
+
data, _status_code, _headers = forex_rates_with_http_info(opts)
|
1561
|
+
data
|
1562
|
+
end
|
1563
|
+
|
1564
|
+
# Forex rates
|
1565
|
+
# Get rates for all forex pairs. Ideal for currency conversion
|
1566
|
+
# @param [Hash] opts the optional parameters
|
1567
|
+
# @option opts [String] :base Base currency. Default to EUR.
|
1568
|
+
# @return [Array<(Forexrates, Integer, Hash)>] Forexrates data, response status code and response headers
|
1569
|
+
def forex_rates_with_http_info(opts = {})
|
1570
|
+
if @api_client.config.debugging
|
1571
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.forex_rates ...'
|
1572
|
+
end
|
1573
|
+
# resource path
|
1574
|
+
local_var_path = '/forex/rates'
|
1575
|
+
|
1576
|
+
# query parameters
|
1577
|
+
query_params = opts[:query_params] || {}
|
1578
|
+
query_params[:'base'] = opts[:'base'] if !opts[:'base'].nil?
|
1579
|
+
|
1580
|
+
# header parameters
|
1581
|
+
header_params = opts[:header_params] || {}
|
1582
|
+
# HTTP header 'Accept' (if needed)
|
1583
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1584
|
+
|
1585
|
+
# form parameters
|
1586
|
+
form_params = opts[:form_params] || {}
|
1587
|
+
|
1588
|
+
# http body (model)
|
1589
|
+
post_body = opts[:body]
|
1590
|
+
|
1591
|
+
# return_type
|
1592
|
+
return_type = opts[:return_type] || 'Forexrates'
|
1593
|
+
|
1594
|
+
# auth_names
|
1595
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1596
|
+
|
1597
|
+
new_options = opts.merge(
|
1598
|
+
:header_params => header_params,
|
1599
|
+
:query_params => query_params,
|
1600
|
+
:form_params => form_params,
|
1601
|
+
:body => post_body,
|
1602
|
+
:auth_names => auth_names,
|
1603
|
+
:return_type => return_type
|
1604
|
+
)
|
1605
|
+
|
1606
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1607
|
+
if @api_client.config.debugging
|
1608
|
+
@api_client.config.logger.debug "API called: DefaultApi#forex_rates\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1609
|
+
end
|
1610
|
+
return data, status_code, headers
|
1611
|
+
end
|
1612
|
+
|
1613
|
+
# Forex Symbol
|
1614
|
+
# List supported forex symbols.
|
1615
|
+
# @param exchange [String] Exchange you want to get the list of symbols from.
|
1616
|
+
# @param [Hash] opts the optional parameters
|
1617
|
+
# @return [Array<ForexSymbol>]
|
1618
|
+
def forex_symbols(exchange, opts = {})
|
1619
|
+
data, _status_code, _headers = forex_symbols_with_http_info(exchange, opts)
|
1620
|
+
data
|
1621
|
+
end
|
1622
|
+
|
1623
|
+
# Forex Symbol
|
1624
|
+
# List supported forex symbols.
|
1625
|
+
# @param exchange [String] Exchange you want to get the list of symbols from.
|
1626
|
+
# @param [Hash] opts the optional parameters
|
1627
|
+
# @return [Array<(Array<ForexSymbol>, Integer, Hash)>] Array<ForexSymbol> data, response status code and response headers
|
1628
|
+
def forex_symbols_with_http_info(exchange, opts = {})
|
1629
|
+
if @api_client.config.debugging
|
1630
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.forex_symbols ...'
|
1631
|
+
end
|
1632
|
+
# verify the required parameter 'exchange' is set
|
1633
|
+
if @api_client.config.client_side_validation && exchange.nil?
|
1634
|
+
fail ArgumentError, "Missing the required parameter 'exchange' when calling DefaultApi.forex_symbols"
|
1635
|
+
end
|
1636
|
+
# resource path
|
1637
|
+
local_var_path = '/forex/symbol'
|
1638
|
+
|
1639
|
+
# query parameters
|
1640
|
+
query_params = opts[:query_params] || {}
|
1641
|
+
query_params[:'exchange'] = exchange
|
1642
|
+
|
1643
|
+
# header parameters
|
1644
|
+
header_params = opts[:header_params] || {}
|
1645
|
+
# HTTP header 'Accept' (if needed)
|
1646
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1647
|
+
|
1648
|
+
# form parameters
|
1649
|
+
form_params = opts[:form_params] || {}
|
1650
|
+
|
1651
|
+
# http body (model)
|
1652
|
+
post_body = opts[:body]
|
1653
|
+
|
1654
|
+
# return_type
|
1655
|
+
return_type = opts[:return_type] || 'Array<ForexSymbol>'
|
1656
|
+
|
1657
|
+
# auth_names
|
1658
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1659
|
+
|
1660
|
+
new_options = opts.merge(
|
1661
|
+
:header_params => header_params,
|
1662
|
+
:query_params => query_params,
|
1663
|
+
:form_params => form_params,
|
1664
|
+
:body => post_body,
|
1665
|
+
:auth_names => auth_names,
|
1666
|
+
:return_type => return_type
|
1667
|
+
)
|
1668
|
+
|
1669
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1670
|
+
if @api_client.config.debugging
|
1671
|
+
@api_client.config.logger.debug "API called: DefaultApi#forex_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1672
|
+
end
|
1673
|
+
return data, status_code, headers
|
1674
|
+
end
|
1675
|
+
|
1676
|
+
# Fund Ownership
|
1677
|
+
# Get a full list fund and institutional investors of a company in descending order of the number of shares held.
|
1678
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
1679
|
+
# @param [Hash] opts the optional parameters
|
1680
|
+
# @option opts [Integer] :limit Limit number of results. Leave empty to get the full list.
|
1681
|
+
# @return [FundOwnership]
|
1682
|
+
def fund_ownership(symbol, opts = {})
|
1683
|
+
data, _status_code, _headers = fund_ownership_with_http_info(symbol, opts)
|
1684
|
+
data
|
1685
|
+
end
|
1686
|
+
|
1687
|
+
# Fund Ownership
|
1688
|
+
# Get a full list fund and institutional investors of a company in descending order of the number of shares held.
|
1689
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
1690
|
+
# @param [Hash] opts the optional parameters
|
1691
|
+
# @option opts [Integer] :limit Limit number of results. Leave empty to get the full list.
|
1692
|
+
# @return [Array<(FundOwnership, Integer, Hash)>] FundOwnership data, response status code and response headers
|
1693
|
+
def fund_ownership_with_http_info(symbol, opts = {})
|
1694
|
+
if @api_client.config.debugging
|
1695
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.fund_ownership ...'
|
1696
|
+
end
|
1697
|
+
# verify the required parameter 'symbol' is set
|
1698
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
1699
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.fund_ownership"
|
1700
|
+
end
|
1701
|
+
# resource path
|
1702
|
+
local_var_path = '/stock/fund-ownership'
|
1703
|
+
|
1704
|
+
# query parameters
|
1705
|
+
query_params = opts[:query_params] || {}
|
1706
|
+
query_params[:'symbol'] = symbol
|
1707
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
1708
|
+
|
1709
|
+
# header parameters
|
1710
|
+
header_params = opts[:header_params] || {}
|
1711
|
+
# HTTP header 'Accept' (if needed)
|
1712
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1713
|
+
|
1714
|
+
# form parameters
|
1715
|
+
form_params = opts[:form_params] || {}
|
1716
|
+
|
1717
|
+
# http body (model)
|
1718
|
+
post_body = opts[:body]
|
1719
|
+
|
1720
|
+
# return_type
|
1721
|
+
return_type = opts[:return_type] || 'FundOwnership'
|
1722
|
+
|
1723
|
+
# auth_names
|
1724
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1725
|
+
|
1726
|
+
new_options = opts.merge(
|
1727
|
+
:header_params => header_params,
|
1728
|
+
:query_params => query_params,
|
1729
|
+
:form_params => form_params,
|
1730
|
+
:body => post_body,
|
1731
|
+
:auth_names => auth_names,
|
1732
|
+
:return_type => return_type
|
1733
|
+
)
|
1734
|
+
|
1735
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1736
|
+
if @api_client.config.debugging
|
1737
|
+
@api_client.config.logger.debug "API called: DefaultApi#fund_ownership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1738
|
+
end
|
1739
|
+
return data, status_code, headers
|
1740
|
+
end
|
1741
|
+
|
1742
|
+
# General News
|
1743
|
+
# Get latest market news.
|
1744
|
+
# @param category [String] This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>.
|
1745
|
+
# @param [Hash] opts the optional parameters
|
1746
|
+
# @option opts [String] :min_id Use this field to get only news after this ID. Default to 0
|
1747
|
+
# @return [Array<News>]
|
1748
|
+
def general_news(category, opts = {})
|
1749
|
+
data, _status_code, _headers = general_news_with_http_info(category, opts)
|
1750
|
+
data
|
1751
|
+
end
|
1752
|
+
|
1753
|
+
# General News
|
1754
|
+
# Get latest market news.
|
1755
|
+
# @param category [String] This parameter can be 1 of the following values <code>general, forex, crypto, merger</code>.
|
1756
|
+
# @param [Hash] opts the optional parameters
|
1757
|
+
# @option opts [String] :min_id Use this field to get only news after this ID. Default to 0
|
1758
|
+
# @return [Array<(Array<News>, Integer, Hash)>] Array<News> data, response status code and response headers
|
1759
|
+
def general_news_with_http_info(category, opts = {})
|
1760
|
+
if @api_client.config.debugging
|
1761
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.general_news ...'
|
1762
|
+
end
|
1763
|
+
# verify the required parameter 'category' is set
|
1764
|
+
if @api_client.config.client_side_validation && category.nil?
|
1765
|
+
fail ArgumentError, "Missing the required parameter 'category' when calling DefaultApi.general_news"
|
1766
|
+
end
|
1767
|
+
# resource path
|
1768
|
+
local_var_path = '/news'
|
1769
|
+
|
1770
|
+
# query parameters
|
1771
|
+
query_params = opts[:query_params] || {}
|
1772
|
+
query_params[:'category'] = category
|
1773
|
+
query_params[:'minId'] = opts[:'min_id'] if !opts[:'min_id'].nil?
|
1774
|
+
|
1775
|
+
# header parameters
|
1776
|
+
header_params = opts[:header_params] || {}
|
1777
|
+
# HTTP header 'Accept' (if needed)
|
1778
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1779
|
+
|
1780
|
+
# form parameters
|
1781
|
+
form_params = opts[:form_params] || {}
|
1782
|
+
|
1783
|
+
# http body (model)
|
1784
|
+
post_body = opts[:body]
|
1785
|
+
|
1786
|
+
# return_type
|
1787
|
+
return_type = opts[:return_type] || 'Array<News>'
|
1788
|
+
|
1789
|
+
# auth_names
|
1790
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1791
|
+
|
1792
|
+
new_options = opts.merge(
|
1793
|
+
:header_params => header_params,
|
1794
|
+
:query_params => query_params,
|
1795
|
+
:form_params => form_params,
|
1796
|
+
:body => post_body,
|
1797
|
+
:auth_names => auth_names,
|
1798
|
+
:return_type => return_type
|
1799
|
+
)
|
1800
|
+
|
1801
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1802
|
+
if @api_client.config.debugging
|
1803
|
+
@api_client.config.logger.debug "API called: DefaultApi#general_news\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1804
|
+
end
|
1805
|
+
return data, status_code, headers
|
1806
|
+
end
|
1807
|
+
|
1808
|
+
# Investors Ownership
|
1809
|
+
# Get a full list of shareholders/investors of a company in descending order of the number of shares held.
|
1810
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
1811
|
+
# @param [Hash] opts the optional parameters
|
1812
|
+
# @option opts [Integer] :limit Limit number of results. Leave empty to get the full list.
|
1813
|
+
# @return [InvestorsOwnership]
|
1814
|
+
def investors_ownership(symbol, opts = {})
|
1815
|
+
data, _status_code, _headers = investors_ownership_with_http_info(symbol, opts)
|
1816
|
+
data
|
1817
|
+
end
|
1818
|
+
|
1819
|
+
# Investors Ownership
|
1820
|
+
# Get a full list of shareholders/investors of a company in descending order of the number of shares held.
|
1821
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
1822
|
+
# @param [Hash] opts the optional parameters
|
1823
|
+
# @option opts [Integer] :limit Limit number of results. Leave empty to get the full list.
|
1824
|
+
# @return [Array<(InvestorsOwnership, Integer, Hash)>] InvestorsOwnership data, response status code and response headers
|
1825
|
+
def investors_ownership_with_http_info(symbol, opts = {})
|
1826
|
+
if @api_client.config.debugging
|
1827
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.investors_ownership ...'
|
1828
|
+
end
|
1829
|
+
# verify the required parameter 'symbol' is set
|
1830
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
1831
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.investors_ownership"
|
1832
|
+
end
|
1833
|
+
# resource path
|
1834
|
+
local_var_path = '/stock/investor-ownership'
|
1835
|
+
|
1836
|
+
# query parameters
|
1837
|
+
query_params = opts[:query_params] || {}
|
1838
|
+
query_params[:'symbol'] = symbol
|
1839
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
1840
|
+
|
1841
|
+
# header parameters
|
1842
|
+
header_params = opts[:header_params] || {}
|
1843
|
+
# HTTP header 'Accept' (if needed)
|
1844
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1845
|
+
|
1846
|
+
# form parameters
|
1847
|
+
form_params = opts[:form_params] || {}
|
1848
|
+
|
1849
|
+
# http body (model)
|
1850
|
+
post_body = opts[:body]
|
1851
|
+
|
1852
|
+
# return_type
|
1853
|
+
return_type = opts[:return_type] || 'InvestorsOwnership'
|
1854
|
+
|
1855
|
+
# auth_names
|
1856
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1857
|
+
|
1858
|
+
new_options = opts.merge(
|
1859
|
+
:header_params => header_params,
|
1860
|
+
:query_params => query_params,
|
1861
|
+
:form_params => form_params,
|
1862
|
+
:body => post_body,
|
1863
|
+
:auth_names => auth_names,
|
1864
|
+
:return_type => return_type
|
1865
|
+
)
|
1866
|
+
|
1867
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1868
|
+
if @api_client.config.debugging
|
1869
|
+
@api_client.config.logger.debug "API called: DefaultApi#investors_ownership\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1870
|
+
end
|
1871
|
+
return data, status_code, headers
|
1872
|
+
end
|
1873
|
+
|
1874
|
+
# IPO Calendar
|
1875
|
+
# Get recent and coming IPO.
|
1876
|
+
# @param from [Date] From date: 2020-03-15.
|
1877
|
+
# @param to [Date] To date: 2020-03-16.
|
1878
|
+
# @param [Hash] opts the optional parameters
|
1879
|
+
# @return [IPOCalendar]
|
1880
|
+
def ipo_calendar(from, to, opts = {})
|
1881
|
+
data, _status_code, _headers = ipo_calendar_with_http_info(from, to, opts)
|
1882
|
+
data
|
1883
|
+
end
|
1884
|
+
|
1885
|
+
# IPO Calendar
|
1886
|
+
# Get recent and coming IPO.
|
1887
|
+
# @param from [Date] From date: 2020-03-15.
|
1888
|
+
# @param to [Date] To date: 2020-03-16.
|
1889
|
+
# @param [Hash] opts the optional parameters
|
1890
|
+
# @return [Array<(IPOCalendar, Integer, Hash)>] IPOCalendar data, response status code and response headers
|
1891
|
+
def ipo_calendar_with_http_info(from, to, opts = {})
|
1892
|
+
if @api_client.config.debugging
|
1893
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.ipo_calendar ...'
|
1894
|
+
end
|
1895
|
+
# verify the required parameter 'from' is set
|
1896
|
+
if @api_client.config.client_side_validation && from.nil?
|
1897
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.ipo_calendar"
|
1898
|
+
end
|
1899
|
+
# verify the required parameter 'to' is set
|
1900
|
+
if @api_client.config.client_side_validation && to.nil?
|
1901
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.ipo_calendar"
|
1902
|
+
end
|
1903
|
+
# resource path
|
1904
|
+
local_var_path = '/calendar/ipo'
|
1905
|
+
|
1906
|
+
# query parameters
|
1907
|
+
query_params = opts[:query_params] || {}
|
1908
|
+
query_params[:'from'] = from
|
1909
|
+
query_params[:'to'] = to
|
1910
|
+
|
1911
|
+
# header parameters
|
1912
|
+
header_params = opts[:header_params] || {}
|
1913
|
+
# HTTP header 'Accept' (if needed)
|
1914
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1915
|
+
|
1916
|
+
# form parameters
|
1917
|
+
form_params = opts[:form_params] || {}
|
1918
|
+
|
1919
|
+
# http body (model)
|
1920
|
+
post_body = opts[:body]
|
1921
|
+
|
1922
|
+
# return_type
|
1923
|
+
return_type = opts[:return_type] || 'IPOCalendar'
|
1924
|
+
|
1925
|
+
# auth_names
|
1926
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1927
|
+
|
1928
|
+
new_options = opts.merge(
|
1929
|
+
:header_params => header_params,
|
1930
|
+
:query_params => query_params,
|
1931
|
+
:form_params => form_params,
|
1932
|
+
:body => post_body,
|
1933
|
+
:auth_names => auth_names,
|
1934
|
+
:return_type => return_type
|
1935
|
+
)
|
1936
|
+
|
1937
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
1938
|
+
if @api_client.config.debugging
|
1939
|
+
@api_client.config.logger.debug "API called: DefaultApi#ipo_calendar\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
1940
|
+
end
|
1941
|
+
return data, status_code, headers
|
1942
|
+
end
|
1943
|
+
|
1944
|
+
# Major Developments
|
1945
|
+
# List latest major developments of a company going back 20 years with 12M+ data points. This data can be used to highlight the most significant events.
|
1946
|
+
# @param symbol [String] Company symbol.
|
1947
|
+
# @param [Hash] opts the optional parameters
|
1948
|
+
# @option opts [Date] :from From time: 2020-01-01.
|
1949
|
+
# @option opts [Date] :to To time: 2020-01-05.
|
1950
|
+
# @return [MajorDevelopments]
|
1951
|
+
def major_developments(symbol, opts = {})
|
1952
|
+
data, _status_code, _headers = major_developments_with_http_info(symbol, opts)
|
1953
|
+
data
|
1954
|
+
end
|
1955
|
+
|
1956
|
+
# Major Developments
|
1957
|
+
# List latest major developments of a company going back 20 years with 12M+ data points. This data can be used to highlight the most significant events.
|
1958
|
+
# @param symbol [String] Company symbol.
|
1959
|
+
# @param [Hash] opts the optional parameters
|
1960
|
+
# @option opts [Date] :from From time: 2020-01-01.
|
1961
|
+
# @option opts [Date] :to To time: 2020-01-05.
|
1962
|
+
# @return [Array<(MajorDevelopments, Integer, Hash)>] MajorDevelopments data, response status code and response headers
|
1963
|
+
def major_developments_with_http_info(symbol, opts = {})
|
1964
|
+
if @api_client.config.debugging
|
1965
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.major_developments ...'
|
1966
|
+
end
|
1967
|
+
# verify the required parameter 'symbol' is set
|
1968
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
1969
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.major_developments"
|
1970
|
+
end
|
1971
|
+
# resource path
|
1972
|
+
local_var_path = '/major-development'
|
1973
|
+
|
1974
|
+
# query parameters
|
1975
|
+
query_params = opts[:query_params] || {}
|
1976
|
+
query_params[:'symbol'] = symbol
|
1977
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
1978
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
1979
|
+
|
1980
|
+
# header parameters
|
1981
|
+
header_params = opts[:header_params] || {}
|
1982
|
+
# HTTP header 'Accept' (if needed)
|
1983
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
1984
|
+
|
1985
|
+
# form parameters
|
1986
|
+
form_params = opts[:form_params] || {}
|
1987
|
+
|
1988
|
+
# http body (model)
|
1989
|
+
post_body = opts[:body]
|
1990
|
+
|
1991
|
+
# return_type
|
1992
|
+
return_type = opts[:return_type] || 'MajorDevelopments'
|
1993
|
+
|
1994
|
+
# auth_names
|
1995
|
+
auth_names = opts[:auth_names] || ['api_key']
|
1996
|
+
|
1997
|
+
new_options = opts.merge(
|
1998
|
+
:header_params => header_params,
|
1999
|
+
:query_params => query_params,
|
2000
|
+
:form_params => form_params,
|
2001
|
+
:body => post_body,
|
2002
|
+
:auth_names => auth_names,
|
2003
|
+
:return_type => return_type
|
2004
|
+
)
|
2005
|
+
|
2006
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2007
|
+
if @api_client.config.debugging
|
2008
|
+
@api_client.config.logger.debug "API called: DefaultApi#major_developments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2009
|
+
end
|
2010
|
+
return data, status_code, headers
|
2011
|
+
end
|
2012
|
+
|
2013
|
+
# News Sentiment
|
2014
|
+
# Get company's news sentiment and statistics. This endpoint is only available for US companies.
|
2015
|
+
# @param symbol [String] Company symbol.
|
2016
|
+
# @param [Hash] opts the optional parameters
|
2017
|
+
# @return [NewsSentiment]
|
2018
|
+
def news_sentiment(symbol, opts = {})
|
2019
|
+
data, _status_code, _headers = news_sentiment_with_http_info(symbol, opts)
|
2020
|
+
data
|
2021
|
+
end
|
2022
|
+
|
2023
|
+
# News Sentiment
|
2024
|
+
# Get company's news sentiment and statistics. This endpoint is only available for US companies.
|
2025
|
+
# @param symbol [String] Company symbol.
|
2026
|
+
# @param [Hash] opts the optional parameters
|
2027
|
+
# @return [Array<(NewsSentiment, Integer, Hash)>] NewsSentiment data, response status code and response headers
|
2028
|
+
def news_sentiment_with_http_info(symbol, opts = {})
|
2029
|
+
if @api_client.config.debugging
|
2030
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.news_sentiment ...'
|
2031
|
+
end
|
2032
|
+
# verify the required parameter 'symbol' is set
|
2033
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2034
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.news_sentiment"
|
2035
|
+
end
|
2036
|
+
# resource path
|
2037
|
+
local_var_path = '/news-sentiment'
|
2038
|
+
|
2039
|
+
# query parameters
|
2040
|
+
query_params = opts[:query_params] || {}
|
2041
|
+
query_params[:'symbol'] = symbol
|
2042
|
+
|
2043
|
+
# header parameters
|
2044
|
+
header_params = opts[:header_params] || {}
|
2045
|
+
# HTTP header 'Accept' (if needed)
|
2046
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2047
|
+
|
2048
|
+
# form parameters
|
2049
|
+
form_params = opts[:form_params] || {}
|
2050
|
+
|
2051
|
+
# http body (model)
|
2052
|
+
post_body = opts[:body]
|
2053
|
+
|
2054
|
+
# return_type
|
2055
|
+
return_type = opts[:return_type] || 'NewsSentiment'
|
2056
|
+
|
2057
|
+
# auth_names
|
2058
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2059
|
+
|
2060
|
+
new_options = opts.merge(
|
2061
|
+
:header_params => header_params,
|
2062
|
+
:query_params => query_params,
|
2063
|
+
:form_params => form_params,
|
2064
|
+
:body => post_body,
|
2065
|
+
:auth_names => auth_names,
|
2066
|
+
:return_type => return_type
|
2067
|
+
)
|
2068
|
+
|
2069
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2070
|
+
if @api_client.config.debugging
|
2071
|
+
@api_client.config.logger.debug "API called: DefaultApi#news_sentiment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2072
|
+
end
|
2073
|
+
return data, status_code, headers
|
2074
|
+
end
|
2075
|
+
|
2076
|
+
# Pattern Recognition
|
2077
|
+
# Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns.
|
2078
|
+
# @param symbol [String] Symbol
|
2079
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2080
|
+
# @param [Hash] opts the optional parameters
|
2081
|
+
# @return [PatternRecognition]
|
2082
|
+
def pattern_recognition(symbol, resolution, opts = {})
|
2083
|
+
data, _status_code, _headers = pattern_recognition_with_http_info(symbol, resolution, opts)
|
2084
|
+
data
|
2085
|
+
end
|
2086
|
+
|
2087
|
+
# Pattern Recognition
|
2088
|
+
# Run pattern recognition algorithm on a symbol. Support double top/bottom, triple top/bottom, head and shoulders, triangle, wedge, channel, flag, and candlestick patterns.
|
2089
|
+
# @param symbol [String] Symbol
|
2090
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2091
|
+
# @param [Hash] opts the optional parameters
|
2092
|
+
# @return [Array<(PatternRecognition, Integer, Hash)>] PatternRecognition data, response status code and response headers
|
2093
|
+
def pattern_recognition_with_http_info(symbol, resolution, opts = {})
|
2094
|
+
if @api_client.config.debugging
|
2095
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.pattern_recognition ...'
|
2096
|
+
end
|
2097
|
+
# verify the required parameter 'symbol' is set
|
2098
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2099
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.pattern_recognition"
|
2100
|
+
end
|
2101
|
+
# verify the required parameter 'resolution' is set
|
2102
|
+
if @api_client.config.client_side_validation && resolution.nil?
|
2103
|
+
fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.pattern_recognition"
|
2104
|
+
end
|
2105
|
+
# resource path
|
2106
|
+
local_var_path = '/scan/pattern'
|
2107
|
+
|
2108
|
+
# query parameters
|
2109
|
+
query_params = opts[:query_params] || {}
|
2110
|
+
query_params[:'symbol'] = symbol
|
2111
|
+
query_params[:'resolution'] = resolution
|
2112
|
+
|
2113
|
+
# header parameters
|
2114
|
+
header_params = opts[:header_params] || {}
|
2115
|
+
# HTTP header 'Accept' (if needed)
|
2116
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2117
|
+
|
2118
|
+
# form parameters
|
2119
|
+
form_params = opts[:form_params] || {}
|
2120
|
+
|
2121
|
+
# http body (model)
|
2122
|
+
post_body = opts[:body]
|
2123
|
+
|
2124
|
+
# return_type
|
2125
|
+
return_type = opts[:return_type] || 'PatternRecognition'
|
2126
|
+
|
2127
|
+
# auth_names
|
2128
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2129
|
+
|
2130
|
+
new_options = opts.merge(
|
2131
|
+
:header_params => header_params,
|
2132
|
+
:query_params => query_params,
|
2133
|
+
:form_params => form_params,
|
2134
|
+
:body => post_body,
|
2135
|
+
:auth_names => auth_names,
|
2136
|
+
:return_type => return_type
|
2137
|
+
)
|
2138
|
+
|
2139
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2140
|
+
if @api_client.config.debugging
|
2141
|
+
@api_client.config.logger.debug "API called: DefaultApi#pattern_recognition\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2142
|
+
end
|
2143
|
+
return data, status_code, headers
|
2144
|
+
end
|
2145
|
+
|
2146
|
+
# Price Target
|
2147
|
+
# Get latest price target consensus.
|
2148
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
2149
|
+
# @param [Hash] opts the optional parameters
|
2150
|
+
# @return [PriceTarget]
|
2151
|
+
def price_target(symbol, opts = {})
|
2152
|
+
data, _status_code, _headers = price_target_with_http_info(symbol, opts)
|
2153
|
+
data
|
2154
|
+
end
|
2155
|
+
|
2156
|
+
# Price Target
|
2157
|
+
# Get latest price target consensus.
|
2158
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
2159
|
+
# @param [Hash] opts the optional parameters
|
2160
|
+
# @return [Array<(PriceTarget, Integer, Hash)>] PriceTarget data, response status code and response headers
|
2161
|
+
def price_target_with_http_info(symbol, opts = {})
|
2162
|
+
if @api_client.config.debugging
|
2163
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.price_target ...'
|
2164
|
+
end
|
2165
|
+
# verify the required parameter 'symbol' is set
|
2166
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2167
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.price_target"
|
2168
|
+
end
|
2169
|
+
# resource path
|
2170
|
+
local_var_path = '/stock/price-target'
|
2171
|
+
|
2172
|
+
# query parameters
|
2173
|
+
query_params = opts[:query_params] || {}
|
2174
|
+
query_params[:'symbol'] = symbol
|
2175
|
+
|
2176
|
+
# header parameters
|
2177
|
+
header_params = opts[:header_params] || {}
|
2178
|
+
# HTTP header 'Accept' (if needed)
|
2179
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2180
|
+
|
2181
|
+
# form parameters
|
2182
|
+
form_params = opts[:form_params] || {}
|
2183
|
+
|
2184
|
+
# http body (model)
|
2185
|
+
post_body = opts[:body]
|
2186
|
+
|
2187
|
+
# return_type
|
2188
|
+
return_type = opts[:return_type] || 'PriceTarget'
|
2189
|
+
|
2190
|
+
# auth_names
|
2191
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2192
|
+
|
2193
|
+
new_options = opts.merge(
|
2194
|
+
:header_params => header_params,
|
2195
|
+
:query_params => query_params,
|
2196
|
+
:form_params => form_params,
|
2197
|
+
:body => post_body,
|
2198
|
+
:auth_names => auth_names,
|
2199
|
+
:return_type => return_type
|
2200
|
+
)
|
2201
|
+
|
2202
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2203
|
+
if @api_client.config.debugging
|
2204
|
+
@api_client.config.logger.debug "API called: DefaultApi#price_target\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2205
|
+
end
|
2206
|
+
return data, status_code, headers
|
2207
|
+
end
|
2208
|
+
|
2209
|
+
# Quote
|
2210
|
+
# <p>Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time update.</p><p>Real-time stock prices for international markets are supported for Enterprise clients via our partner's feed. <a href=\"mailto:support@finnhub.io\">Contact Us</a> to learn more.</p>
|
2211
|
+
# @param symbol [String] Symbol
|
2212
|
+
# @param [Hash] opts the optional parameters
|
2213
|
+
# @return [Quote]
|
2214
|
+
def quote(symbol, opts = {})
|
2215
|
+
data, _status_code, _headers = quote_with_http_info(symbol, opts)
|
2216
|
+
data
|
2217
|
+
end
|
2218
|
+
|
2219
|
+
# Quote
|
2220
|
+
# <p>Get real-time quote data for US stocks. Constant polling is not recommended. Use websocket if you need real-time update.</p><p>Real-time stock prices for international markets are supported for Enterprise clients via our partner's feed. <a href=\"mailto:support@finnhub.io\">Contact Us</a> to learn more.</p>
|
2221
|
+
# @param symbol [String] Symbol
|
2222
|
+
# @param [Hash] opts the optional parameters
|
2223
|
+
# @return [Array<(Quote, Integer, Hash)>] Quote data, response status code and response headers
|
2224
|
+
def quote_with_http_info(symbol, opts = {})
|
2225
|
+
if @api_client.config.debugging
|
2226
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.quote ...'
|
2227
|
+
end
|
2228
|
+
# verify the required parameter 'symbol' is set
|
2229
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2230
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.quote"
|
2231
|
+
end
|
2232
|
+
# resource path
|
2233
|
+
local_var_path = '/quote'
|
2234
|
+
|
2235
|
+
# query parameters
|
2236
|
+
query_params = opts[:query_params] || {}
|
2237
|
+
query_params[:'symbol'] = symbol
|
2238
|
+
|
2239
|
+
# header parameters
|
2240
|
+
header_params = opts[:header_params] || {}
|
2241
|
+
# HTTP header 'Accept' (if needed)
|
2242
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2243
|
+
|
2244
|
+
# form parameters
|
2245
|
+
form_params = opts[:form_params] || {}
|
2246
|
+
|
2247
|
+
# http body (model)
|
2248
|
+
post_body = opts[:body]
|
2249
|
+
|
2250
|
+
# return_type
|
2251
|
+
return_type = opts[:return_type] || 'Quote'
|
2252
|
+
|
2253
|
+
# auth_names
|
2254
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2255
|
+
|
2256
|
+
new_options = opts.merge(
|
2257
|
+
:header_params => header_params,
|
2258
|
+
:query_params => query_params,
|
2259
|
+
:form_params => form_params,
|
2260
|
+
:body => post_body,
|
2261
|
+
:auth_names => auth_names,
|
2262
|
+
:return_type => return_type
|
2263
|
+
)
|
2264
|
+
|
2265
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2266
|
+
if @api_client.config.debugging
|
2267
|
+
@api_client.config.logger.debug "API called: DefaultApi#quote\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2268
|
+
end
|
2269
|
+
return data, status_code, headers
|
2270
|
+
end
|
2271
|
+
|
2272
|
+
# Recommendation Trends
|
2273
|
+
# Get latest analyst recommendation trends for a company.
|
2274
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
2275
|
+
# @param [Hash] opts the optional parameters
|
2276
|
+
# @return [Array<RecommendationTrend>]
|
2277
|
+
def recommendation_trends(symbol, opts = {})
|
2278
|
+
data, _status_code, _headers = recommendation_trends_with_http_info(symbol, opts)
|
2279
|
+
data
|
2280
|
+
end
|
2281
|
+
|
2282
|
+
# Recommendation Trends
|
2283
|
+
# Get latest analyst recommendation trends for a company.
|
2284
|
+
# @param symbol [String] Symbol of the company: AAPL.
|
2285
|
+
# @param [Hash] opts the optional parameters
|
2286
|
+
# @return [Array<(Array<RecommendationTrend>, Integer, Hash)>] Array<RecommendationTrend> data, response status code and response headers
|
2287
|
+
def recommendation_trends_with_http_info(symbol, opts = {})
|
2288
|
+
if @api_client.config.debugging
|
2289
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.recommendation_trends ...'
|
2290
|
+
end
|
2291
|
+
# verify the required parameter 'symbol' is set
|
2292
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2293
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.recommendation_trends"
|
2294
|
+
end
|
2295
|
+
# resource path
|
2296
|
+
local_var_path = '/stock/recommendation'
|
2297
|
+
|
2298
|
+
# query parameters
|
2299
|
+
query_params = opts[:query_params] || {}
|
2300
|
+
query_params[:'symbol'] = symbol
|
2301
|
+
|
2302
|
+
# header parameters
|
2303
|
+
header_params = opts[:header_params] || {}
|
2304
|
+
# HTTP header 'Accept' (if needed)
|
2305
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2306
|
+
|
2307
|
+
# form parameters
|
2308
|
+
form_params = opts[:form_params] || {}
|
2309
|
+
|
2310
|
+
# http body (model)
|
2311
|
+
post_body = opts[:body]
|
2312
|
+
|
2313
|
+
# return_type
|
2314
|
+
return_type = opts[:return_type] || 'Array<RecommendationTrend>'
|
2315
|
+
|
2316
|
+
# auth_names
|
2317
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2318
|
+
|
2319
|
+
new_options = opts.merge(
|
2320
|
+
:header_params => header_params,
|
2321
|
+
:query_params => query_params,
|
2322
|
+
:form_params => form_params,
|
2323
|
+
:body => post_body,
|
2324
|
+
:auth_names => auth_names,
|
2325
|
+
:return_type => return_type
|
2326
|
+
)
|
2327
|
+
|
2328
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2329
|
+
if @api_client.config.debugging
|
2330
|
+
@api_client.config.logger.debug "API called: DefaultApi#recommendation_trends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2331
|
+
end
|
2332
|
+
return data, status_code, headers
|
2333
|
+
end
|
2334
|
+
|
2335
|
+
# Last Bid-Ask
|
2336
|
+
# Get last bid/ask data for US stocks.
|
2337
|
+
# @param symbol [String] Symbol.
|
2338
|
+
# @param [Hash] opts the optional parameters
|
2339
|
+
# @return [LastBidAsk]
|
2340
|
+
def stock_bidask(symbol, opts = {})
|
2341
|
+
data, _status_code, _headers = stock_bidask_with_http_info(symbol, opts)
|
2342
|
+
data
|
2343
|
+
end
|
2344
|
+
|
2345
|
+
# Last Bid-Ask
|
2346
|
+
# Get last bid/ask data for US stocks.
|
2347
|
+
# @param symbol [String] Symbol.
|
2348
|
+
# @param [Hash] opts the optional parameters
|
2349
|
+
# @return [Array<(LastBidAsk, Integer, Hash)>] LastBidAsk data, response status code and response headers
|
2350
|
+
def stock_bidask_with_http_info(symbol, opts = {})
|
2351
|
+
if @api_client.config.debugging
|
2352
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.stock_bidask ...'
|
2353
|
+
end
|
2354
|
+
# verify the required parameter 'symbol' is set
|
2355
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2356
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_bidask"
|
2357
|
+
end
|
2358
|
+
# resource path
|
2359
|
+
local_var_path = '/stock/bidask'
|
2360
|
+
|
2361
|
+
# query parameters
|
2362
|
+
query_params = opts[:query_params] || {}
|
2363
|
+
query_params[:'symbol'] = symbol
|
2364
|
+
|
2365
|
+
# header parameters
|
2366
|
+
header_params = opts[:header_params] || {}
|
2367
|
+
# HTTP header 'Accept' (if needed)
|
2368
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2369
|
+
|
2370
|
+
# form parameters
|
2371
|
+
form_params = opts[:form_params] || {}
|
2372
|
+
|
2373
|
+
# http body (model)
|
2374
|
+
post_body = opts[:body]
|
2375
|
+
|
2376
|
+
# return_type
|
2377
|
+
return_type = opts[:return_type] || 'LastBidAsk'
|
2378
|
+
|
2379
|
+
# auth_names
|
2380
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2381
|
+
|
2382
|
+
new_options = opts.merge(
|
2383
|
+
:header_params => header_params,
|
2384
|
+
:query_params => query_params,
|
2385
|
+
:form_params => form_params,
|
2386
|
+
:body => post_body,
|
2387
|
+
:auth_names => auth_names,
|
2388
|
+
:return_type => return_type
|
2389
|
+
)
|
2390
|
+
|
2391
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2392
|
+
if @api_client.config.debugging
|
2393
|
+
@api_client.config.logger.debug "API called: DefaultApi#stock_bidask\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2394
|
+
end
|
2395
|
+
return data, status_code, headers
|
2396
|
+
end
|
2397
|
+
|
2398
|
+
# Stock Candles
|
2399
|
+
# <p>Get candlestick data for stocks going back 25 years for US stocks.</p><p>Real-time stock prices for international markets are supported for Enterprise clients via our partner's feed. <a href=\"mailto:support@finnhub.io\">Contact Us</a> to learn more.</p>
|
2400
|
+
# @param symbol [String] Symbol.
|
2401
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2402
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
2403
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
2404
|
+
# @param [Hash] opts the optional parameters
|
2405
|
+
# @option opts [String] :adjusted By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data.
|
2406
|
+
# @return [StockCandles]
|
2407
|
+
def stock_candles(symbol, resolution, from, to, opts = {})
|
2408
|
+
data, _status_code, _headers = stock_candles_with_http_info(symbol, resolution, from, to, opts)
|
2409
|
+
data
|
2410
|
+
end
|
2411
|
+
|
2412
|
+
# Stock Candles
|
2413
|
+
# <p>Get candlestick data for stocks going back 25 years for US stocks.</p><p>Real-time stock prices for international markets are supported for Enterprise clients via our partner's feed. <a href=\"mailto:support@finnhub.io\">Contact Us</a> to learn more.</p>
|
2414
|
+
# @param symbol [String] Symbol.
|
2415
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2416
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
2417
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
2418
|
+
# @param [Hash] opts the optional parameters
|
2419
|
+
# @option opts [String] :adjusted By default, <code>adjusted=false</code>. Use <code>true</code> to get adjusted data.
|
2420
|
+
# @return [Array<(StockCandles, Integer, Hash)>] StockCandles data, response status code and response headers
|
2421
|
+
def stock_candles_with_http_info(symbol, resolution, from, to, opts = {})
|
2422
|
+
if @api_client.config.debugging
|
2423
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.stock_candles ...'
|
2424
|
+
end
|
2425
|
+
# verify the required parameter 'symbol' is set
|
2426
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2427
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_candles"
|
2428
|
+
end
|
2429
|
+
# verify the required parameter 'resolution' is set
|
2430
|
+
if @api_client.config.client_side_validation && resolution.nil?
|
2431
|
+
fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.stock_candles"
|
2432
|
+
end
|
2433
|
+
# verify the required parameter 'from' is set
|
2434
|
+
if @api_client.config.client_side_validation && from.nil?
|
2435
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_candles"
|
2436
|
+
end
|
2437
|
+
# verify the required parameter 'to' is set
|
2438
|
+
if @api_client.config.client_side_validation && to.nil?
|
2439
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_candles"
|
2440
|
+
end
|
2441
|
+
# resource path
|
2442
|
+
local_var_path = '/stock/candle'
|
2443
|
+
|
2444
|
+
# query parameters
|
2445
|
+
query_params = opts[:query_params] || {}
|
2446
|
+
query_params[:'symbol'] = symbol
|
2447
|
+
query_params[:'resolution'] = resolution
|
2448
|
+
query_params[:'from'] = from
|
2449
|
+
query_params[:'to'] = to
|
2450
|
+
query_params[:'adjusted'] = opts[:'adjusted'] if !opts[:'adjusted'].nil?
|
2451
|
+
|
2452
|
+
# header parameters
|
2453
|
+
header_params = opts[:header_params] || {}
|
2454
|
+
# HTTP header 'Accept' (if needed)
|
2455
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2456
|
+
|
2457
|
+
# form parameters
|
2458
|
+
form_params = opts[:form_params] || {}
|
2459
|
+
|
2460
|
+
# http body (model)
|
2461
|
+
post_body = opts[:body]
|
2462
|
+
|
2463
|
+
# return_type
|
2464
|
+
return_type = opts[:return_type] || 'StockCandles'
|
2465
|
+
|
2466
|
+
# auth_names
|
2467
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2468
|
+
|
2469
|
+
new_options = opts.merge(
|
2470
|
+
:header_params => header_params,
|
2471
|
+
:query_params => query_params,
|
2472
|
+
:form_params => form_params,
|
2473
|
+
:body => post_body,
|
2474
|
+
:auth_names => auth_names,
|
2475
|
+
:return_type => return_type
|
2476
|
+
)
|
2477
|
+
|
2478
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2479
|
+
if @api_client.config.debugging
|
2480
|
+
@api_client.config.logger.debug "API called: DefaultApi#stock_candles\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2481
|
+
end
|
2482
|
+
return data, status_code, headers
|
2483
|
+
end
|
2484
|
+
|
2485
|
+
# Dividends
|
2486
|
+
# Get dividends data for common stocks going back 30 years.
|
2487
|
+
# @param symbol [String] Symbol.
|
2488
|
+
# @param from [Date] YYYY-MM-DD.
|
2489
|
+
# @param to [Date] YYYY-MM-DD.
|
2490
|
+
# @param [Hash] opts the optional parameters
|
2491
|
+
# @return [Array<Dividends>]
|
2492
|
+
def stock_dividends(symbol, from, to, opts = {})
|
2493
|
+
data, _status_code, _headers = stock_dividends_with_http_info(symbol, from, to, opts)
|
2494
|
+
data
|
2495
|
+
end
|
2496
|
+
|
2497
|
+
# Dividends
|
2498
|
+
# Get dividends data for common stocks going back 30 years.
|
2499
|
+
# @param symbol [String] Symbol.
|
2500
|
+
# @param from [Date] YYYY-MM-DD.
|
2501
|
+
# @param to [Date] YYYY-MM-DD.
|
2502
|
+
# @param [Hash] opts the optional parameters
|
2503
|
+
# @return [Array<(Array<Dividends>, Integer, Hash)>] Array<Dividends> data, response status code and response headers
|
2504
|
+
def stock_dividends_with_http_info(symbol, from, to, opts = {})
|
2505
|
+
if @api_client.config.debugging
|
2506
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.stock_dividends ...'
|
2507
|
+
end
|
2508
|
+
# verify the required parameter 'symbol' is set
|
2509
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2510
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_dividends"
|
2511
|
+
end
|
2512
|
+
# verify the required parameter 'from' is set
|
2513
|
+
if @api_client.config.client_side_validation && from.nil?
|
2514
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_dividends"
|
2515
|
+
end
|
2516
|
+
# verify the required parameter 'to' is set
|
2517
|
+
if @api_client.config.client_side_validation && to.nil?
|
2518
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_dividends"
|
2519
|
+
end
|
2520
|
+
# resource path
|
2521
|
+
local_var_path = '/stock/dividend'
|
2522
|
+
|
2523
|
+
# query parameters
|
2524
|
+
query_params = opts[:query_params] || {}
|
2525
|
+
query_params[:'symbol'] = symbol
|
2526
|
+
query_params[:'from'] = from
|
2527
|
+
query_params[:'to'] = to
|
2528
|
+
|
2529
|
+
# header parameters
|
2530
|
+
header_params = opts[:header_params] || {}
|
2531
|
+
# HTTP header 'Accept' (if needed)
|
2532
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2533
|
+
|
2534
|
+
# form parameters
|
2535
|
+
form_params = opts[:form_params] || {}
|
2536
|
+
|
2537
|
+
# http body (model)
|
2538
|
+
post_body = opts[:body]
|
2539
|
+
|
2540
|
+
# return_type
|
2541
|
+
return_type = opts[:return_type] || 'Array<Dividends>'
|
2542
|
+
|
2543
|
+
# auth_names
|
2544
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2545
|
+
|
2546
|
+
new_options = opts.merge(
|
2547
|
+
:header_params => header_params,
|
2548
|
+
:query_params => query_params,
|
2549
|
+
:form_params => form_params,
|
2550
|
+
:body => post_body,
|
2551
|
+
:auth_names => auth_names,
|
2552
|
+
:return_type => return_type
|
2553
|
+
)
|
2554
|
+
|
2555
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2556
|
+
if @api_client.config.debugging
|
2557
|
+
@api_client.config.logger.debug "API called: DefaultApi#stock_dividends\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2558
|
+
end
|
2559
|
+
return data, status_code, headers
|
2560
|
+
end
|
2561
|
+
|
2562
|
+
# Splits
|
2563
|
+
# Get splits data for stocks.
|
2564
|
+
# @param symbol [String] Symbol.
|
2565
|
+
# @param from [Date] YYYY-MM-DD.
|
2566
|
+
# @param to [Date] YYYY-MM-DD.
|
2567
|
+
# @param [Hash] opts the optional parameters
|
2568
|
+
# @return [Array<Split>]
|
2569
|
+
def stock_splits(symbol, from, to, opts = {})
|
2570
|
+
data, _status_code, _headers = stock_splits_with_http_info(symbol, from, to, opts)
|
2571
|
+
data
|
2572
|
+
end
|
2573
|
+
|
2574
|
+
# Splits
|
2575
|
+
# Get splits data for stocks.
|
2576
|
+
# @param symbol [String] Symbol.
|
2577
|
+
# @param from [Date] YYYY-MM-DD.
|
2578
|
+
# @param to [Date] YYYY-MM-DD.
|
2579
|
+
# @param [Hash] opts the optional parameters
|
2580
|
+
# @return [Array<(Array<Split>, Integer, Hash)>] Array<Split> data, response status code and response headers
|
2581
|
+
def stock_splits_with_http_info(symbol, from, to, opts = {})
|
2582
|
+
if @api_client.config.debugging
|
2583
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.stock_splits ...'
|
2584
|
+
end
|
2585
|
+
# verify the required parameter 'symbol' is set
|
2586
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2587
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_splits"
|
2588
|
+
end
|
2589
|
+
# verify the required parameter 'from' is set
|
2590
|
+
if @api_client.config.client_side_validation && from.nil?
|
2591
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.stock_splits"
|
2592
|
+
end
|
2593
|
+
# verify the required parameter 'to' is set
|
2594
|
+
if @api_client.config.client_side_validation && to.nil?
|
2595
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.stock_splits"
|
2596
|
+
end
|
2597
|
+
# resource path
|
2598
|
+
local_var_path = '/stock/split'
|
2599
|
+
|
2600
|
+
# query parameters
|
2601
|
+
query_params = opts[:query_params] || {}
|
2602
|
+
query_params[:'symbol'] = symbol
|
2603
|
+
query_params[:'from'] = from
|
2604
|
+
query_params[:'to'] = to
|
2605
|
+
|
2606
|
+
# header parameters
|
2607
|
+
header_params = opts[:header_params] || {}
|
2608
|
+
# HTTP header 'Accept' (if needed)
|
2609
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2610
|
+
|
2611
|
+
# form parameters
|
2612
|
+
form_params = opts[:form_params] || {}
|
2613
|
+
|
2614
|
+
# http body (model)
|
2615
|
+
post_body = opts[:body]
|
2616
|
+
|
2617
|
+
# return_type
|
2618
|
+
return_type = opts[:return_type] || 'Array<Split>'
|
2619
|
+
|
2620
|
+
# auth_names
|
2621
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2622
|
+
|
2623
|
+
new_options = opts.merge(
|
2624
|
+
:header_params => header_params,
|
2625
|
+
:query_params => query_params,
|
2626
|
+
:form_params => form_params,
|
2627
|
+
:body => post_body,
|
2628
|
+
:auth_names => auth_names,
|
2629
|
+
:return_type => return_type
|
2630
|
+
)
|
2631
|
+
|
2632
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2633
|
+
if @api_client.config.debugging
|
2634
|
+
@api_client.config.logger.debug "API called: DefaultApi#stock_splits\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2635
|
+
end
|
2636
|
+
return data, status_code, headers
|
2637
|
+
end
|
2638
|
+
|
2639
|
+
# Stock Symbol
|
2640
|
+
# List supported stocks.
|
2641
|
+
# @param exchange [String] Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>.
|
2642
|
+
# @param [Hash] opts the optional parameters
|
2643
|
+
# @return [Array<Stock>]
|
2644
|
+
def stock_symbols(exchange, opts = {})
|
2645
|
+
data, _status_code, _headers = stock_symbols_with_http_info(exchange, opts)
|
2646
|
+
data
|
2647
|
+
end
|
2648
|
+
|
2649
|
+
# Stock Symbol
|
2650
|
+
# List supported stocks.
|
2651
|
+
# @param exchange [String] Exchange you want to get the list of symbols from. List of exchanges with fundamental data can be found <a href=\"https://docs.google.com/spreadsheets/d/1I3pBxjfXB056-g_JYf_6o3Rns3BV2kMGG1nCatb91ls/edit?usp=sharing\" target=\"_blank\">here</a>.
|
2652
|
+
# @param [Hash] opts the optional parameters
|
2653
|
+
# @return [Array<(Array<Stock>, Integer, Hash)>] Array<Stock> data, response status code and response headers
|
2654
|
+
def stock_symbols_with_http_info(exchange, opts = {})
|
2655
|
+
if @api_client.config.debugging
|
2656
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.stock_symbols ...'
|
2657
|
+
end
|
2658
|
+
# verify the required parameter 'exchange' is set
|
2659
|
+
if @api_client.config.client_side_validation && exchange.nil?
|
2660
|
+
fail ArgumentError, "Missing the required parameter 'exchange' when calling DefaultApi.stock_symbols"
|
2661
|
+
end
|
2662
|
+
# resource path
|
2663
|
+
local_var_path = '/stock/symbol'
|
2664
|
+
|
2665
|
+
# query parameters
|
2666
|
+
query_params = opts[:query_params] || {}
|
2667
|
+
query_params[:'exchange'] = exchange
|
2668
|
+
|
2669
|
+
# header parameters
|
2670
|
+
header_params = opts[:header_params] || {}
|
2671
|
+
# HTTP header 'Accept' (if needed)
|
2672
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2673
|
+
|
2674
|
+
# form parameters
|
2675
|
+
form_params = opts[:form_params] || {}
|
2676
|
+
|
2677
|
+
# http body (model)
|
2678
|
+
post_body = opts[:body]
|
2679
|
+
|
2680
|
+
# return_type
|
2681
|
+
return_type = opts[:return_type] || 'Array<Stock>'
|
2682
|
+
|
2683
|
+
# auth_names
|
2684
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2685
|
+
|
2686
|
+
new_options = opts.merge(
|
2687
|
+
:header_params => header_params,
|
2688
|
+
:query_params => query_params,
|
2689
|
+
:form_params => form_params,
|
2690
|
+
:body => post_body,
|
2691
|
+
:auth_names => auth_names,
|
2692
|
+
:return_type => return_type
|
2693
|
+
)
|
2694
|
+
|
2695
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2696
|
+
if @api_client.config.debugging
|
2697
|
+
@api_client.config.logger.debug "API called: DefaultApi#stock_symbols\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2698
|
+
end
|
2699
|
+
return data, status_code, headers
|
2700
|
+
end
|
2701
|
+
|
2702
|
+
# Tick Data
|
2703
|
+
# <p>Get historical tick data for US stocks from all 13 exchanges. You can send the request directly to our tick server at <a href=\"https://tick.finnhub.io/\">https://tick.finnhub.io/</a> with the same path and parameters or get redirected there if you call our main server. Data is updated at the end of each trading day.</p><p>Tick data from 1985 is available for Enterprise clients. <a href=\"mailto:support@finnhub.io\">Contact us</a> to learn more.</p>
|
2704
|
+
# @param symbol [String] Symbol.
|
2705
|
+
# @param date [Date] Date: 2020-04-02.
|
2706
|
+
# @param limit [Integer] Limit number of ticks returned. Maximum value: <code>25000</code>
|
2707
|
+
# @param skip [Integer] Number of ticks to skip. Use this parameter to loop through the entire data.
|
2708
|
+
# @param [Hash] opts the optional parameters
|
2709
|
+
# @return [TickData]
|
2710
|
+
def stock_tick(symbol, date, limit, skip, opts = {})
|
2711
|
+
data, _status_code, _headers = stock_tick_with_http_info(symbol, date, limit, skip, opts)
|
2712
|
+
data
|
2713
|
+
end
|
2714
|
+
|
2715
|
+
# Tick Data
|
2716
|
+
# <p>Get historical tick data for US stocks from all 13 exchanges. You can send the request directly to our tick server at <a href=\"https://tick.finnhub.io/\">https://tick.finnhub.io/</a> with the same path and parameters or get redirected there if you call our main server. Data is updated at the end of each trading day.</p><p>Tick data from 1985 is available for Enterprise clients. <a href=\"mailto:support@finnhub.io\">Contact us</a> to learn more.</p>
|
2717
|
+
# @param symbol [String] Symbol.
|
2718
|
+
# @param date [Date] Date: 2020-04-02.
|
2719
|
+
# @param limit [Integer] Limit number of ticks returned. Maximum value: <code>25000</code>
|
2720
|
+
# @param skip [Integer] Number of ticks to skip. Use this parameter to loop through the entire data.
|
2721
|
+
# @param [Hash] opts the optional parameters
|
2722
|
+
# @return [Array<(TickData, Integer, Hash)>] TickData data, response status code and response headers
|
2723
|
+
def stock_tick_with_http_info(symbol, date, limit, skip, opts = {})
|
2724
|
+
if @api_client.config.debugging
|
2725
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.stock_tick ...'
|
2726
|
+
end
|
2727
|
+
# verify the required parameter 'symbol' is set
|
2728
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2729
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.stock_tick"
|
2730
|
+
end
|
2731
|
+
# verify the required parameter 'date' is set
|
2732
|
+
if @api_client.config.client_side_validation && date.nil?
|
2733
|
+
fail ArgumentError, "Missing the required parameter 'date' when calling DefaultApi.stock_tick"
|
2734
|
+
end
|
2735
|
+
# verify the required parameter 'limit' is set
|
2736
|
+
if @api_client.config.client_side_validation && limit.nil?
|
2737
|
+
fail ArgumentError, "Missing the required parameter 'limit' when calling DefaultApi.stock_tick"
|
2738
|
+
end
|
2739
|
+
# verify the required parameter 'skip' is set
|
2740
|
+
if @api_client.config.client_side_validation && skip.nil?
|
2741
|
+
fail ArgumentError, "Missing the required parameter 'skip' when calling DefaultApi.stock_tick"
|
2742
|
+
end
|
2743
|
+
# resource path
|
2744
|
+
local_var_path = '/stock/tick'
|
2745
|
+
|
2746
|
+
# query parameters
|
2747
|
+
query_params = opts[:query_params] || {}
|
2748
|
+
query_params[:'symbol'] = symbol
|
2749
|
+
query_params[:'date'] = date
|
2750
|
+
query_params[:'limit'] = limit
|
2751
|
+
query_params[:'skip'] = skip
|
2752
|
+
|
2753
|
+
# header parameters
|
2754
|
+
header_params = opts[:header_params] || {}
|
2755
|
+
# HTTP header 'Accept' (if needed)
|
2756
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2757
|
+
|
2758
|
+
# form parameters
|
2759
|
+
form_params = opts[:form_params] || {}
|
2760
|
+
|
2761
|
+
# http body (model)
|
2762
|
+
post_body = opts[:body]
|
2763
|
+
|
2764
|
+
# return_type
|
2765
|
+
return_type = opts[:return_type] || 'TickData'
|
2766
|
+
|
2767
|
+
# auth_names
|
2768
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2769
|
+
|
2770
|
+
new_options = opts.merge(
|
2771
|
+
:header_params => header_params,
|
2772
|
+
:query_params => query_params,
|
2773
|
+
:form_params => form_params,
|
2774
|
+
:body => post_body,
|
2775
|
+
:auth_names => auth_names,
|
2776
|
+
:return_type => return_type
|
2777
|
+
)
|
2778
|
+
|
2779
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2780
|
+
if @api_client.config.debugging
|
2781
|
+
@api_client.config.logger.debug "API called: DefaultApi#stock_tick\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2782
|
+
end
|
2783
|
+
return data, status_code, headers
|
2784
|
+
end
|
2785
|
+
|
2786
|
+
# Support/Resistance
|
2787
|
+
# Get support and resistance levels for a symbol.
|
2788
|
+
# @param symbol [String] Symbol
|
2789
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2790
|
+
# @param [Hash] opts the optional parameters
|
2791
|
+
# @return [SupportResistance]
|
2792
|
+
def support_resistance(symbol, resolution, opts = {})
|
2793
|
+
data, _status_code, _headers = support_resistance_with_http_info(symbol, resolution, opts)
|
2794
|
+
data
|
2795
|
+
end
|
2796
|
+
|
2797
|
+
# Support/Resistance
|
2798
|
+
# Get support and resistance levels for a symbol.
|
2799
|
+
# @param symbol [String] Symbol
|
2800
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2801
|
+
# @param [Hash] opts the optional parameters
|
2802
|
+
# @return [Array<(SupportResistance, Integer, Hash)>] SupportResistance data, response status code and response headers
|
2803
|
+
def support_resistance_with_http_info(symbol, resolution, opts = {})
|
2804
|
+
if @api_client.config.debugging
|
2805
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.support_resistance ...'
|
2806
|
+
end
|
2807
|
+
# verify the required parameter 'symbol' is set
|
2808
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2809
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.support_resistance"
|
2810
|
+
end
|
2811
|
+
# verify the required parameter 'resolution' is set
|
2812
|
+
if @api_client.config.client_side_validation && resolution.nil?
|
2813
|
+
fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.support_resistance"
|
2814
|
+
end
|
2815
|
+
# resource path
|
2816
|
+
local_var_path = '/scan/support-resistance'
|
2817
|
+
|
2818
|
+
# query parameters
|
2819
|
+
query_params = opts[:query_params] || {}
|
2820
|
+
query_params[:'symbol'] = symbol
|
2821
|
+
query_params[:'resolution'] = resolution
|
2822
|
+
|
2823
|
+
# header parameters
|
2824
|
+
header_params = opts[:header_params] || {}
|
2825
|
+
# HTTP header 'Accept' (if needed)
|
2826
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2827
|
+
|
2828
|
+
# form parameters
|
2829
|
+
form_params = opts[:form_params] || {}
|
2830
|
+
|
2831
|
+
# http body (model)
|
2832
|
+
post_body = opts[:body]
|
2833
|
+
|
2834
|
+
# return_type
|
2835
|
+
return_type = opts[:return_type] || 'SupportResistance'
|
2836
|
+
|
2837
|
+
# auth_names
|
2838
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2839
|
+
|
2840
|
+
new_options = opts.merge(
|
2841
|
+
:header_params => header_params,
|
2842
|
+
:query_params => query_params,
|
2843
|
+
:form_params => form_params,
|
2844
|
+
:body => post_body,
|
2845
|
+
:auth_names => auth_names,
|
2846
|
+
:return_type => return_type
|
2847
|
+
)
|
2848
|
+
|
2849
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
2850
|
+
if @api_client.config.debugging
|
2851
|
+
@api_client.config.logger.debug "API called: DefaultApi#support_resistance\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2852
|
+
end
|
2853
|
+
return data, status_code, headers
|
2854
|
+
end
|
2855
|
+
|
2856
|
+
# Technical Indicators
|
2857
|
+
# Return technical indicator with price data. List of supported indicators can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>.
|
2858
|
+
# @param symbol [String] symbol
|
2859
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2860
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
2861
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
2862
|
+
# @param indicator [String] Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>.
|
2863
|
+
# @param [Hash] opts the optional parameters
|
2864
|
+
# @option opts [Object] :indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported.
|
2865
|
+
# @return [Object]
|
2866
|
+
def technical_indicator(symbol, resolution, from, to, indicator, opts = {})
|
2867
|
+
data, _status_code, _headers = technical_indicator_with_http_info(symbol, resolution, from, to, indicator, opts)
|
2868
|
+
data
|
2869
|
+
end
|
2870
|
+
|
2871
|
+
# Technical Indicators
|
2872
|
+
# Return technical indicator with price data. List of supported indicators can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>.
|
2873
|
+
# @param symbol [String] symbol
|
2874
|
+
# @param resolution [String] Supported resolution includes <code>1, 5, 15, 30, 60, D, W, M </code>.Some timeframes might not be available depending on the exchange.
|
2875
|
+
# @param from [Integer] UNIX timestamp. Interval initial value.
|
2876
|
+
# @param to [Integer] UNIX timestamp. Interval end value.
|
2877
|
+
# @param indicator [String] Indicator name. Full list can be found <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">here</a>.
|
2878
|
+
# @param [Hash] opts the optional parameters
|
2879
|
+
# @option opts [Object] :indicator_fields Check out <a href=\"https://docs.google.com/spreadsheets/d/1ylUvKHVYN2E87WdwIza8ROaCpd48ggEl1k5i5SgA29k/edit?usp=sharing\" target=\"_blank\">this page</a> to see which indicators and params are supported.
|
2880
|
+
# @return [Array<(Object, Integer, Hash)>] Object data, response status code and response headers
|
2881
|
+
def technical_indicator_with_http_info(symbol, resolution, from, to, indicator, opts = {})
|
2882
|
+
if @api_client.config.debugging
|
2883
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.technical_indicator ...'
|
2884
|
+
end
|
2885
|
+
# verify the required parameter 'symbol' is set
|
2886
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
2887
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.technical_indicator"
|
2888
|
+
end
|
2889
|
+
# verify the required parameter 'resolution' is set
|
2890
|
+
if @api_client.config.client_side_validation && resolution.nil?
|
2891
|
+
fail ArgumentError, "Missing the required parameter 'resolution' when calling DefaultApi.technical_indicator"
|
2892
|
+
end
|
2893
|
+
# verify the required parameter 'from' is set
|
2894
|
+
if @api_client.config.client_side_validation && from.nil?
|
2895
|
+
fail ArgumentError, "Missing the required parameter 'from' when calling DefaultApi.technical_indicator"
|
2896
|
+
end
|
2897
|
+
# verify the required parameter 'to' is set
|
2898
|
+
if @api_client.config.client_side_validation && to.nil?
|
2899
|
+
fail ArgumentError, "Missing the required parameter 'to' when calling DefaultApi.technical_indicator"
|
2900
|
+
end
|
2901
|
+
# verify the required parameter 'indicator' is set
|
2902
|
+
if @api_client.config.client_side_validation && indicator.nil?
|
2903
|
+
fail ArgumentError, "Missing the required parameter 'indicator' when calling DefaultApi.technical_indicator"
|
2904
|
+
end
|
2905
|
+
# resource path
|
2906
|
+
local_var_path = '/indicator'
|
2907
|
+
|
2908
|
+
# query parameters
|
2909
|
+
query_params = opts[:query_params] || {}
|
2910
|
+
query_params[:'symbol'] = symbol
|
2911
|
+
query_params[:'resolution'] = resolution
|
2912
|
+
query_params[:'from'] = from
|
2913
|
+
query_params[:'to'] = to
|
2914
|
+
query_params[:'indicator'] = indicator
|
2915
|
+
|
2916
|
+
# header parameters
|
2917
|
+
header_params = opts[:header_params] || {}
|
2918
|
+
# HTTP header 'Accept' (if needed)
|
2919
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2920
|
+
# HTTP header 'Content-Type'
|
2921
|
+
header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])
|
2922
|
+
|
2923
|
+
# form parameters
|
2924
|
+
form_params = opts[:form_params] || {}
|
2925
|
+
|
2926
|
+
# http body (model)
|
2927
|
+
post_body = opts[:body] || @api_client.object_to_http_body(opts[:'indicator_fields'])
|
2928
|
+
|
2929
|
+
# return_type
|
2930
|
+
return_type = opts[:return_type] || 'Object'
|
2931
|
+
|
2932
|
+
# auth_names
|
2933
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2934
|
+
|
2935
|
+
new_options = opts.merge(
|
2936
|
+
:header_params => header_params,
|
2937
|
+
:query_params => query_params,
|
2938
|
+
:form_params => form_params,
|
2939
|
+
:body => post_body,
|
2940
|
+
:auth_names => auth_names,
|
2941
|
+
:return_type => return_type
|
2942
|
+
)
|
2943
|
+
|
2944
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
2945
|
+
if @api_client.config.debugging
|
2946
|
+
@api_client.config.logger.debug "API called: DefaultApi#technical_indicator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
2947
|
+
end
|
2948
|
+
return data, status_code, headers
|
2949
|
+
end
|
2950
|
+
|
2951
|
+
# Earnings Call Transcripts
|
2952
|
+
# <p>Get earnings call transcripts, audio and participants' list. This endpoint is only available for US companies. <p>17+ years of data is available with 170,000+ audio which add up to 6TB in size.</p>
|
2953
|
+
# @param id [String] Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>.
|
2954
|
+
# @param [Hash] opts the optional parameters
|
2955
|
+
# @return [EarningsCallTranscripts]
|
2956
|
+
def transcripts(id, opts = {})
|
2957
|
+
data, _status_code, _headers = transcripts_with_http_info(id, opts)
|
2958
|
+
data
|
2959
|
+
end
|
2960
|
+
|
2961
|
+
# Earnings Call Transcripts
|
2962
|
+
# <p>Get earnings call transcripts, audio and participants' list. This endpoint is only available for US companies. <p>17+ years of data is available with 170,000+ audio which add up to 6TB in size.</p>
|
2963
|
+
# @param id [String] Transcript's id obtained with <a href=\"#transcripts-list\">Transcripts List endpoint</a>.
|
2964
|
+
# @param [Hash] opts the optional parameters
|
2965
|
+
# @return [Array<(EarningsCallTranscripts, Integer, Hash)>] EarningsCallTranscripts data, response status code and response headers
|
2966
|
+
def transcripts_with_http_info(id, opts = {})
|
2967
|
+
if @api_client.config.debugging
|
2968
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.transcripts ...'
|
2969
|
+
end
|
2970
|
+
# verify the required parameter 'id' is set
|
2971
|
+
if @api_client.config.client_side_validation && id.nil?
|
2972
|
+
fail ArgumentError, "Missing the required parameter 'id' when calling DefaultApi.transcripts"
|
2973
|
+
end
|
2974
|
+
# resource path
|
2975
|
+
local_var_path = '/stock/transcripts'
|
2976
|
+
|
2977
|
+
# query parameters
|
2978
|
+
query_params = opts[:query_params] || {}
|
2979
|
+
query_params[:'id'] = id
|
2980
|
+
|
2981
|
+
# header parameters
|
2982
|
+
header_params = opts[:header_params] || {}
|
2983
|
+
# HTTP header 'Accept' (if needed)
|
2984
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
2985
|
+
|
2986
|
+
# form parameters
|
2987
|
+
form_params = opts[:form_params] || {}
|
2988
|
+
|
2989
|
+
# http body (model)
|
2990
|
+
post_body = opts[:body]
|
2991
|
+
|
2992
|
+
# return_type
|
2993
|
+
return_type = opts[:return_type] || 'EarningsCallTranscripts'
|
2994
|
+
|
2995
|
+
# auth_names
|
2996
|
+
auth_names = opts[:auth_names] || ['api_key']
|
2997
|
+
|
2998
|
+
new_options = opts.merge(
|
2999
|
+
:header_params => header_params,
|
3000
|
+
:query_params => query_params,
|
3001
|
+
:form_params => form_params,
|
3002
|
+
:body => post_body,
|
3003
|
+
:auth_names => auth_names,
|
3004
|
+
:return_type => return_type
|
3005
|
+
)
|
3006
|
+
|
3007
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
3008
|
+
if @api_client.config.debugging
|
3009
|
+
@api_client.config.logger.debug "API called: DefaultApi#transcripts\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
3010
|
+
end
|
3011
|
+
return data, status_code, headers
|
3012
|
+
end
|
3013
|
+
|
3014
|
+
# Earnings Call Transcripts List
|
3015
|
+
# List earnings call transcripts' metadata. This endpoint is only available for US companies.
|
3016
|
+
# @param symbol [String] Company symbol: AAPL. Leave empty to list the latest transcripts
|
3017
|
+
# @param [Hash] opts the optional parameters
|
3018
|
+
# @return [EarningsCallTranscriptsList]
|
3019
|
+
def transcripts_list(symbol, opts = {})
|
3020
|
+
data, _status_code, _headers = transcripts_list_with_http_info(symbol, opts)
|
3021
|
+
data
|
3022
|
+
end
|
3023
|
+
|
3024
|
+
# Earnings Call Transcripts List
|
3025
|
+
# List earnings call transcripts' metadata. This endpoint is only available for US companies.
|
3026
|
+
# @param symbol [String] Company symbol: AAPL. Leave empty to list the latest transcripts
|
3027
|
+
# @param [Hash] opts the optional parameters
|
3028
|
+
# @return [Array<(EarningsCallTranscriptsList, Integer, Hash)>] EarningsCallTranscriptsList data, response status code and response headers
|
3029
|
+
def transcripts_list_with_http_info(symbol, opts = {})
|
3030
|
+
if @api_client.config.debugging
|
3031
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.transcripts_list ...'
|
3032
|
+
end
|
3033
|
+
# verify the required parameter 'symbol' is set
|
3034
|
+
if @api_client.config.client_side_validation && symbol.nil?
|
3035
|
+
fail ArgumentError, "Missing the required parameter 'symbol' when calling DefaultApi.transcripts_list"
|
3036
|
+
end
|
3037
|
+
# resource path
|
3038
|
+
local_var_path = '/stock/transcripts/list'
|
3039
|
+
|
3040
|
+
# query parameters
|
3041
|
+
query_params = opts[:query_params] || {}
|
3042
|
+
query_params[:'symbol'] = symbol
|
3043
|
+
|
3044
|
+
# header parameters
|
3045
|
+
header_params = opts[:header_params] || {}
|
3046
|
+
# HTTP header 'Accept' (if needed)
|
3047
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
3048
|
+
|
3049
|
+
# form parameters
|
3050
|
+
form_params = opts[:form_params] || {}
|
3051
|
+
|
3052
|
+
# http body (model)
|
3053
|
+
post_body = opts[:body]
|
3054
|
+
|
3055
|
+
# return_type
|
3056
|
+
return_type = opts[:return_type] || 'EarningsCallTranscriptsList'
|
3057
|
+
|
3058
|
+
# auth_names
|
3059
|
+
auth_names = opts[:auth_names] || ['api_key']
|
3060
|
+
|
3061
|
+
new_options = opts.merge(
|
3062
|
+
:header_params => header_params,
|
3063
|
+
:query_params => query_params,
|
3064
|
+
:form_params => form_params,
|
3065
|
+
:body => post_body,
|
3066
|
+
:auth_names => auth_names,
|
3067
|
+
:return_type => return_type
|
3068
|
+
)
|
3069
|
+
|
3070
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
3071
|
+
if @api_client.config.debugging
|
3072
|
+
@api_client.config.logger.debug "API called: DefaultApi#transcripts_list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
3073
|
+
end
|
3074
|
+
return data, status_code, headers
|
3075
|
+
end
|
3076
|
+
|
3077
|
+
# Stock Upgrade/Downgrade
|
3078
|
+
# Get latest stock upgrade and downgrade.
|
3079
|
+
# @param [Hash] opts the optional parameters
|
3080
|
+
# @option opts [String] :symbol Symbol of the company: AAPL. If left blank, the API will return latest stock upgrades/downgrades.
|
3081
|
+
# @option opts [Date] :from From date: 2000-03-15.
|
3082
|
+
# @option opts [Date] :to To date: 2020-03-16.
|
3083
|
+
# @return [Array<UpgradeDowngrade>]
|
3084
|
+
def upgrade_downgrade(opts = {})
|
3085
|
+
data, _status_code, _headers = upgrade_downgrade_with_http_info(opts)
|
3086
|
+
data
|
3087
|
+
end
|
3088
|
+
|
3089
|
+
# Stock Upgrade/Downgrade
|
3090
|
+
# Get latest stock upgrade and downgrade.
|
3091
|
+
# @param [Hash] opts the optional parameters
|
3092
|
+
# @option opts [String] :symbol Symbol of the company: AAPL. If left blank, the API will return latest stock upgrades/downgrades.
|
3093
|
+
# @option opts [Date] :from From date: 2000-03-15.
|
3094
|
+
# @option opts [Date] :to To date: 2020-03-16.
|
3095
|
+
# @return [Array<(Array<UpgradeDowngrade>, Integer, Hash)>] Array<UpgradeDowngrade> data, response status code and response headers
|
3096
|
+
def upgrade_downgrade_with_http_info(opts = {})
|
3097
|
+
if @api_client.config.debugging
|
3098
|
+
@api_client.config.logger.debug 'Calling API: DefaultApi.upgrade_downgrade ...'
|
3099
|
+
end
|
3100
|
+
# resource path
|
3101
|
+
local_var_path = '/stock/upgrade-downgrade'
|
3102
|
+
|
3103
|
+
# query parameters
|
3104
|
+
query_params = opts[:query_params] || {}
|
3105
|
+
query_params[:'symbol'] = opts[:'symbol'] if !opts[:'symbol'].nil?
|
3106
|
+
query_params[:'from'] = opts[:'from'] if !opts[:'from'].nil?
|
3107
|
+
query_params[:'to'] = opts[:'to'] if !opts[:'to'].nil?
|
3108
|
+
|
3109
|
+
# header parameters
|
3110
|
+
header_params = opts[:header_params] || {}
|
3111
|
+
# HTTP header 'Accept' (if needed)
|
3112
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
3113
|
+
|
3114
|
+
# form parameters
|
3115
|
+
form_params = opts[:form_params] || {}
|
3116
|
+
|
3117
|
+
# http body (model)
|
3118
|
+
post_body = opts[:body]
|
3119
|
+
|
3120
|
+
# return_type
|
3121
|
+
return_type = opts[:return_type] || 'Array<UpgradeDowngrade>'
|
3122
|
+
|
3123
|
+
# auth_names
|
3124
|
+
auth_names = opts[:auth_names] || ['api_key']
|
3125
|
+
|
3126
|
+
new_options = opts.merge(
|
3127
|
+
:header_params => header_params,
|
3128
|
+
:query_params => query_params,
|
3129
|
+
:form_params => form_params,
|
3130
|
+
:body => post_body,
|
3131
|
+
:auth_names => auth_names,
|
3132
|
+
:return_type => return_type
|
3133
|
+
)
|
3134
|
+
|
3135
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
3136
|
+
if @api_client.config.debugging
|
3137
|
+
@api_client.config.logger.debug "API called: DefaultApi#upgrade_downgrade\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
3138
|
+
end
|
3139
|
+
return data, status_code, headers
|
3140
|
+
end
|
3141
|
+
end
|
3142
|
+
end
|