Scenario: Tracking Your Portfolio
Let’s say you have a portfolio with several holdings and want to monitor performance and income.Step 1: Get Current Prices
Prompt to AI:“Get the latest prices for my portfolio: Apple, Microsoft, Johnson & Johnson, and Vanguard S&P 500 ETF”The AI uses
yf_download for a quick snapshot:
Step 2: Track Historical Performance
Prompt to AI:“Show me how these stocks performed over the past 6 months”The AI uses
yf_tickers_history:
Step 3: Monitor Dividend Income
Prompt to AI:“Show me all dividends paid by Johnson & Johnson”The AI uses
yf_ticker_dividends:
“Get the dividend history for all my dividend-paying stocks”For each dividend stock, the AI uses
yf_ticker_dividends:
Step 4: Check Upcoming Events
Prompt to AI:“When is Apple’s next earnings report?”The AI uses
yf_ticker_calendar:
Step 5: Export Portfolio Data
Prompt to AI:“Export my portfolio’s 1-year performance to a CSV file called portfolio_2025.csv”The AI uses
yf_tickers_history with save parameter:
portfolio_2025.csv.
Advanced Portfolio Analysis
Tracking Splits and Corporate Actions
Prompt to AI:“Check if any of my stocks had splits recently”The AI uses
yf_ticker_splits for each ticker:
Monitoring Cost Basis Adjustments
Prompt to AI:“Get all corporate actions for Microsoft”The AI uses
yf_ticker_actions:
Analyzing Holdings
Prompt to AI:“Show me detailed information about my ETF holdings”For VOO (Vanguard S&P 500 ETF), the AI uses
yf_ticker_funds_data:
Building a Complete Portfolio Dashboard
Here’s how you might ask for a comprehensive portfolio update: Prompt to AI:“Give me a complete portfolio update for AAPL, MSFT, JNJ, and VOO”AI would use:
yf_tickers_history- Recent price data (1 week)yf_ticker_info- Key metrics for each (P/E, market cap, etc.)yf_ticker_dividends- Dividend history for eachyf_ticker_calendar- Upcoming events for eachyf_ticker_news- Recent news for portfolio holdings
Dividend Income Tracking
Prompt to AI:“Calculate my total dividend income from JNJ over the past 5 years”The AI uses
yf_ticker_dividends:
“Export all dividend data for my holdings”For a multi-ticker dividend export:
Rebalancing Analysis
Prompt to AI:“Show me year-to-date performance for my portfolio”The AI uses
yf_tickers_history:
Common Portfolio Tracking Prompts
- “Get today’s closing prices for AAPL, MSFT, GOOGL”
- “Show me 1-year returns for my tech stocks”
- “When is the next ex-dividend date for AT&T?”
- “Get the full dividend history for Procter & Gamble”
- “Export 2 years of monthly data for my entire portfolio”
- “Check if any of my stocks announced splits”
- “Show me analyst ratings for my holdings”
- “Get the latest news for stocks I own”
Tips for Portfolio Management
- Use
period: "1d"for daily monitoring and quick price checks - Set
interval: "1wk"or"1mo"for long-term trend analysis - Use
auto_adjust: trueto get adjusted prices accounting for splits and dividends - Export data regularly with the
saveparameter to maintain historical records - Use
yf_ticker_fast_infofor quick portfolio scans without full company data - Combine
yf_ticker_dividendswithyf_ticker_splitsto calculate accurate cost basis - Set up regular checks of
yf_ticker_calendarto track ex-dividend dates - Use
response_format: "markdown"for human-readable portfolio reports
Example: Complete Portfolio Export
To export everything at once: Prompt to AI:“Create a comprehensive data export of my portfolio with 1 year of price history, dividend history, and current fundamentals”The AI would:
- Export historical prices to
portfolio_prices.csv - Export dividend data to
portfolio_dividends.csv - Export company info to
portfolio_info.json
save parameter: