fetch_prices
Retrieve historical daily OHLCV prices for given tickers using financial-datasets API with automatic yfinance fallback.
Instructions
Fetch historical daily OHLCV prices for given tickers.
Uses financial-datasets API with automatic yfinance fallback. Set FINANCIAL_DATASETS_API_KEY env var for API access. Set PORTFOLIO_ROTATION_SOURCE env var to change the default source.
Args: tickers: Comma-separated ticker symbols (e.g. "AAPL,MSFT,NVDA,SPY"). start_date: Start date in YYYY-MM-DD format (e.g. "2023-01-01"). end_date: End date in YYYY-MM-DD format (e.g. "2026-03-05"). source: Data source -- "auto" (API first, yfinance fallback), "api", "financial-datasets" (same as "api"), or "yfinance". If empty, reads PORTFOLIO_ROTATION_SOURCE env var (default: "auto").
Returns: JSON with price records: [{date, ticker, open, high, low, close, volume}, ...].
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tickers | Yes | ||
| start_date | Yes | ||
| end_date | Yes | ||
| source | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |