Class: Intrinio::ETFsApi

Inherits:
Object
  • Object
show all
Defined in:
lib/intrinio-sdk/api/et_fs_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ ETFsApi

Returns a new instance of ETFsApi.



19
20
21
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_all_etfs(opts = {}) ⇒ ApiResponseETFs

All ETFs Returns a list of all currently listed ETFs, with relevant identification information including the ETF Name, Ticker, FIGI Ticker, and Exchange MIC for further usage with our ETF Metadata, Holdings, Stats, and Analytics offerings.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :exchange (String)
  • :page_size (Integer)

    The number of results to return (default to 100)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



30
31
32
33
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 30

def get_all_etfs(opts = {})
  data, _status_code, _headers = get_all_etfs_with_http_info(opts)
  return data
end

#get_all_etfs_with_http_info(opts = {}) ⇒ Array<(ApiResponseETFs, Fixnum, Hash)>

All ETFs Returns a list of all currently listed ETFs, with relevant identification information including the ETF Name, Ticker, FIGI Ticker, and Exchange MIC for further usage with our ETF Metadata, Holdings, Stats, and Analytics offerings.

Parameters:

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

    the optional parameters

Options Hash (opts):

  • :exchange (String)
  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseETFs, Fixnum, Hash)>)

    ApiResponseETFs data, response status code and response headers



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 42

def get_all_etfs_with_http_info(opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ETFsApi.get_all_etfs ..."
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ETFsApi.get_all_etfs, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = "/etfs"

  # query parameters
  query_params = {}
  query_params[:'exchange'] = opts[:'exchange'] if !opts[:'exchange'].nil?
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseETFs')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ETFsApi#get_all_etfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_etf(identifier, opts = {}) ⇒ ETF

Lookup ETF Returns classifications and reference data which consists of ~90 columns that give detailed information about an ETF. These granular details include asset class, expense ratio, index name, index weighting scheme, smart beta type and specific investment objectives.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Returns:



88
89
90
91
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 88

def get_etf(identifier, opts = {})
  data, _status_code, _headers = get_etf_with_http_info(identifier, opts)
  return data
end

#get_etf_analytics(identifier, opts = {}) ⇒ ETFAnalytics

ETF Analytics Returns latest market analytics for a specified US ETF, including volume, trailing volume, market cap, 52 week high, and 52 week low.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Returns:



141
142
143
144
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 141

def get_etf_analytics(identifier, opts = {})
  data, _status_code, _headers = get_etf_analytics_with_http_info(identifier, opts)
  return data
end

#get_etf_analytics_with_http_info(identifier, opts = {}) ⇒ Array<(ETFAnalytics, Fixnum, Hash)>

ETF Analytics Returns latest market analytics for a specified US ETF, including volume, trailing volume, market cap, 52 week high, and 52 week low.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Returns:

  • (Array<(ETFAnalytics, Fixnum, Hash)>)

    ETFAnalytics data, response status code and response headers



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 151

def get_etf_analytics_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ETFsApi.get_etf_analytics ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ETFsApi.get_etf_analytics"
  end
  # resource path
  local_var_path = "/etfs/{identifier}/analytics".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ETFAnalytics')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ETFsApi#get_etf_analytics\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_etf_holdings(identifier, opts = {}) ⇒ ApiResponseETFHoldings

ETF Holdings Returns holdings data that details all the constituent securities in each ETF with names, identifiers, and the weights for each security providing granular level transparency.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of results to return (default to 100)

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:



196
197
198
199
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 196

def get_etf_holdings(identifier, opts = {})
  data, _status_code, _headers = get_etf_holdings_with_http_info(identifier, opts)
  return data
end

#get_etf_holdings_with_http_info(identifier, opts = {}) ⇒ Array<(ApiResponseETFHoldings, Fixnum, Hash)>

ETF Holdings Returns holdings data that details all the constituent securities in each ETF with names, identifiers, and the weights for each security providing granular level transparency.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Options Hash (opts):

  • :page_size (Integer)

    The number of results to return

  • :next_page (String)

    Gets the next page of data from a previous API call

Returns:

  • (Array<(ApiResponseETFHoldings, Fixnum, Hash)>)

    ApiResponseETFHoldings data, response status code and response headers



208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 208

def get_etf_holdings_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ETFsApi.get_etf_holdings ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ETFsApi.get_etf_holdings"
  end
  if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 10000
    fail ArgumentError, 'invalid value for "opts[:"page_size"]" when calling ETFsApi.get_etf_holdings, must be smaller than or equal to 10000.'
  end

  # resource path
  local_var_path = "/etfs/{identifier}/holdings".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}
  query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?
  query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil?

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseETFHoldings')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ETFsApi#get_etf_holdings\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_etf_stats(identifier, opts = {}) ⇒ ETFStats

