--- name: sentiment-analysis description: Sentiment analysis report — news sentiment, insider activity, social media, analyst actions via openbb-invest-api user-invocable: true metadata: { "openclaw": { "emoji": "🎭", "requires": { "bins": ["curl"] } } } --- # Sentiment Analysis Generate a structured sentiment analysis report for a given stock ticker. ## Data Collection Fetch the following endpoints using `exec` tool: ```bash BASE=https://invest-api.k8s.home # 1. Composite sentiment score (aggregated from multiple sources) curl -sk "$BASE/api/v1/stock/{TICKER}/sentiment" # 2. Per-article news sentiment scores (bullish/bearish) curl -sk "$BASE/api/v1/stock/{TICKER}/news-sentiment?limit=20" # 3. Insider trades (SEC Form 4 — buys vs sells) curl -sk "$BASE/api/v1/stock/{TICKER}/insider-trades" # 4. SEC insider filings curl -sk "$BASE/api/v1/stock/{TICKER}/sec-insider" # 5. Recent upgrades/downgrades curl -sk "$BASE/api/v1/stock/{TICKER}/upgrades" ``` ## Report Structure ``` ## {TICKER} Sentiment Analysis — {date} ### Overall Sentiment Score - Composite: {score} (-1.0 to +1.0) — [strongly bearish / bearish / neutral / bullish / strongly bullish] - Source breakdown: news {score}, analyst {score}, social {score} ### News Sentiment - Articles analyzed: {count} - Bullish: {count} ({%}) | Neutral: {count} ({%}) | Bearish: {count} ({%}) - Key headlines: {top 2-3 relevant headlines with sentiment} ### Insider Activity (last 90 days) - Net insider transactions: {net buy/sell} - Notable trades: {largest insider buy or sell with name and title} - Signal: [insiders buying = bullish / insiders selling = bearish / mixed] ### Analyst Actions (last 30 days) - Upgrades: {count} | Downgrades: {count} - Notable: {most recent significant upgrade/downgrade with firm name} ### Signal: [BULLISH / BEARISH / NEUTRAL] ### Confidence: {1-10} ### Key Risk: {one-line sentiment risk} ``` ## Rules - Use ONLY data from the API responses — never fabricate sentiment scores - If an endpoint returns an error, note "Data unavailable" for that section - Keep the report under 400 words - Insider buying is a stronger signal than insider selling (insiders sell for many reasons, but buy for one)