iex-ruby-client 1.1.1 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/.env.sample +2 -0
  3. data/.github/FUNDING.yml +1 -0
  4. data/.rubocop_todo.yml +0 -8
  5. data/CHANGELOG.md +49 -12
  6. data/Dangerfile +2 -2
  7. data/Gemfile +3 -2
  8. data/README.md +276 -20
  9. data/RELEASING.md +2 -2
  10. data/iex-ruby-client.gemspec +2 -1
  11. data/lib/iex/api.rb +8 -1
  12. data/lib/iex/api/client.rb +15 -2
  13. data/lib/iex/api/config/client.rb +52 -0
  14. data/lib/iex/api/config/logger.rb +35 -0
  15. data/lib/iex/cloud/connection.rb +22 -19
  16. data/lib/iex/cloud/response.rb +1 -1
  17. data/lib/iex/endpoints/advanced_stats.rb +11 -0
  18. data/lib/iex/endpoints/balance_sheet.rb +13 -0
  19. data/lib/iex/endpoints/cash_flow.rb +13 -0
  20. data/lib/iex/endpoints/historial_prices.rb +30 -0
  21. data/lib/iex/endpoints/ref_data.rb +27 -0
  22. data/lib/iex/endpoints/stock_market.rb +11 -0
  23. data/lib/iex/resources.rb +6 -0
  24. data/lib/iex/resources/advanced_stats.rb +84 -0
  25. data/lib/iex/resources/balance_sheet.rb +60 -0
  26. data/lib/iex/resources/cash_flow.rb +43 -0
  27. data/lib/iex/resources/historical_prices.rb +31 -0
  28. data/lib/iex/resources/income.rb +2 -0
  29. data/lib/iex/resources/key_stats.rb +1 -1
  30. data/lib/iex/resources/news.rb +3 -0
  31. data/lib/iex/resources/quote.rb +12 -2
  32. data/lib/iex/resources/resource.rb +12 -0
  33. data/lib/iex/resources/symbol.rb +10 -0
  34. data/lib/iex/resources/symbols.rb +19 -0
  35. data/lib/iex/version.rb +1 -1
  36. data/spec/fixtures/iex/advanced_stats/invalid.yml +50 -0
  37. data/spec/fixtures/iex/advanced_stats/msft.yml +57 -0
  38. data/spec/fixtures/iex/balance_sheet/invalid.yml +50 -0
  39. data/spec/fixtures/iex/balance_sheet/msft.yml +56 -0
  40. data/spec/fixtures/iex/cash_flow/invalid.yml +50 -0
  41. data/spec/fixtures/iex/cash_flow/msft.yml +56 -0
  42. data/spec/fixtures/iex/historical_prices/abcd.yml +56 -0
  43. data/spec/fixtures/iex/historical_prices/invalid.yml +50 -0
  44. data/spec/fixtures/iex/historical_prices/invalid_date.yml +50 -0
  45. data/spec/fixtures/iex/historical_prices/invalid_range.yml +47 -0
  46. data/spec/fixtures/iex/historical_prices/msft.yml +79 -0
  47. data/spec/fixtures/iex/historical_prices/msft_5d.yml +61 -0
  48. data/spec/fixtures/iex/historical_prices/msft_date_and_chart_by_day.yml +57 -0
  49. data/spec/fixtures/iex/historical_prices/msft_specific_date_trimmed.yml +445 -0
  50. data/spec/fixtures/iex/income/msft.yml +54 -51
  51. data/spec/fixtures/iex/ref-data/exchange_symbols.yml +1926 -0
  52. data/spec/fixtures/iex/ref-data/isin.yml +9 -9
  53. data/spec/fixtures/iex/ref-data/isin_mapped.yml +57 -0
  54. data/spec/fixtures/iex/ref-data/symbols.yml +9002 -0
  55. data/spec/fixtures/iex/ref-data/wrong_isin_mapped.yml +57 -0
  56. data/spec/fixtures/iex/stock_market/list_mostactive.yml +76 -0
  57. data/spec/iex/client_spec.rb +96 -13
  58. data/spec/iex/config/client_spec.rb +49 -0
  59. data/spec/iex/config/logger_spec.rb +46 -0
  60. data/spec/iex/endpoints/advanced_stats_spec.rb +110 -0
  61. data/spec/iex/endpoints/balance_sheet_spec.rb +80 -0
  62. data/spec/iex/endpoints/cash_flow_spec.rb +59 -0
  63. data/spec/iex/endpoints/historical_prices_spec.rb +206 -0
  64. data/spec/iex/endpoints/income_spec.rb +31 -29
  65. data/spec/iex/endpoints/key_stats_spec.rb +1 -0
  66. data/spec/iex/endpoints/news_spec.rb +3 -0
  67. data/spec/iex/endpoints/quote_spec.rb +2 -0
  68. data/spec/iex/endpoints/ref_data_spec.rb +103 -8
  69. data/spec/iex/endpoints/stock_market_spec.rb +14 -0
  70. data/spec/iex/resources/resource_spec.rb +36 -0
  71. data/spec/spec_helper.rb +3 -3
  72. metadata +74 -9
  73. data/lib/iex/api/config.rb +0 -47
  74. data/spec/iex/config_spec.rb +0 -22
