News Sentiment Dataset
Access AI-powered sentiment analysis derived from financial news and social media. FinBrain’s NLP models process thousands of articles daily to generate sentiment scores that help you gauge market mood and momentum.
What’s Included
Section titled “What’s Included”The News Sentiment dataset provides:
- Sentiment Score: Normalized score from -1 (bearish) to +1 (bullish) for each date
- Date-Keyed Data: Historical sentiment organized by date
- Daily Updates: Fresh sentiment scores every trading day
- Historical Data: Years of sentiment history for backtesting
Coverage
Section titled “Coverage”| Market | Tickers | Update Frequency |
|---|---|---|
| S&P 500 | 500+ | Daily |
| NASDAQ | 3,000+ | Daily |
| NYSE | 2,500+ | Daily |
| Crypto | 100+ | Daily |
Understanding Sentiment Scores
Section titled “Understanding Sentiment Scores”| Range | Interpretation |
|---|---|
| 0.5 to 1.0 | Strong bullish sentiment |
| 0.2 to 0.5 | Moderate bullish sentiment |
| -0.2 to 0.2 | Neutral sentiment |
| -0.5 to -0.2 | Moderate bearish sentiment |
| -1.0 to -0.5 | Strong bearish sentiment |
Note: Sentiment scores are returned as strings and need to be converted to floats for numerical operations (e.g., float(score)).
Quick Start
Section titled “Quick Start”from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
# Get sentiment as DataFramedf = fb.sentiments.ticker("S&P 500", "AAPL", as_dataframe=True)print(df.tail())For complete code examples in Python, JavaScript, C++, Rust, and cURL, see the API Reference.
Use Cases
Section titled “Use Cases”Sentiment-Based Trading Signals
Section titled “Sentiment-Based Trading Signals”Generate trading signals based on sentiment thresholds:
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
def get_sentiment_signal(market, ticker): """Generate trading signal from sentiment score""" sentiment = fb.sentiments.ticker(market, ticker) sentiment_data = sentiment["sentimentAnalysis"]
if not sentiment_data: return "no_data"
# Get the latest date's score (convert string to float) dates = sorted(sentiment_data.keys(), reverse=True) latest_score = float(sentiment_data[dates[0]])
if latest_score > 0.5: return "strong_buy" elif latest_score > 0.2: return "buy" elif latest_score < -0.5: return "strong_sell" elif latest_score < -0.2: return "sell" else: return "hold"
signal = get_sentiment_signal("S&P 500", "TSLA")print(f"Signal: {signal}")Sentiment Screening
Section titled “Sentiment Screening”Screen a watchlist for tickers with extreme sentiment:
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
watchlist = ["AAPL", "GOOGL", "MSFT", "AMZN", "NVDA", "TSLA"]
bullish = []bearish = []
for ticker in watchlist: sentiment = fb.sentiments.ticker("S&P 500", ticker) sentiment_data = sentiment["sentimentAnalysis"] if sentiment_data: dates = sorted(sentiment_data.keys(), reverse=True) score = float(sentiment_data[dates[0]]) if score > 0.5: bullish.append((ticker, score)) elif score < -0.5: bearish.append((ticker, score))
print("Bullish tickers:", bullish)print("Bearish tickers:", bearish)Combine with Price Predictions
Section titled “Combine with Price Predictions”Enhance prediction confidence when sentiment aligns with expected price movement:
from finbrain import FinBrainClient
fb = FinBrainClient(api_key="YOUR_API_KEY")
def analyze_ticker(market, ticker): """High conviction signals when predictions and sentiment align""" predictions = fb.predictions.ticker(ticker, prediction_type="daily") sentiment = fb.sentiments.ticker(market, ticker)
pred = predictions["prediction"] expected_short = float(pred["expectedShort"])
sentiment_data = sentiment["sentimentAnalysis"] dates = sorted(sentiment_data.keys(), reverse=True) sent_score = float(sentiment_data[dates[0]])
# Stronger signal when expected move and sentiment align if expected_short > 0.5 and sent_score > 0.3: return "high_conviction_buy" elif expected_short < -0.5 and sent_score < -0.3: return "high_conviction_sell" else: return "mixed_signals"
result = analyze_ticker("S&P 500", "AAPL")print(result)Related Resources
Section titled “Related Resources”- Sentiments API Reference - Endpoint details, parameters, and response schema
- Sentiment-Based Strategies Guide - Build trading strategies
- AI Price Forecasts - Combine with predictions
- Python SDK Documentation