Cambrian Detect major sentiment shifts in crypto tokens API

By Cambrian Network deep42

GET /api/v1/deep42/social-data/sentiment-shifts

Sentiment Shifts

Overview

Identifies tokens with significant sentiment changes that could signal market movements and trading opportunities. Compares average AI-assigned sentiment scores (0-10 per tweet) between a current period and a previous period of equal length.

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://deep42.cambrian.network/api/v1/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 (24h, 3d, 7d)
limit integer No 20 Number of tokens to return (max 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. Range: -10 to +10. Positive = bullish shift, negative = bearish shift. >2 = notable, >5 = major shift
currentSentiment number Average AI-assigned sentiment score across all tweets about this token in the current period (last 24 hours). Range 0-10. Each tweet is independently scored: 0 = very bearish, 5 = neutral, 10 = very bullish
previousSentiment number Average AI-assigned sentiment score across all tweets in the previous period. Range 0-10
currentPeriodTweets integer Number of tweets about this token in the current period (last 24 hours). Higher counts indicate more active discussion and more reliable sentiment averages
previousPeriodTweets integer Number of tweets about this token in the previous period. Used as denominator for volumeChange calculation
currentPeriodAuthors integer Number of distinct authors discussing this token in the current period. Higher counts indicate broader market attention
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
qualityScore number Sum of average sentiment + average alpha for current period tweets. Range 0-20. Indicates both directional conviction and content quality
volatility number Standard deviation of sentiment scores within the current period. Range 0-5. <1 = strong consensus among authors, >2 = highly divided opinions
confidenceScore number Confidence in the detected shift. Calculated as log(tweet_count + 1) * abs(sentiment_shift). Higher = more reliable signal. >3 = moderate confidence, >5 = high confidence
signalMagnitude number Shift magnitude normalized by volatility. >1 = shift exceeds normal variance, >2 = shift is 2x normal variance

Examples

1. Recent Sentiment Changes (24h period)

Find tokens with sentiment shifts over the last 24 hours compared to the previous 24-hour period.

curl -X GET "https://deep42.cambrian.network/api/v1/deep42/social-data/sentiment-shifts?comparison_period=24h&limit=5" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

[
  {
    "tokenSymbol": "HYPE",
    "sentimentShift": 2.5,
    "currentSentiment": 8.0,
    "previousSentiment": 5.5,
    "currentPeriodTweets": 3,
    "previousPeriodTweets": 2,
    "currentPeriodAuthors": 2,
    "bullishRatio": 100.0,
    "volumeChange": 1.5,
    "qualityScore": 15.0,
    "volatility": 1.0,
    "confidenceScore": 3.47,
    "signalMagnitude": 2.5
  },
  {
    "tokenSymbol": "DOT",
    "sentimentShift": -1.25,
    "currentSentiment": 7.75,
    "previousSentiment": 9.0,
    "currentPeriodTweets": 4,
    "previousPeriodTweets": 2,
    "currentPeriodAuthors": 4,
    "bullishRatio": 100.0,
    "volumeChange": 2.0,
    "qualityScore": 14.75,
    "volatility": 0.5,
    "confidenceScore": 2.01,
    "signalMagnitude": 1.25
  },
  {
    "tokenSymbol": "SOL",
    "sentimentShift": -1.07,
    "currentSentiment": 6.18,
    "previousSentiment": 7.26,
    "currentPeriodTweets": 33,
    "previousPeriodTweets": 43,
    "currentPeriodAuthors": 19,
    "bullishRatio": 74.0,
    "volumeChange": 0.77,
    "qualityScore": 13.03,
    "volatility": 2.65,
    "confidenceScore": 3.79,
    "signalMagnitude": 0.41
  },
  {
    "tokenSymbol": "BURNIE",
    "sentimentShift": -0.83,
    "currentSentiment": 7.67,
    "previousSentiment": 8.5,
    "currentPeriodTweets": 3,
    "previousPeriodTweets": 2,
    "currentPeriodAuthors": 1,
    "bullishRatio": 100.0,
    "volumeChange": 1.5,
    "qualityScore": 14.0,
    "volatility": 1.15,
    "confidenceScore": 1.16,
    "signalMagnitude": 0.72
  },
  {
    "tokenSymbol": "MSTR",
    "sentimentShift": 0.67,
    "currentSentiment": 8.0,
    "previousSentiment": 7.33,
    "currentPeriodTweets": 3,
    "previousPeriodTweets": 3,
    "currentPeriodAuthors": 2,
    "bullishRatio": 100.0,
    "volumeChange": 1.0,
    "qualityScore": 14.67,
    "volatility": 0.0,
    "confidenceScore": 0.92,
    "signalMagnitude": 0.67
  }
]

The response shows HYPE with the strongest positive sentiment shift (+2.5), indicating increasing bullish sentiment, while SOL shows a moderate bearish shift (-1.07) with high discussion volume (33 tweets) making it a more statistically reliable signal.

2. Weekly Sentiment Analysis

Analyze sentiment changes over a 7-day comparison period to identify longer-term trend shifts.

curl -X GET "https://deep42.cambrian.network/api/v1/deep42/social-data/sentiment-shifts?comparison_period=7d&limit=10" \
  -H "X-API-KEY: YOUR_API_KEY" \
  -H "Content-Type: application/json"

Response:

[
  {
    "tokenSymbol": "HYPE",
    "sentimentShift": 2.5,
    "currentSentiment": 8.0,
    "previousSentiment": 5.5,
    "currentPeriodTweets": 3,
    "previousPeriodTweets": 2,
    "currentPeriodAuthors": 2,
    "bullishRatio": 100.0,
    "volumeChange": 1.5,
    "qualityScore": 15.0,
    "volatility": 1.0,
    "confidenceScore": 3.47,
    "signalMagnitude": 2.5
  }
]

This 7-day comparison captures more substantial sentiment trends, filtering out short-term noise and identifying tokens with sustained directional sentiment changes.

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 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://deep42.cambrian.network/api/v1/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://deep42.cambrian.network/api/v1/deep42/social-data/sentiment-shifts")
        print(response.json())

asyncio.run(main())

Payment Flow

  1. Send a normal request to the endpoint (no API key needed)
  2. Server returns 402 Payment Required with payment details
  3. The x402 SDK automatically signs a payment authorization with your wallet
  4. The SDK resubmits the request with the signed payment
  5. Server verifies payment and returns the API response

The x402 SDK handles steps 2–5 automatically.

Network: Base (chain ID 8453) | Currency: USDC | Price: $0.05 per request


Related Endpoints

  • /api/v1/deep42/social-data/alpha-tweet-detection - Feed of tweets detected as having high alpha potential for cryptocurrency investments
  • /api/v1/deep42/social-data/influencer-credibility - Returns cryptocurrency influencers ranked by credibility score and track record