@@ -0,0 +1,60 @@
1
+ module IEX
2
+ module Resources
3
+ class BalanceSheet < Resource
4
+ property 'report_date', from: 'reportDate'
5
+ property 'fiscal_date', from: 'fiscalDate'
6
+ property 'currency'
7
+ property 'current_cash', from: 'currentCash'
8
+ property 'current_cash_dollar', from: 'currentCash', with: ->(v) { to_dollar(amount: v) }
9
+ property 'short_term_investments', from: 'shortTermInvestments'
10
+ property 'short_term_investments_dollar', from: 'shortTermInvestments', with: ->(v) { to_dollar(amount: v) }
11
+ property 'receivables'
12
+ property 'receivables_dollar', from: 'receivables', with: ->(v) { to_dollar(amount: v) }
13
+ property 'inventory'
14
+ property 'inventory_dollar', from: 'inventory', with: ->(v) { to_dollar(amount: v) }
15
+ property 'other_current_assets', from: 'otherCurrentAssets'
16
+ property 'other_current_assets_dollar', from: 'otherCurrentAssets', with: ->(v) { to_dollar(amount: v) }
17
+ property 'current_assets', from: 'currentAssets'
18
+ property 'current_assets_dollar', from: 'currentAssets', with: ->(v) { to_dollar(amount: v) }
19
+ property 'long_term_investments', from: 'longTermInvestments'
20
+ property 'long_term_investments_dollar', from: 'longTermInvestments', with: ->(v) { to_dollar(amount: v) }
21
+ property 'property_plant_equipment', from: 'propertyPlantEquipment'
22
+ property 'property_plant_equipment_dollar', from: 'propertyPlantEquipment', with: ->(v) { to_dollar(amount: v) }
23
+ property 'goodwill'
24
+ property 'goodwill_dollar', from: 'goodwill', with: ->(v) { to_dollar(amount: v) }
25
+ property 'intangible_assets', from: 'intangibleAssets'
26
+ property 'intangible_assets_dollar', from: 'intangibleAssets', with: ->(v) { to_dollar(amount: v) }
27
+ property 'other_assets', from: 'otherAssets'
28
+ property 'other_assets_dollar', from: 'otherAssets', with: ->(v) { to_dollar(amount: v) }
29
+ property 'total_assets', from: 'totalAssets'
30
+ property 'total_assets_dollar', from: 'totalAssets', with: ->(v) { to_dollar(amount: v) }
31
+ property 'accounts_payable', from: 'accountsPayable'
32
+ property 'accounts_payable_dollar', from: 'accountsPayable', with: ->(v) { to_dollar(amount: v) }
33
+ property 'current_long_term_debt', from: 'currentLongTermDebt'
34
+ property 'current_long_term_debt_dollar', from: 'currentLongTermDebt', with: ->(v) { to_dollar(amount: v) }
35
+ property 'other_current_liabilities', from: 'otherCurrentLiabilities'
36
+ property 'other_current_liabilities_dollar', from: 'otherCurrentLiabilities', with: ->(v) { to_dollar(amount: v) }
37
+ property 'total_current_liabilities', from: 'totalCurrentLiabilities'
38
+ property 'total_current_liabilities_dollar', from: 'totalCurrentLiabilities', with: ->(v) { to_dollar(amount: v) }
39
+ property 'long_term_debt', from: 'longTermDebt'
40
+ property 'long_term_debt_dollar', from: 'longTermDebt', with: ->(v) { to_dollar(amount: v) }
41
+ property 'other_liabilities', from: 'otherLiabilities'
42
+ property 'other_liabilities_dollar', from: 'otherLiabilities', with: ->(v) { to_dollar(amount: v) }
43
+ property 'minority_interest', from: 'minorityInterest'
44
+ property 'minority_interest_dollar', from: 'minorityInterest', with: ->(v) { to_dollar(amount: v) }
45
+ property 'total_liabilities', from: 'totalLiabilities'
46
+ property 'total_liabilities_dollar', from: 'totalLiabilities', with: ->(v) { to_dollar(amount: v) }
47
+ property 'common_stock', from: 'commonStock'
48
+ property 'retained_earnings', from: 'retainedEarnings'
49
+ property 'retained_earnings_dollar', from: 'retainedEarnings', with: ->(v) { to_dollar(amount: v) }
50
+ property 'treasury_stock', from: 'treasuryStock'
51
+ property 'treasury_stock_dollar', from: 'treasuryStock', with: ->(v) { to_dollar(amount: v) }
52
+ property 'capital_surplus', from: 'capitalSurplus'
53
+ property 'capital_surplus_dollar', from: 'capitalSurplus', with: ->(v) { to_dollar(amount: v) }
54
+ property 'shareholder_equity', from: 'shareholderEquity'
55
+ property 'shareholder_equity_dollar', from: 'shareholderEquity', with: ->(v) { to_dollar(amount: v) }
56
+ property 'net_tangible_assets', from: 'netTangibleAssets'
57
+ property 'net_tangible_assets_dollar', from: 'netTangibleAssets', with: ->(v) { to_dollar(amount: v) }
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,43 @@
1
+ module IEX
2
+ module Resources
3
+ class CashFlow < Resource
4
+ property 'report_date', from: 'reportDate'
5
+ property 'fiscal_date', from: 'fiscalDate'
6
+ property 'currency'
7
+ property 'net_income', from: 'netIncome'
8
+ property 'net_income_dollar', from: 'netIncome', with: ->(v) { to_dollar(amount: v) }
9
+ property 'depreciation'
10
+ property 'depreciation_dollar', from: 'depreciation', with: ->(v) { to_dollar(amount: v) }
11
+ property 'changes_in_receivables', from: 'changesInReceivables'
12
+ property 'changes_in_receivables_dollar', from: 'changesInReceivables', with: ->(v) { to_dollar(amount: v) }
13
+ property 'changes_in_inventories', from: 'changesInInventories'
14
+ property 'changes_in_inventories_dollar', from: 'changesInInventories', with: ->(v) { to_dollar(amount: v) }
15
+ property 'cash_change', from: 'cashChange'
16
+ property 'cash_change_dollar', from: 'cashChange', with: ->(v) { to_dollar(amount: v) }
17
+ property 'cash_flow', from: 'cashFlow'
18
+ property 'cash_flow_dollar', from: 'cashFlow', with: ->(v) { to_dollar(amount: v) }
19
+ property 'capital_expenditures', from: 'capitalExpenditures'
20
+ property 'capital_expenditures_dollar', from: 'capitalExpenditures', with: ->(v) { to_dollar(amount: v) }
21
+ property 'investments'
22
+ property 'investments_dollar', from: 'investments', with: ->(v) { to_dollar(amount: v) }
23
+ property 'investing_activity_other', from: 'investingActivityOther'
24
+ property 'investing_activity_other_dollar', from: 'investingActivityOther', with: ->(v) { to_dollar(amount: v) }
25
+ property 'total_investing_cash_flows', from: 'totalInvestingCashFlows'
26
+ property 'total_investing_cash_flows_dollar', from: 'totalInvestingCashFlows', with: ->(v) { to_dollar(amount: v) }
27
+ property 'dividends_paid', from: 'dividendsPaid'
28
+ property 'dividends_paid_dollar', from: 'dividendsPaid', with: ->(v) { to_dollar(amount: v) }
29
+ property 'net_borrowings', from: 'netBorrowings'
30
+ property 'net_borrowings_dollar', from: 'netBorrowings', with: ->(v) { to_dollar(amount: v) }
31
+ property 'other_financing_cash_flows', from: 'otherFinancingCashFlows'
32
+ property 'other_financing_cash_flows_dollar', from: 'otherFinancingCashFlows', with: ->(v) { to_dollar(amount: v) }
33
+ property 'cash_flow_financing', from: 'cashFlowFinancing'
34
+ property 'cash_flow_financing_dollar', from: 'cashFlowFinancing', with: ->(v) { to_dollar(amount: v) }
35
+ property 'exchange_rate_effect', from: 'exchangeRateEffect'
36
+ property 'exchange_rate_effect_dollar', from: 'exchangeRateEffect', with: ->(v) { to_dollar(amount: v) }
37
+
38
+ def initialize(data = {})
39
+ super
40
+ end
41
+ end
42
+ end
43
+ end
@@ -0,0 +1,31 @@
1
+ module IEX
2
+ module Resources
3
+ class HistorialPrices < Resource
4
+ property 'date'
5
+ property 'open'
6
+ property 'open_dollar', from: 'open', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
7
+ property 'close'
8
+ property 'close_dollar', from: 'close', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
9
+ property 'high'
10
+ property 'high_dollar', from: 'high', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
11
+ property 'low'
12
+ property 'low_dollar', from: 'low', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
13
+ property 'volume'
14
+ property 'u_open', from: 'uOpen'
15
+ property 'u_open_dollar', from: 'uOpen', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
16
+ property 'u_close', from: 'uClose'
17
+ property 'u_close_dollar', from: 'uClose', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
18
+ property 'u_low', from: 'uLow'
19
+ property 'u_low_dollar', from: 'uLow', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
20
+ property 'u_high', from: 'uHigh'
21
+ property 'u_high_dollar', from: 'uHigh', with: ->(v) { to_dollar(amount: v, ignore_cents: false) }
22
+ property 'u_volume', from: 'uVolume'
23
+ property 'change'
24
+ property 'change_percent', from: 'changePercent'
25
+ property 'change_percent_s', from: 'changePercent', with: ->(v) { percentage_to_string(v) }
26
+ property 'label'
27
+ property 'change_over_time', from: 'changeOverTime'
28
+ property 'change_over_time_s', from: 'changeOverTime', with: ->(v) { percentage_to_string(v) }
29
+ end
30
+ end
31
+ end
@@ -2,6 +2,8 @@ module IEX
2
2
  module Resources
