Overview
The--extract sentiment flag returns structured JSON output containing overall sentiment, key claims, and notable accounts discussing a topic. This is useful for understanding the tone and substance of conversations on X.
Use Case
Sentiment extraction is ideal for:- Tracking crypto and financial market sentiment
- Understanding public opinion on products or companies
- Identifying key narratives and their frequency
- Mapping influential voices and their stances
Example: Bitcoin Sentiment Analysis
Get a structured sentiment snapshot of Bitcoin discussions on X:Output
Grok-X returns a structured JSON response:Output Structure
The sentiment extraction output contains three main sections:A qualitative assessment of the dominant sentiment (e.g., “cautiously bullish”, “bearish”, “mixed”, “neutral”)
A quantitative score typically ranging from -1.0 (very bearish) to +1.0 (very bullish). Scores near 0 indicate neutral or mixed sentiment.
An array of the most frequently repeated claims or narratives:
Key accounts driving the conversation:
Interpreting the Results
In this Bitcoin example:- Overall sentiment is “cautiously bullish” with a score of 0.41 (moderately positive)
- Dominant narratives include institutional accumulation, halving concerns, and on-chain holder behavior
- Key voices range from strongly bullish (saylor) to skeptical (PeterLBrandt)
- Frequency tags help identify which claims are most widespread vs. niche
The
sentiment_score is calibrated relative to the typical tone of discussions on the topic. A 0.41 for Bitcoin represents moderate optimism, but the same score for a different topic might indicate different sentiment intensity.Related Flags
--extract narrative— Extract broader narrative structures instead of sentiment-focused analysis--extract claims— Focus specifically on claims with attribution, without sentiment scoring--from/--to— Narrow the time window for sentiment analysis--handles— Limit sentiment analysis to specific accounts

