scrape_stock
Fetch stock data from Yahoo Finance: quotes, historical prices, or company profiles. Select the mode for the information you need.
Instructions
Fetch stock market data from Yahoo Finance and return it as a dict.
The returned shape depends on mode:
"quote": {"symbol", "currency", "exchange", "price", "previous_close", "volume", "day_high", "day_low", "fifty_two_week_high", "fifty_two_week_low"}.
"history": {"symbol", "period", "rows": [{"date", "open", "high", "low", "close", "volume"}, ...]}.
"profile": {"symbol", "name", "currency", "exchange", "market", "timezone", "instrument_type"}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | String selecting what to fetch; one of "quote", "history", "profile". Example: "quote". Default: "quote". | quote |
| period | No | String history window, used only when mode="history" and ignored otherwise; one of "1d", "5d", "1mo", "3mo", "6mo", "1y", "2y", "5y", "10y", "ytd", "max". Example: "1y". Default: "1mo". | 1mo |
| symbol | Yes | Ticker symbol as a string. Example: "AAPL". No default (required). | |
| interval | No | Candle size for history bars, used only when mode="history"; one of "1d", "1wk", "1mo". Example: "1wk". Default: "1d". | 1d |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | No | ||
| count | No | ||
| errors | No | ||
| scraper | No | ||
| source_urls | No |