3
3
  class Income < Resource
4
4
  property 'report_date', from: 'reportDate'
5
+ property 'fiscal_date', from: 'fiscalDate'
6
+ property 'currency'
5
7
  property 'total_revenue', from: 'totalRevenue'
6
8
  property 'total_revenue_dollar', from: 'totalRevenue', with: ->(v) { to_dollar(amount: v) }
7
9
  property 'cost_of_revenue', from: 'costOfRevenue'
@@ -8,7 +8,7 @@ module IEX
8
8
  property 'week_52_high_dollar', from: 'week52high', with: ->(v) { Resource.to_dollar(amount: v, ignore_cents: false) }
9
9
  property 'week_52_low', from: 'week52low'
10
10
  property 'week_52_low_dollar', from: 'week52low', with: ->(v) { Resource.to_dollar(amount: v, ignore_cents: false) }
11
- property 'week_52_change'
11
+ property 'week_52_change', from: 'week52change'
12
12
  property 'week_52_change_dollar', from: 'week52change', with: ->(v) { Resource.to_dollar(amount: v, ignore_cents: false) }
13
13
  property 'dividend_yield', from: 'dividendYield'
14
14
  property 'ex_dividend_date', from: 'exDividendDate'
@@ -6,7 +6,10 @@ module IEX
6
6
  property 'source'
