Why use the yfinance library instead of calling Yahoo directly?

yfinance handles Yahoo’s cookie-and-crumb authentication for you, so it works where a bare curl or fetch now returns 429 — including GitHub’s runners. It also exposes clean fields like last_price, previous_close, and market_cap, and is the same library many source-of-truth dashboards use, so your numbers match theirs.