Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
# Change Log

## [0.4.1] - 2026-02-13

- Add `fifty_two_week_high` and `fifty_two_week_low` fields to quote data

## [0.4.0] - 2026-02-12

- Add dividend history fetching via chart API (`get_dividend_history`)
- Update README with bulk quotes, dividend history, and caching docs

## [0.3.1] - 2026-02-12

- Add `ex_dividend_date` and `dividend_date` fields to quote data

## [0.3.0] - 2026-02-10

- Add bulk quotes support with `get_quotes` method

## [0.2.1] - 2026-01-29

- Add extended stock information fields (EPS, PE ratio, dividend data, moving averages)

## [0.2.0] - 2026-01-27

- Add multi-strategy authentication with retry logic
- Add CLAUDE.md with project instructions

## [0.1.6] - 2025-02-18

- Adding a simple cache
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
yahoo_finance_client (0.4.0)
yahoo_finance_client (0.4.1)
csv
httparty (~> 0.21.0)

Expand Down
1 change: 1 addition & 0 deletions lib/yahoo_finance_client/stock.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ def build_quote_hash(quote, price, dividend, eps)
dividend: dividend, dividend_yield: calculate_yield(dividend, price),
payout_ratio: calculate_payout(dividend, eps),
ma50: quote["fiftyDayAverage"], ma200: quote["twoHundredDayAverage"],
fifty_two_week_high: quote["fiftyTwoWeekHigh"], fifty_two_week_low: quote["fiftyTwoWeekLow"],
ex_dividend_date: parse_unix_date(quote["exDividendDate"]),
dividend_date: parse_unix_date(quote["dividendDate"])
}
Expand Down
2 changes: 1 addition & 1 deletion lib/yahoo_finance_client/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module YahooFinanceClient
VERSION = "0.4.0"
VERSION = "0.4.1"
end
50 changes: 42 additions & 8 deletions spec/yahoo_finance_client/stock_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
"dividendRate" => 0.96,
"fiftyDayAverage" => 148.5,
"twoHundredDayAverage" => 145.0,
"fiftyTwoWeekHigh" => 180.0,
"fiftyTwoWeekLow" => 120.0,
"exDividendDate" => 1_710_374_400
}
]
Expand All @@ -64,6 +66,8 @@
payout_ratio: 16.33,
ma50: 148.5,
ma200: 145.0,
fifty_two_week_high: 180.0,
fifty_two_week_low: 120.0,
ex_dividend_date: Date.new(2024, 3, 14),
dividend_date: nil
}
Expand Down Expand Up @@ -140,6 +144,8 @@
payout_ratio: 16.33,
ma50: 148.5,
ma200: 145.0,
fifty_two_week_high: 180.0,
fifty_two_week_low: 120.0,
ex_dividend_date: Date.new(2024, 3, 14),
dividend_date: nil
}
Expand Down Expand Up @@ -176,6 +182,8 @@
payout_ratio: 16.33,
ma50: 148.5,
ma200: 145.0,
fifty_two_week_high: 180.0,
fifty_two_week_low: 120.0,
ex_dividend_date: Date.new(2024, 3, 14),
dividend_date: nil
}
Expand All @@ -197,6 +205,8 @@
"dividendRate" => 0.96,
"fiftyDayAverage" => 150.0,
"twoHundredDayAverage" => 147.0,
"fiftyTwoWeekHigh" => 185.0,
"fiftyTwoWeekLow" => 125.0,
"exDividendDate" => 1_710_374_400
}
]
Expand All @@ -219,6 +229,8 @@
payout_ratio: 16.11,
ma50: 150.0,
ma200: 147.0,
fifty_two_week_high: 185.0,
fifty_two_week_low: 125.0,
ex_dividend_date: Date.new(2024, 3, 14),
dividend_date: nil
}
Expand Down Expand Up @@ -258,7 +270,9 @@
"trailingPE" => 22.0,
"epsTrailingTwelveMonths" => 6.36,
"fiftyDayAverage" => 138.0,
"twoHundredDayAverage" => 135.0
"twoHundredDayAverage" => 135.0,
"fiftyTwoWeekHigh" => 160.0,
"fiftyTwoWeekLow" => 110.0
}
]
}
Expand Down Expand Up @@ -286,6 +300,8 @@
payout_ratio: nil,
ma50: 138.0,
ma200: 135.0,
fifty_two_week_high: 160.0,
fifty_two_week_low: 110.0,
ex_dividend_date: nil,
dividend_date: nil
)
Expand Down Expand Up @@ -345,7 +361,9 @@
"epsTrailingTwelveMonths" => -1.5,
"dividendRate" => 0.0,
"fiftyDayAverage" => 195.0,
"twoHundredDayAverage" => 180.0
"twoHundredDayAverage" => 180.0,
"fiftyTwoWeekHigh" => 250.0,
"fiftyTwoWeekLow" => 150.0
}
]
}
Expand Down Expand Up @@ -373,6 +391,8 @@
payout_ratio: nil,
ma50: 195.0,
ma200: 180.0,
fifty_two_week_high: 250.0,
fifty_two_week_low: 150.0,
ex_dividend_date: nil,
dividend_date: nil
)
Expand All @@ -396,6 +416,8 @@
"dividendRate" => 0.96,
"fiftyDayAverage" => 148.5,
"twoHundredDayAverage" => 145.0,
"fiftyTwoWeekHigh" => 180.0,
"fiftyTwoWeekLow" => 120.0,
"exDividendDate" => 1_710_374_400
}
]
Expand Down Expand Up @@ -428,6 +450,8 @@
payout_ratio: 16.33,
ma50: 148.5,
ma200: 145.0,
fifty_two_week_high: 180.0,
fifty_two_week_low: 120.0,
ex_dividend_date: Date.new(2024, 3, 14),
dividend_date: nil
)
Expand Down Expand Up @@ -463,6 +487,8 @@
"dividendRate" => 0.96,
"fiftyDayAverage" => 148.5,
"twoHundredDayAverage" => 145.0,
"fiftyTwoWeekHigh" => 180.0,
"fiftyTwoWeekLow" => 120.0,
"exDividendDate" => 1_710_374_400
}
]
Expand Down Expand Up @@ -496,6 +522,8 @@
payout_ratio: 16.33,
ma50: 148.5,
ma200: 145.0,
fifty_two_week_high: 180.0,
fifty_two_week_low: 120.0,
ex_dividend_date: Date.new(2024, 3, 14),
dividend_date: nil
)
Expand Down Expand Up @@ -534,15 +562,17 @@
"regularMarketChangePercent" => 1.0, "regularMarketVolume" => 100_000,
"trailingPE" => 25.5, "epsTrailingTwelveMonths" => 5.88,
"dividendRate" => 0.96, "fiftyDayAverage" => 148.5,
"twoHundredDayAverage" => 145.0, "exDividendDate" => 1_710_374_400
"twoHundredDayAverage" => 145.0, "fiftyTwoWeekHigh" => 180.0,
"fiftyTwoWeekLow" => 120.0, "exDividendDate" => 1_710_374_400
},
{
"symbol" => "MSFT", "shortName" => "Microsoft Corp.",
"regularMarketPrice" => 380.0, "regularMarketChange" => 2.0,
"regularMarketChangePercent" => 0.53, "regularMarketVolume" => 90_000,
"trailingPE" => 35.0, "epsTrailingTwelveMonths" => 10.86,
"dividendRate" => 3.0, "fiftyDayAverage" => 375.0,
"twoHundredDayAverage" => 360.0, "exDividendDate" => 1_715_644_800
"twoHundredDayAverage" => 360.0, "fiftyTwoWeekHigh" => 420.0,
"fiftyTwoWeekLow" => 310.0, "exDividendDate" => 1_715_644_800
}
]
}
Expand Down Expand Up @@ -582,7 +612,8 @@
"regularMarketChangePercent" => 1.0, "regularMarketVolume" => 100_000,
"trailingPE" => 25.5, "epsTrailingTwelveMonths" => 5.88,
"dividendRate" => 0.96, "fiftyDayAverage" => 148.5,
"twoHundredDayAverage" => 145.0, "exDividendDate" => 1_710_374_400
"twoHundredDayAverage" => 145.0, "fiftyTwoWeekHigh" => 180.0,
"fiftyTwoWeekLow" => 120.0, "exDividendDate" => 1_710_374_400
}
]
}
Expand All @@ -608,7 +639,8 @@
{ symbol: "AAPL", name: "Apple Inc.", price: 150.0, change: 1.5,
percent_change: 1.0, volume: 100_000, pe_ratio: 25.5, eps: 5.88,
dividend: 0.96, dividend_yield: 0.64, payout_ratio: 16.33,
ma50: 148.5, ma200: 145.0, ex_dividend_date: Date.new(2024, 3, 14), dividend_date: nil }
ma50: 148.5, ma200: 145.0, fifty_two_week_high: 180.0, fifty_two_week_low: 120.0,
ex_dividend_date: Date.new(2024, 3, 14), dividend_date: nil }
end
let(:response_body) do
{
Expand All @@ -620,7 +652,8 @@
"regularMarketChangePercent" => 0.53, "regularMarketVolume" => 90_000,
"trailingPE" => 35.0, "epsTrailingTwelveMonths" => 10.86,
"dividendRate" => 3.0, "fiftyDayAverage" => 375.0,
"twoHundredDayAverage" => 360.0, "exDividendDate" => 1_715_644_800
"twoHundredDayAverage" => 360.0, "fiftyTwoWeekHigh" => 420.0,
"fiftyTwoWeekLow" => 310.0, "exDividendDate" => 1_715_644_800
}
]
}
Expand Down Expand Up @@ -705,7 +738,8 @@
"regularMarketChangePercent" => 1.0, "regularMarketVolume" => 100_000,
"trailingPE" => 25.5, "epsTrailingTwelveMonths" => 5.88,
"dividendRate" => 0.96, "fiftyDayAverage" => 148.5,
"twoHundredDayAverage" => 145.0, "exDividendDate" => 1_710_374_400
"twoHundredDayAverage" => 145.0, "fiftyTwoWeekHigh" => 180.0,
"fiftyTwoWeekLow" => 120.0, "exDividendDate" => 1_710_374_400
}
]
}
Expand Down