Market Intelligence

Market Sentiment API for
AI Trading Agents

Most agents trade on price alone. The ones that win trade on context โ€” fear/greed, social momentum, whale positioning. Purple Flea's sentiment API delivers that context in real time, so your agent always knows the mood of the market before it places a single order.

Get API Key โ†’ View Docs
Why Context Beats Price

Price alone is a lagging signal. Sentiment leads it.

By the time price moves significantly, sophisticated participants have already repositioned. What drove that repositioning? Sentiment โ€” fear, greed, social momentum, whale activity, funding imbalances. These are the leading indicators that savvy agents read before price reacts.

The Purple Flea Sentiment API aggregates four distinct sentiment data streams into a unified, programmatic interface. Your agent can check the macro emotional state of the market in milliseconds, combine it with price data, and execute positions with a meaningful informational edge.

Whether your agent is a trend-follower, a contrarian, or a mean-reversion trader, sentiment context dramatically sharpens the quality of its decisions and reduces the frequency of being caught on the wrong side of an emotional market move.

Live Snapshot
Fear & Greed Index 72 โ€” Greed
BTC Social Score 81/100
ETH Funding Rate +0.042%
Whale Inflow (24h) $284M
Data Sources

Four sentiment streams, one unified API

Each data source captures a different facet of market psychology. Together they give your agent a complete emotional picture of the market.

๐Ÿ˜ฑ
Fear & Greed Index
A composite 0โ€“100 score derived from price volatility, market momentum, social media volume, surveys, dominance metrics, and search trends. Updated daily โ€” the definitive macro sentiment signal.
0 (Extreme Fear)100 (Extreme Greed)
Updated daily
๐Ÿ“ข
Social Sentiment
Tracks Twitter/X mention volume and polarity (positive vs negative) per asset over configurable lookback windows. Spike in positive mentions often precedes retail-driven pumps. High volume + negative polarity signals panic.
Real-time ยท 50+ assets
๐Ÿ’น
Funding Rate Sentiment
Perpetual futures funding rates reveal whether longs or shorts are dominant. Strongly positive funding means longs are paying shorts โ€” the market is leaning bullish and overleveraged. Extreme readings are historically powerful fade signals.
Per-market ยท 8hr intervals
๐Ÿ‹
On-Chain Whale Activity
Large wallet transactions โ€” inflows to exchanges, outflows to cold storage, and inter-wallet moves โ€” are leading indicators of institutional intent. When whales move coins to exchanges, selling pressure typically follows.
Wallets >$1M tracked
Integration

Add sentiment to your agent in minutes

A single Python client gives you access to all four sentiment data streams with a clean, intuitive interface.

Sentiment API โ€” Quick Start Python
# pip install purpleflea
import purpleflea

# Initialize the sentiment client
sentiment = purpleflea.SentimentClient(api_key="YOUR_KEY")

# Get market-wide sentiment snapshot
snapshot = sentiment.get_snapshot()
print(f"Fear & Greed: {snapshot['fear_greed_index']} ({snapshot['fear_greed_label']})")
# e.g. "72 (Greed)"

# Get asset-specific sentiment
btc = sentiment.get_asset_sentiment("BTC", lookback_hours=24)
print(f"BTC social score: {btc['social_score']}/100")
print(f"BTC funding rate: {btc['funding_rate_pct']}%")
print(f"BTC whale inflow: ${btc['whale_inflow_usd']:,.0f}")

# Use sentiment in trading decision
if snapshot['fear_greed_index'] < 25:
    print("Extreme Fear โ€” consider contrarian long")
elif snapshot['fear_greed_index'] > 75:
    print("Extreme Greed โ€” consider taking profits")
Strategy Playbook

Sentiment-Based Trading Strategies

Three proven sentiment-driven approaches used by algorithmic traders. Each strategy treats a different emotion as its primary signal.

Contrarian
Contrarian Trading
Buy fear. Sell greed. When the Fear & Greed Index drops below 20 (Extreme Fear), markets are oversold by panic sellers. When it rises above 80 (Extreme Greed), markets are overbought by euphoric buyers.
Historically, buying during Extreme Fear and selling during Extreme Greed has outperformed buy-and-hold over multi-year backtests. The key is not fighting the emotion but being earlier than the crowd to fade it.
Signal: fear_greed_index < 20 or > 80
Momentum
Momentum Trading
Follow strong positive social scores. When social sentiment for an asset spikes โ€” high mention volume, positive polarity โ€” retail attention is flooding in. Early momentum trades can ride the wave before the crowd pushes price to overbought territory.
Set alert thresholds on social_score and combine with volume confirmation. Social momentum without volume is noise; with volume, it's a signal.
Signal: social_score > 75 + volume spike
Mean Reversion
Funding Rate Fade
Fade extreme funding rates. When perpetual funding rates hit extremes (longs paying >0.1% per 8h), the leveraged position is overcrowded. A snap reversion often follows as traders reduce leverage or get liquidated en masse.
This strategy profits from the mean-reversion of funding rates back toward zero. Works especially well at market local tops and bottoms where leverage is highest and most fragile.
Signal: funding_rate_pct > 0.1% or < -0.05%

Coverage at Scale

Comprehensive sentiment data across the entire crypto market.

50+
Assets Tracked
BTC, ETH, SOL, and all major alts
Real-time
Webhook Alerts
Push notifications on threshold breaches
2020
Historical Data From
5+ years of sentiment history for backtesting
Get Started

Add Sentiment Data to Your Agent

Register for a free API key and start reading market sentiment in minutes. No credit card required for the free tier.

Related APIs

Combine sentiment data with these other Purple Flea services to build smarter agents.