Cambrian Detect major sentiment shifts in crypto tokens API
GET /api/v1/deep42/social-data/sentiment-shifts
Sentiment Shifts
Overview
Detects tokens with significant sentiment changes between a current period and a comparable previous period. This surfaces potential market-moving shifts in crypto Twitter discourse. The endpoint compares AI-assigned sentiment scores (0-10 per tweet) across time windows and only includes tokens with sufficient tweet volume in both periods for statistical relevance.
Business Value
- Early Market Signal Detection: Catch sentiment shifts before they translate to price movements, giving traders a potential timing advantage
- Risk Management: Identify tokens experiencing bearish sentiment shifts that may warrant position adjustments or increased monitoring
- Portfolio Opportunity Discovery: Find tokens with improving sentiment that could represent new investment opportunities
- Data-Driven Decision Making: Replace gut feelings about market sentiment with quantified, statistical analysis of social media conversations
- Statistical Validation: Only includes tokens with sufficient tweet volume in both periods for statistically relevant sentiment comparisons
Endpoint Details
URL:
https://api.cambrian.org/deep42/social-data/sentiment-shifts
Method: GET
Authentication: Required via X-API-KEY header
Query Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| comparison_period | string | No | 3d | Period to compare against. Enum: 24h, 3d, 7d |
| limit | integer | No | 20 | Number of tokens to return (maximum 50) |
Response Field Descriptions
| Response Field | Type | Description |
|---|---|---|
| tokenSymbol | String | Cryptocurrency token symbol (e.g., BTC, ETH, SOL) |
| sentimentShift | Number | Change in average sentiment between current and previous period (currentSentiment - previousSentiment). Range -10 to +10. Positive = bullish shift, negative = bearish shift. >2 = notable, >5 = major shift |
| currentSentiment | Number | Average AI-assigned sentiment score across tweets in the current period (last 24 hours). Range 0-10 (0 = very bearish, 5 = neutral, 10 = very bullish). Minimum 3 tweets required |
| previousSentiment | Number | Average AI-assigned sentiment score in the previous period (from comparison_period ago to 24h ago). Range 0-10. Minimum 2 tweets required |
| currentPeriodTweets | Integer | Number of tweets about this token in the current period (last 24 hours) |
| previousPeriodTweets | Integer | Number of tweets about this token in the previous period; used as denominator for volumeChange |
| currentPeriodAuthors | Integer | Number of distinct authors discussing this token in the current period |
| bullishRatio | Number | Percentage of current-period tweets with bullish sentiment (score >=6). Range 0-100. >60 = bullish majority, <40 = bearish majority |
| volumeChange | Number | Ratio of current period tweet count to previous period. 1.0 = unchanged, 2.0 = doubled, 0.5 = halved. >1.5 = significant increase in discussion volume |
| qualityScore | Number | Sum of average sentiment + average alpha for current period tweets. Range 0-20. >10 = above-average, >15 = high quality |
| volatility | Number | Standard deviation of sentiment scores within the current period. Range 0-5. <1 = strong consensus, >2 = highly divided opinions |
| confidenceScore | Number | Confidence in the detected shift: log(tweet_count + 1) * abs(sentiment_shift). >3 = moderate confidence, >5 = high confidence |
| signalMagnitude | Number | Shift magnitude normalized by volatility: abs(sentiment_shift) / max(volatility, 1). >1 = shift exceeds normal variance, >2 = 2x normal variance |
Examples
1. Default 3-Day Comparison
Fetches the top 5 tokens with the most significant sentiment shifts using the default 3-day comparison window.
curl -X GET "https://api.cambrian.org/deep42/social-data/sentiment-shifts?limit=5&comparison_period=3d" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
[
{
"tokenSymbol": "WLD",
"sentimentShift": 2.92,
"currentSentiment": 8.67,
"previousSentiment": 5.75,
"currentPeriodTweets": 3,
"previousPeriodTweets": 4,
"currentPeriodAuthors": 3,
"bullishRatio": 100,
"volumeChange": 0.75,
"qualityScore": 15.67,
"volatility": 0.58,
"confidenceScore": 4.04,
"signalMagnitude": 2.92
},
{
"tokenSymbol": "DOGE",
"sentimentShift": -2.8,
"currentSentiment": 6,
"previousSentiment": 8.8,
"currentPeriodTweets": 6,
"previousPeriodTweets": 5,
"currentPeriodAuthors": 6,
"bullishRatio": 67,
"volumeChange": 1.2,
"qualityScore": 13.17,
"volatility": 3.29,
"confidenceScore": 5.45,
"signalMagnitude": 0.85
},
{
"tokenSymbol": "BNB",
"sentimentShift": 2,
"currentSentiment": 7.67,
"previousSentiment": 5.67,
"currentPeriodTweets": 3,
"previousPeriodTweets": 3,
"currentPeriodAuthors": 3,
"bullishRatio": 100,
"volumeChange": 1,
"qualityScore": 14.67,
"volatility": 0.58,
"confidenceScore": 2.77,
"signalMagnitude": 2
},
{
"tokenSymbol": "ONDO",
"sentimentShift": 1.25,
"currentSentiment": 8.25,
"previousSentiment": 7,
"currentPeriodTweets": 8,
"previousPeriodTweets": 14,
"currentPeriodAuthors": 6,
"bullishRatio": 100,
"volumeChange": 0.57,
"qualityScore": 15.25,
"volatility": 1.04,
"confidenceScore": 2.75,
"signalMagnitude": 1.21
},
{
"tokenSymbol": "BICO",
"sentimentShift": -1,
"currentSentiment": 7,
"previousSentiment": 8,
"currentPeriodTweets": 4,
"previousPeriodTweets": 3,
"currentPeriodAuthors": 4,
"bullishRatio": 75,
"volumeChange": 1.33,
"qualityScore": 14,
"volatility": 3.37,
"confidenceScore": 1.61,
"signalMagnitude": 0.3
}
]
WLD shows the strongest bullish shift (+2.92) with a fully bullish ratio (100%). DOGE shows a notable bearish shift (-2.8) with high volatility (3.29), which points to divided author sentiment despite the overall downward move.
2. Weekly Comparison Window
Fetches the top 3 tokens using a 7-day comparison period, useful for spotting longer-term sentiment trend reversals rather than short-term noise.
curl -X GET "https://api.cambrian.org/deep42/social-data/sentiment-shifts?limit=3&comparison_period=7d" \
-H "X-API-KEY: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
[
{
"tokenSymbol": "LDO",
"sentimentShift": -4.33,
"currentSentiment": 3.67,
"previousSentiment": 8,
"currentPeriodTweets": 3,
"previousPeriodTweets": 2,
"currentPeriodAuthors": 2,
"bullishRatio": 33,
"volumeChange": 1.5,
"qualityScore": 11.33,
"volatility": 2.08,
"confidenceScore": 6.01,
"signalMagnitude": 2.08
},
{
"tokenSymbol": "CVX",
"sentimentShift": -2.17,
"currentSentiment": 6.33,
"previousSentiment": 8.5,
"currentPeriodTweets": 3,
"previousPeriodTweets": 2,
"currentPeriodAuthors": 3,
"bullishRatio": 67,
"volumeChange": 1.5,
"qualityScore": 13.67,
"volatility": 3.79,
"confidenceScore": 3,
"signalMagnitude": 0.57
},
{
"tokenSymbol": "DASH",
"sentimentShift": 2,
"currentSentiment": 7,
"previousSentiment": 5,
"currentPeriodTweets": 4,
"previousPeriodTweets": 7,
"currentPeriodAuthors": 4,
"bullishRatio": 75,
"volumeChange": 0.57,
"qualityScore": 14.25,
"volatility": 3.37,
"confidenceScore": 3.22,
"signalMagnitude": 0.59
}
]
Over the 7-day window, LDO shows a major bearish shift (-4.33) with high confidence (6.01). This points to a substantial and statistically reliable sentiment reversal compared to the prior week.
x402 Payment Option
This endpoint supports pay-per-use access via the x402 payment protocol (v2): pay $0.05 USDC per request using blockchain micropayments. No API key is required.
Quick Start (TypeScript)
npm install @x402/fetch @x402/evm viem
import { x402Client } from "@x402/core/client";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { wrapFetchWithPayment } from "@x402/fetch";
import { privateKeyToAccount } from "viem/accounts";
const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
client.register("eip155:*", new ExactEvmScheme(signer));
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const response = await fetchWithPayment(
"https://x402.cambrian.org/deep42/social-data/sentiment-shifts"
);
const data = await response.json();
Quick Start (Python)
pip install "x402[httpx]"
import asyncio, os
from eth_account import Account
from x402 import x402Client
from x402.http.clients import x402HttpxClient
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact.register import register_exact_evm_client
async def main():
client = x402Client()
account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
register_exact_evm_client(client, EthAccountSigner(account))
async with x402HttpxClient(client) as http:
response = await http.get("https://x402.cambrian.org/deep42/social-data/sentiment-shifts")
print(response.json())
asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns
402 Payment Requiredwith payment details - The x402 SDK automatically signs a payment authorization with your wallet
- The SDK resubmits the request with the signed payment
- Server verifies payment and returns the API response
The x402 SDK handles steps 2 through 5 automatically.
Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request
Related Endpoints
/deep42/social-data/alpha-tweet-detection- Feed of tweets scored for alpha potential, sentiment, legitimacy, and technical accuracy/deep42/social-data/influencer-credibility- Cryptocurrency influencers ranked by credibility, track record, and accuracy/deep42/social-data/token-analysis- Comprehensive social intelligence report for a single cryptocurrency token/deep42/social-data/trending-momentum- Identifies tokens with rapidly increasing social signals and momentum indicators