Sentiment Shifts
Identifies tokens with significant sentiment changes that could signal market movements and trading opportunities. It compares average AI-assigned sentiment scores (0-10 per tweet) between the current period and a previous period set by `comparison_period`, and surfaces tokens with sufficient tweet volume in both periods for statistical relevance.
GET
https://api.cambrian.org/deep42/social-data/sentiment-shifts
Parameters
comparison_period (string)
Length of the comparison. The current period is the last 24 hours. The previous period runs from comparison_period ago to 24 hours ago; for 24h, it is the 24 hours before the current period. In v2.1 and later, the current period is the last comparison_period and the previous period is the comparison_period before it, in rolling UTC hours (3d: the last 72 hours and the 72 hours before them). Before v3, any other value is treated as 3d. In v3 and later, any other value returns 400.
limit (integer)
Number of tokens to return
Responses
Code
Description
200
Successful response
Media type: application/vnd.cambrian.table.v1.0.0+json
[
{
"tokenSymbol": "PHA",
"sentimentShift": 3.48,
"currentSentiment": 7.15,
"previousSentiment": 3.67,
"currentPeriodTweets": 40,
"previousPeriodTweets": 3,
"currentPeriodAuthors": 22,
"bullishRatio": 97,
"volumeChange": 13.33,
"qualityScore": 8.43,
"volatility": 1.48,
"confidenceScore": 10,
"signalMagnitude": 2.36
},
{
"tokenSymbol": "BURN",
"sentimentShift": 3.17,
"currentSentiment": 6.67,
"previousSentiment": 3.5,
"currentPeriodTweets": 3,
"previousPeriodTweets": 4,
"currentPeriodAuthors": 2,
"bullishRatio": 100,
"volumeChange": 0.75,
"qualityScore": 7,
"volatility": 2.08,
"confidenceScore": 4.39,
"signalMagnitude": 1.52
},
{
"tokenSymbol": "HOLD",
"sentimentShift": -3,
"currentSentiment": 5,
"previousSentiment": 8,
"currentPeriodTweets": 3,
"previousPeriodTweets": 3,
"currentPeriodAuthors": 2,
"bullishRatio": 67,
"volumeChange": 1,
"qualityScore": 5.33,
"volatility": 2.65,
"confidenceScore": 4.16,
"signalMagnitude": 1.13
}
]
400
Bad Request: Invalid request parameters or malformed request.
401
Unauthorized: Missing or invalid API key. Include X-API-Key header with your request.
403
Forbidden: Invalid API key or insufficient permissions to access this resource.
404
Not Found: Endpoint or resource does not exist.
408
Request Timeout: Request took too long to process. Try again.
500
Internal Server Error: An unexpected error occurred while processing your request.
503
Service Unavailable: The server is temporarily unable to handle the request. Please try again later.
Examples
1. Fetch top sentiment shifts
Retrieves the top tokens with the largest sentiment shifts, limited to 3 results.
curl
curl -X GET "https://api.cambrian.org/deep42/social-data/sentiment-shifts?limit=3" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json"
Response:
JSON
1[
2 {
3 "tokenSymbol": "PHA",
4 "sentimentShift": 3.48,
5 "currentSentiment": 7.15,
6 "previousSentiment": 3.67,
7 "currentPeriodTweets": 40,
8 "previousPeriodTweets": 3,
9 "currentPeriodAuthors": 22,
10 "bullishRatio": 97,
11 "volumeChange": 13.33,
12 "qualityScore": 8.43,
13 "volatility": 1.48,
14 "confidenceScore": 10,
15 "signalMagnitude": 2.36
16 },
17 {
18 "tokenSymbol": "BURN",
19 "sentimentShift": 3.17,
20 "currentSentiment": 6.67,
21 "previousSentiment": 3.5,
22 "currentPeriodTweets": 3,
23 "previousPeriodTweets": 4,
24 "currentPeriodAuthors": 2,
25 "bullishRatio": 100,
26 "volumeChange": 0.75,
27 "qualityScore": 7,
28 "volatility": 2.08,
29 "confidenceScore": 4.39,
30 "signalMagnitude": 1.52
31 },
32 {
33 "tokenSymbol": "HOLD",
34 "sentimentShift": -3,
35 "currentSentiment": 5,
36 "previousSentiment": 8,
37 "currentPeriodTweets": 3,
38 "previousPeriodTweets": 3,
39 "currentPeriodAuthors": 2,
40 "bullishRatio": 67,
41 "volumeChange": 1,
42 "qualityScore": 5.33,
43 "volatility": 2.65,
44 "confidenceScore": 4.16,
45 "signalMagnitude": 1.13
46 }
47]
2 {
3 "tokenSymbol": "PHA",
4 "sentimentShift": 3.48,
5 "currentSentiment": 7.15,
6 "previousSentiment": 3.67,
7 "currentPeriodTweets": 40,
8 "previousPeriodTweets": 3,
9 "currentPeriodAuthors": 22,
10 "bullishRatio": 97,
11 "volumeChange": 13.33,
12 "qualityScore": 8.43,
13 "volatility": 1.48,
14 "confidenceScore": 10,
15 "signalMagnitude": 2.36
16 },
17 {
18 "tokenSymbol": "BURN",
19 "sentimentShift": 3.17,
20 "currentSentiment": 6.67,
21 "previousSentiment": 3.5,
22 "currentPeriodTweets": 3,
23 "previousPeriodTweets": 4,
24 "currentPeriodAuthors": 2,
25 "bullishRatio": 100,
26 "volumeChange": 0.75,
27 "qualityScore": 7,
28 "volatility": 2.08,
29 "confidenceScore": 4.39,
30 "signalMagnitude": 1.52
31 },
32 {
33 "tokenSymbol": "HOLD",
34 "sentimentShift": -3,
35 "currentSentiment": 5,
36 "previousSentiment": 8,
37 "currentPeriodTweets": 3,
38 "previousPeriodTweets": 3,
39 "currentPeriodAuthors": 2,
40 "bullishRatio": 67,
41 "volumeChange": 1,
42 "qualityScore": 5.33,
43 "volatility": 2.65,
44 "confidenceScore": 4.16,
45 "signalMagnitude": 1.13
46 }
47]
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.
Quickstart (Typescript)
bash
npm install @x402/fetch @x402/evm viem
TypeScript
1import { x402Client } from "@x402/core/client";
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/deep42/social-data/sentiment-shifts"
11);
12const data = await response.json();
2import { ExactEvmScheme } from "@x402/evm/exact/client";
3import { wrapFetchWithPayment } from "@x402/fetch";
4import { privateKeyToAccount } from "viem/accounts";
5const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
6const client = new x402Client();
7client.register("eip155:*", new ExactEvmScheme(signer));
8const fetchWithPayment = wrapFetchWithPayment(fetch, client);
9const response = await fetchWithPayment(
10 "https://x402.cambrian.org/deep42/social-data/sentiment-shifts"
11);
12const data = await response.json();
Quickstart (Python)
bash
pip install "x402[httpx]"
Python
1import asyncio, os
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/deep42/social-data/sentiment-shifts")
13 print(response.json())
14asyncio.run(main())
2from eth_account import Account
3from x402 import x402Client
4from x402.http.clients import x402HttpxClient
5from x402.mechanisms.evm import EthAccountSigner
6from x402.mechanisms.evm.exact.register import register_exact_evm_client
7async def main():
8 client = x402Client()
9 account = Account.from_key(os.getenv("EVM_PRIVATE_KEY"))
10 register_exact_evm_client(client, EthAccountSigner(account))
11 async with x402HttpxClient(client) as http:
12 response = await http.get("https://x402.cambrian.org/deep42/social-data/sentiment-shifts")
13 print(response.json())
14asyncio.run(main())
Payment Flow
- Send a normal request to the endpoint (no API key needed)
- Server returns 402 Payment Required with 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