Exchange Traded Fund (ETF) stats Returns comprehensive key US ETF performance statistics, including prices, NAVs, flows, returns, and much more for both trailing and calendar year periods.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Returns:



257
258
259
260
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 257

def get_etf_stats(identifier, opts = {})
  data, _status_code, _headers = get_etf_stats_with_http_info(identifier, opts)
  return data
end

#get_etf_stats_with_http_info(identifier, opts = {}) ⇒ Array<(ETFStats, Fixnum, Hash)>

Exchange Traded Fund (ETF) stats Returns comprehensive key US ETF performance statistics, including prices, NAVs, flows, returns, and much more for both trailing and calendar year periods.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Returns:

  • (Array<(ETFStats, Fixnum, Hash)>)

    ETFStats data, response status code and response headers



267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 267

def get_etf_stats_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ETFsApi.get_etf_stats ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ETFsApi.get_etf_stats"
  end
  # resource path
  local_var_path = "/etfs/{identifier}/stats".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ETFStats')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ETFsApi#get_etf_stats\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#get_etf_with_http_info(identifier, opts = {}) ⇒ Array<(ETF, Fixnum, Hash)>

Lookup ETF Returns classifications and reference data which consists of ~90 columns that give detailed information about an ETF. These granular details include asset class, expense ratio, index name, index weighting scheme, smart beta type and specific investment objectives.

Parameters:

  • identifier

    An ETF identifier (Ticker, Figi Ticker, ISIN, RIC, Intrinio ID)

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

    the optional parameters

Returns:

  • (Array<(ETF, Fixnum, Hash)>)

    ETF data, response status code and response headers



98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 98

def get_etf_with_http_info(identifier, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ETFsApi.get_etf ..."
  end
  # verify the required parameter 'identifier' is set
  if @api_client.config.client_side_validation && identifier.nil?
    fail ArgumentError, "Missing the required parameter 'identifier' when calling ETFsApi.get_etf"
  end
  # resource path
  local_var_path = "/etfs/{identifier}".sub('{' + 'identifier' + '}', identifier.to_s)

  # query parameters
  query_params = {}

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ETF')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ETFsApi#get_etf\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end

#search_etfs(query, opts = {}) ⇒ ApiResponseETFs

Search ETFs Accepts a string of keyword combinations, and searches across the ETF name and ticker and returns a list of ETFs with related keywords.

Parameters:

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

    the optional parameters

Returns:



310
311
312
313
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 310

def search_etfs(query, opts = {})
  data, _status_code, _headers = search_etfs_with_http_info(query, opts)
  return data
end

#search_etfs_with_http_info(query, opts = {}) ⇒ Array<(ApiResponseETFs, Fixnum, Hash)>

Search ETFs Accepts a string of keyword combinations, and searches across the ETF name and ticker and returns a list of ETFs with related keywords.

Parameters:

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

    the optional parameters

Returns:

  • (Array<(ApiResponseETFs, Fixnum, Hash)>)

    ApiResponseETFs data, response status code and response headers



320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
# File 'lib/intrinio-sdk/api/et_fs_api.rb', line 320

def search_etfs_with_http_info(query, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug "Calling API: ETFsApi.search_etfs ..."
  end
  # verify the required parameter 'query' is set
  if @api_client.config.client_side_validation && query.nil?
    fail ArgumentError, "Missing the required parameter 'query' when calling ETFsApi.search_etfs"
  end
  # resource path
  local_var_path = "/etfs/search"

  # query parameters
  query_params = {}
  query_params[:'query'] = query

  # header parameters
  header_params = {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = {}

  # http body (model)
  post_body = nil
  auth_names = ['ApiKeyAuth']
  data, status_code, headers = @api_client.call_api(:GET, local_var_path,
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => 'ApiResponseETFs')
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: ETFsApi#search_etfs\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end