7
7
  property 'url'
8
8
  property 'summary'
9
+ property 'image'
9
10
  property 'related', transform_with: ->(v) { v.split(',') if v.is_a?(String) }
11
+ property 'paywalled', from: 'hasPaywall'
12
+ property 'language', from: 'lang'
10
13
  end
11
14
  end
12
15
  end
@@ -24,8 +24,18 @@ module IEX
24
24
  property 'iex_last_updated_t', from: 'iexLastUpdated', with: ->(v) { v&.positive? ? Time.at(v / 1000) : nil } # last update time of the data
25
25
  property 'delayed_price', from: 'delayedPrice' # 15 minute delayed market price
26
26
  property 'delayed_price_time', from: 'delayedPriceTime' # time of the delayed market price
27
- property 'extended_price', from: 'extendedPrice' # ?
28
- property 'extended_price_time', from: 'extendedPriceTime' # ?
27
+ property 'extended_price', from: 'extendedPrice' # the pre market and post market price
28
+ property 'extended_change_percent', from: 'extendedChangePercent' # price change percent between extended_price and latest_price
29
+ property 'extended_change_percent_s', from: 'extendedChangePercent', with: lambda { |v|
30
+ if v
31
+ [
32
+ v.positive? ? '+' : '',
33
+ format('%.2f', v * 100),
34
+ '%'
35
+ ].join
36
+ end
37
+ } # change in percent as a String with a leading + or - sign
38
+ property 'extended_price_time', from: 'extendedPriceTime' # the last update time of extended_price
29
39
  property 'previous_close', from: 'previousClose' # adjusted close price of the last trading day of the stock
