| name | stock-price |
| description | Get current and historical stock prices using Yahoo Finance. Use when the user asks about stock prices, tickers, or market data. |
API: Yahoo Finance via yfinance (free, no key)
pip install yfinance
import yfinance as yf
ticker = yf.Ticker("AAPL")
info = ticker.info
hist = ticker.history(period="1mo")
Key fields in info
currentPrice, previousClose, marketCap, fiftyTwoWeekHigh, fiftyTwoWeekLow, shortName
Period options
1d, 5d, 1mo, 3mo, 6mo, 1y, 2y, 5y, 10y, ytd, max
Gotchas
- Ticker symbols are US by default. International: append exchange suffix (e.g.
7203.T for Toyota on TSE)
info call can be slow (~2s). Cache if making multiple lookups.
- Crypto supported:
BTC-USD, ETH-USD