Overview
The Market Data endpoint provides a holistic view of a stock by combining:- Current price and fundamentals
- News sentiment analysis (FinViz + VADER)
- Analyst ratings and price targets
- Insider trading activity (YahooQuery)
- Key financial metrics
Get Market Context
Stock ticker symbol (e.g., “AAPL”, “TSLA”, “SPY”)
Response
Ticker symbol in uppercase
Current stock price (from currentPrice, regularMarketPrice, or previousClose)
Sentiment Analysis
Sentiment score from -1.0 (very negative) to +1.0 (very positive)
- -1.0 to -0.05: Negative
- -0.05 to +0.05: Neutral
- +0.05 to +1.0: Positive
Human-readable sentiment:
"positive", "neutral", "negative", or "unknown"Array of recent news headlines (strings) used for sentiment analysis
Analyst Data
Mean analyst price target
Median analyst price target
Analyst recommendation consensus:
"strong_buy","buy","hold","sell","strong_sell"
Company Information
Brief business description (truncated to ~300 characters)
Financial Metrics
Forward price-to-earnings ratio
Trailing price-to-earnings ratio
Debt-to-equity ratio
Insider Trading
Number of recent insider purchase transactions
Number of recent insider sale transactions
Array of recent insider transactions (up to 3)
Example Response
Sentiment Calculation
Sentiment analysis uses:
- FinViz to scrape recent news headlines
- VADER (Valence Aware Dictionary for Sentiment Reasoning) to score each headline
- Aggregates scores into a composite sentiment from -1.0 to +1.0
Insider Trading Interpretation
Understanding Insider Activity
Understanding Insider Activity
- High Purchases, Low Sales: Bullish signal - insiders buying
- Low Purchases, High Sales: Could be neutral (tax planning, diversification) or bearish
- Negative shares_traded: Sale transaction
- Positive shares_traded: Purchase transaction
Error Responses
Unable to retrieve price data for symbol
Internal error during data fetching
Data Sources
Yahoo Finance
Price, fundamentals, analyst targets
YahooQuery
Insider transactions and holders
FinViz + VADER
News scraping and sentiment scoring
Use Cases
Pre-Trade Research
Risk Assessment
- High debt_to_equity: More volatile, riskier strategies
- Negative sentiment: Avoid aggressive bullish plays
- Heavy insider selling: Exercise caution
- High forward PE: Growth stock, higher volatility expected
Strategy Selection
- Bullish Signals
- Neutral Signals
- Bearish Signals
- Positive sentiment (> 0.1)
- Price below analyst target
- Insider buying > selling
- Strong recommendation (buy/strong_buy)
Implementation Notes
Fallback Logic: If insider transaction parsing fails, the endpoint falls back to basic YFinance insider counts. The endpoint prioritizes returning data over perfect accuracy.