30
40
  property 'change' # change in value, calculated using calculation_price from previous_close
31
41
  property 'change_percent', from: 'changePercent' # change in percent, calculated using calculation_price from previous_close
@@ -14,6 +14,18 @@ module IEX
14
14
  ].join
15
15
  end
16
16
 
17
+ # Useful for values that are already a percent but we want to convert into a 2 decimal place string
18
+ def self.percentage_to_string(float_percent)
19
+ return unless float_percent.is_a? Numeric
20
+ return '+0.00%' if float_percent.zero?
21
+
22
+ [
23
+ float_percent.positive? ? '+' : '',
24
+ format('%.2f', float_percent),
25
+ '%'
26
+ ].join
27
+ end
28
+
17
29
  def self.to_dollar(amount:, ignore_cents: true)
18
30
  MoneyHelper.money_to_text(amount, 'USD', nil, no_cents: ignore_cents)
19
31
  end
@@ -0,0 +1,10 @@
1
+ module IEX
2
+ module Resources
3
+ class Symbol < Resource
4
+ property 'exchange'
5
+ property 'iex_id', from: 'iexId'
6
+ property 'region'
7
+ property 'symbol'
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,19 @@
1
+ module IEX
2
+ module Resources
3
+ class Symbols < Resource
4
+ property 'symbol'
5
+ property 'exchange'
6
+ property 'name'
7
+ property 'date', transform_with: ->(v) { Date.parse(v) }
8
+ property 'enabled', from: 'isEnabled'
9
+ property 'type'
10
+ property 'region'
11
+ property 'currency'
12
+ property 'iex_id', from: 'iexId'
13
+ property 'figi'
14
+ property 'cik'
15
+
16
+ alias :enabled? enabled
17
+ end
18
+ end
19
+ end
data/lib/iex/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module IEX
2
- VERSION = '1.1.1'.freeze
2
+ VERSION = '1.4.1'.freeze
3
3
  end
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/INVALID/advanced-stats?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.2.1
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 404
21
+ message: Not Found
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Tue, 20 Oct 2020 23:57:05 GMT
27
+ Content-Type:
28
+ - text/html; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=aa7b4e3cbfee43e0a6d8075ad7d24f32; Max-Age=43200; Path=/; Expires=Wed,
35
+ 21 Oct 2020 11:57:05 GMT
36
+ Strict-Transport-Security:
37
+ - max-age=15768000
38
+ Access-Control-Allow-Origin:
39
+ - "*"
40
+ Access-Control-Allow-Credentials:
41
+ - 'true'
42
+ Access-Control-Allow-Methods:
43
+ - GET, OPTIONS
44
+ Access-Control-Allow-Headers:
45
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
46
+ body:
47
+ encoding: ASCII-8BIT
48
+ string: Unknown symbol
49
+ recorded_at: Tue, 20 Oct 2020 23:57:05 GMT
50
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,57 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/MSFT/advanced-stats?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.2.1
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Tue, 20 Oct 2020 23:57:04 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=767762d0898c40be8baf5aaf659ee42b; Max-Age=43200; Path=/; Expires=Wed,
35
+ 21 Oct 2020 11:57:04 GMT
36
+ Iexcloud-Messages-Used:
37
+ - '3005'
38
+ Iexcloud-Premium-Messages-Used:
39
+ - '0'
40
+ X-Content-Type-Options:
41
+ - nosniff
42
+ Strict-Transport-Security:
43
+ - max-age=15768000
44
+ Access-Control-Allow-Origin:
45
+ - "*"
46
+ Access-Control-Allow-Credentials:
47
+ - 'true'
48
+ Access-Control-Allow-Methods:
49
+ - GET, OPTIONS
50
+ Access-Control-Allow-Headers:
51
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
52
+ body:
53
+ encoding: ASCII-8BIT
54
+ string: '{"week52change":0.533539,"week52high":232.86,"week52low":132.52,"marketcap":1621141983000,"employees":163000,"day200MovingAvg":187.72,"day50MovingAvg":212.09,"float":7454581741,"avg10Volume":26989991,"avg30Volume":31404571.1,"ttmEPS":5.8207,"ttmDividendRate":2.04,"companyName":"Microsoft
55
+ Corp.","sharesOutstanding":7567650000,"maxChangePercent":7.1248,"year5ChangePercent":3.3093,"year2ChangePercent":1.0108,"year1ChangePercent":0.572482,"ytdChangePercent":0.367576,"month6ChangePercent":0.229899,"month3ChangePercent":0.082709,"month1ChangePercent":0.082549,"day30ChangePercent":0.025251,"day5ChangePercent":-0.007859,"nextDividendDate":"2020-11-18","dividendYield":0.009522920362244423,"nextEarningsDate":"2020-10-27","exDividendDate":"2020-08-19","peRatio":36.88,"beta":1.1472751624864646,"totalCash":136527000000,"currentDebt":5905000000,"revenue":143015000000,"grossProfit":96937000000,"totalRevenue":143015000000,"EBITDA":65259000000,"revenuePerShare":18.9,"revenuePerEmployee":877392.64,"debtToEquity":0.69,"profitMargin":0.3096248645247002,"enterpriseValue":1607892999000,"enterpriseValueToRevenue":11.24,"priceToSales":11.62,"priceToBook":13.703188252299162,"forwardPERatio":null,"pegRatio":5.6,"peHigh":40.49739130434783,"peLow":23.046956521739133,"week52highDate":"2020-09-02","week52lowDate":"2020-03-23","putCallRatio":0.36251766583920975}'
56
+ recorded_at: Tue, 20 Oct 2020 23:57:04 GMT
57
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,50 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/INVALID/balance-sheet?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.3.1
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 404
21
+ message: Not Found
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 07 Nov 2020 17:58:55 GMT
27
+ Content-Type:
28
+ - text/html; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=0250f7135874468e9c6d193d526f671f; Max-Age=43200; Path=/; Expires=Sun,
35
+ 08 Nov 2020 05:58:55 GMT
36
+ Strict-Transport-Security:
37
+ - max-age=15768000
38
+ Access-Control-Allow-Origin:
39
+ - "*"
40
+ Access-Control-Allow-Credentials:
41
+ - 'true'
42
+ Access-Control-Allow-Methods:
43
+ - GET, OPTIONS
44
+ Access-Control-Allow-Headers:
45
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
46
+ body:
47
+ encoding: ASCII-8BIT
48
+ string: Unknown symbol
49
+ recorded_at: Sat, 07 Nov 2020 17:58:55 GMT
50
+ recorded_with: VCR 6.0.0
@@ -0,0 +1,56 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://cloud.iexapis.com/v1/stock/MSFT/balance-sheet?token=test-iex-api-publishable-token
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ Content-Type:
13
+ - application/json; charset=utf-8
14
+ User-Agent:
15
+ - IEX Ruby Client/1.3.1
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Sat, 07 Nov 2020 17:58:54 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Set-Cookie:
34
+ - ctoken=3f205ff8735442119f697085c8de5813; Max-Age=43200; Path=/; Expires=Sun,
35
+ 08 Nov 2020 05:58:54 GMT
36
+ Iexcloud-Messages-Used:
37
+ - '3000'
38
+ Iexcloud-Premium-Messages-Used:
39
+ - '0'
40
+ X-Content-Type-Options:
41
+ - nosniff
42
+ Strict-Transport-Security:
43
+ - max-age=15768000
44
+ Access-Control-Allow-Origin:
45
+ - "*"
46
+ Access-Control-Allow-Credentials:
47
+ - 'true'
48
+ Access-Control-Allow-Methods:
49
+ - GET, OPTIONS
50
+ Access-Control-Allow-Headers:
51
+ - Origin, X-Requested-With, Content-Type, Accept, Request-Source
52
+ body:
53
+ encoding: ASCII-8BIT
54
+ string: '{"symbol":"MSFT","balancesheet":[{"reportDate":"2020-09-30","fiscalDate":"2020-09-30","currency":"USD","currentCash":17205000000,"shortTermInvestments":120772000000,"receivables":22851000000,"inventory":2705000000,"otherCurrentAssets":13544000000,"currentAssets":177077000000,"longTermInvestments":3196000000,"propertyPlantEquipment":56974000000,"goodwill":43890000000,"intangibleAssets":6923000000,"otherAssets":12941000000,"totalAssets":301001000000,"accountsPayable":12509000000,"currentLongTermDebt":7093000000,"otherCurrentLiabilities":46326000000,"totalCurrentLiabilities":70056000000,"longTermDebt":74379000000,"otherLiabilities":32987000000,"minorityInterest":0,"totalLiabilities":177609000000,"commonStock":7564000000,"retainedEarnings":39193000000,"treasuryStock":null,"capitalSurplus":null,"shareholderEquity":123392000000,"netTangibleAssets":17585000000}]}'
55
+ recorded_at: Sat, 07 Nov 2020 17:58:54 GMT
56
+ recorded_with: VCR 6.0.0