
Financial Analysis Agent
Pull stock prices and fundamental statements via yfinance and optional Alpha Vantage so an agent can reason over real market data.
Overview
financial-analysis-agent is an agent skill most often used in Idea (also Grow) that collects stock and fundamental data via yfinance and optional Alpha Vantage for agent-driven financial analysis.
Install
npx skills add https://github.com/qodex-ai/ai-agent-skills --skill financial-analysis-agentWhat is this skill?
- FinancialDataCollector wrapper around yfinance for OHLCV history by period
- Optional Alpha Vantage FundamentalData when an API key is configured
- get_financial_statements bundles income statement, balance sheet, and cash flow
- Typed Python module pattern for agent-driven financial Q&A workflows
- Designed as a data layer agents call before analysis or reporting steps
- Three statement types returned: income statement, balance sheet, cash flow
Adoption & trust: 1.1k installs on skills.sh; 26 GitHub stars; 3/3 security scanners passed (skills.sh audits).
What problem does it solve?
Your agent cannot answer ticker or fundamentals questions because it lacks a reliable Python bridge to market data APIs.
Who is it for?
Builders prototyping finance agents, market screeners, or research copilots who already run Python with network access.
Skip if: Production trading without your own compliance review, or teams that need a complete SKILL.md procedural workflow—the catalog excerpt is primarily a code module.
When should I use this skill?
Building or invoking an agent workflow that needs programmatic stock history or company fundamentals via Python collectors.
What do I get? / Deliverables
You get reusable collector methods that return price DataFrames and statement dicts ready for downstream analysis prompts or scripts.
- Price history DataFrame for a ticker and period
- Dictionary of financial statements from yfinance Ticker
- Reusable collector class for agent tool calls
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
First shelf is Idea research because builders use market and company fundamentals before committing to a product or trading automation angle. Research covers ticker lookups, statements, and metrics collection that inform opportunity and competitive context.
Where it fits
Pull a year of prices and statements to sanity-check a fintech niche before building.
Refresh key metrics for a monthly investor update drafted by your agent.
Benchmark public-company margin patterns while stress-testing your own pricing model assumptions.
How it compares
Integration data layer for agents, not a hosted MCP market-data server or a full portfolio risk engine.
Common Questions / FAQ
Who is financial-analysis-agent for?
Solo developers building AI agents that need stock prices and financial statements from public market APIs.
When should I use financial-analysis-agent?
Use it in Idea research when evaluating companies or markets, and in Grow analytics when refreshing metrics for investor or revenue narratives—always with your own API keys and rate limits.
Is financial-analysis-agent safe to install?
Review the Security Audits panel on this Prism page; treat Alpha Vantage keys as secrets and avoid committing them to repos.
SKILL.md
READMESKILL.md - Financial Analysis Agent
""" Financial Data Collector Module Handles integration with financial data APIs and collection of stock data, financial statements, and key metrics. """ import yfinance as yf import pandas as pd from alpha_vantage.fundamentaldata import FundamentalData from typing import Dict, List class FinancialDataCollector: """Collects financial data from various APIs.""" def __init__(self, api_key: str = None): """ Initialize the financial data collector. Args: api_key: Alpha Vantage API key for fundamental data """ self.stock_data = yf.Ticker if api_key: self.fundamental_data = FundamentalData(api_key=api_key) else: self.fundamental_data = None def get_stock_data(self, ticker: str, period="1y") -> pd.DataFrame: """ Retrieve stock price data for a given ticker. Args: ticker: Stock ticker symbol period: Time period for data (default: 1 year) Returns: DataFrame with stock price data """ data = yf.download(ticker, period=period) return data def get_financial_statements(self, ticker: str) -> Dict: """ Retrieve financial statements for a company. Args: ticker: Stock ticker symbol Returns: Dictionary with income statement, balance sheet, and cash flow """ company = yf.Ticker(ticker) return { "income_statement": company.financials, "balance_sheet": company.balance_sheet, "cash_flow": company.cashflow } def get_key_metrics(self, ticker: str) -> Dict: """ Retrieve key financial metrics for a company. Args: ticker: Stock ticker symbol Returns: Dictionary with key metrics like market cap, PE ratio, etc. """ company = yf.Ticker(ticker) return { "market_cap": company.info.get("marketCap"), "pe_ratio": company.info.get("trailingPE"), "pb_ratio": company.info.get("priceToBook"), "dividend_yield": company.info.get("dividendYield"), "52_week_high": company.info.get("fiftyTwoWeekHigh"), "52_week_low": company.info.get("fiftyTwoWeekLow") } """ Fundamental Analysis Module Implements fundamental analysis techniques including profitability ratios, valuation ratios, and liquidity ratios. """ from typing import Dict class FundamentalAnalyzer: """Performs fundamental analysis on financial data.""" def calculate_profitability_ratios(self, financials: Dict) -> Dict[str, float]: """ Calculate profitability ratios. Args: financials: Dictionary with financial data Returns: Dictionary with profitability ratios """ return { "gross_margin": ( financials["revenue"] - financials["cost_of_goods"] ) / financials["revenue"], "operating_margin": ( financials["operating_income"] / financials["revenue"] ), "net_margin": ( financials["net_income"] / financials["revenue"] ), "roa": financials["net_income"] / financials["total_assets"], "roe": financials["net_income"] / financials["equity"] } def calculate_valuation_ratios(self, financials: Dict, market_cap: float) -> Dict[str, float]: """ Calculate valuation ratios. Args: financials: Dictionary with financial data market_cap: Current market capitalization Returns: Dictionary with valuation ratios """ return { "pe_ratio": market_cap / financials["net_income"], "pb_ratio": market_cap / financials["book_value"], "peg_ratio": (market_cap / financials["net_income"]) / (