Compare sentiment, breadth, leaders, laggards and social-price divergences across nine broad markets.
/api/market-sentimentA comparative sentiment board for the US market, gold, silver, BTC, Ethereum, oil, DXY, copper and bonds/rates. It targets about 40 quality-filtered X posts per market: curated specialists come first; topic search fills gaps but is capped and downweighted. Each market includes `signal`, a deterministic comparison between social sentiment and independently timestamped price action. Missing, future-dated or seven-day-old proxy quotes cannot generate a current confirmation/divergence. Calling without `market` adds `overview`: a fresh-only confidence-weighted composite, breadth, rankings, divergences and `consensus` with agreement, dispersion and effective market count. Stale fallback remains visible per market but cannot move current aggregates. The sentiment model classifies toward the requested market and writes a balanced recap; its version is published as `sentimentModel` so two readings can be told apart as comparable or not. Search-only evidence and the deterministic lexicon fallback are hard-capped at low confidence, and the fallback is always declared in `quality.classificationMode`. Repeated forced reads reuse a successful result for five minutes while incomplete boards remain eligible to fill missing markets. Its own product (Market Sentiment), cached ~30 min per market.
Use it toRead the mood of a whole market (risk-on/off, gold, crypto) before positioning.
`signal.alignment` distinguishes confirmed bullish/bearish readings, social-price divergences, mixed evidence and missing price context. `priceAction.asOf`/`ageSeconds` and `signal.priceAsOf`/`priceAgeSeconds` expose the independent quote time; a quote is unusable at seven days. Price moves inside ±0.1% are treated as flat. `overview.composite` and `overview.consensus` use only fresh markets with positive confidence. Both expose an evidence status that remains insufficient below 1.5 effective markets; the composite keeps its descriptive score so clients can inspect it without mistaking it for a sufficiently broad market reading. Consensus direction and `directionWeightShares` weight each market by its confidence instead of giving every market an equal vote. High agreement requires ≥2/3 weighted dominance and dispersion ≤0.35. `coverage.eligibleSnapshotSkewSeconds` reports how many seconds separate the compared observations. `refreshDeferredReason`, seconds and `Retry-After` distinguish the five-minute post-success minimum from a source-failure cooldown. It is a comparison, not a trade recommendation. Last-good fallback is available only while the original observation is less than 24 hours old. When a refresh fails, `sourceStatus` says why (`subscription-inactive`, `quota-exceeded`, `budget-exceeded`, `misconfigured`, `unavailable`), `sourceNeedsAttention` is true when retrying cannot help, `ageDays` appears once the served data is a day old, and `note` states that age and cause; an inactive X subscription with no usable snapshot returns 503. `sourceHealth.curated.noPosts` names curated desks whose request succeeded but returned no posts of their own (renamed, suspended or restricted accounts), and `noRecentPosts` those with nothing inside the 72-hour window; both are disclosure only and do not change the score. `noMarketPosts` is the third and the one that was missing: desks that posted inside the window but never named this market — alive, just talking about something else. Measured on 2026-09-21 by reading the live timelines, copper, oil and the US dollar received zero market-relevant posts from their curated desks and bonds one of 76, while silver and Ethereum received ten and eighteen; none of those desks was silent, so nothing had flagged them. Curated desks are reviewed monthly from what refreshes observe (no extra X requests): a desk with no post inside the window during a whole month is removed, and vacancies go to the most consistent qualifying search authors for that market (verified or 5k+ followers, 3+ distinct posts on 2+ days), up to eight per market. Topic search is bounded to the window with X's `since:` operator, so its pages are not spent on older top posts. Curated desks whose latest timeline page does not yet reach the start of the window are paged further (up to three pages), so prolific desks are read across the whole window rather than their last ~15 hours. **How the score is computed, in full.** Shared with Stock Sentiment: each post is classified into one of three labels and a score in the range −1 to +1; its base weight is `1 + log10(1 + engagement)`, where `engagement` is `likes + 2×retweets + replies + quotes`; the published score is the weighted mean `Σ(score × weight) / Σ(weight)`; and the label thresholds are the same at every level — above +0.15 is bullish, below −0.15 is bearish, neutral in between. The log makes engagement matter without letting one viral post decide the reading: 10 interactions weigh 2.0, 1,000 weigh 4.0 and 100,000 weigh 6.0, so ten thousand times the engagement carries three times the weight, not ten thousand. **Specific to Market Sentiment**, and the part that does NOT apply to Stock Sentiment: that base weight is multiplied by `sourceWeight` — 1 for a curated desk, 0.4 for a post found by topic search — and by `recencyWeight = 0.5 ^ (ageHours / 36)`, so a post halves in weight every 36 hours. A market reading therefore ages on its own. Stock Sentiment has neither factor: its 72-hour window is a hard cut instead, so a post from 70 hours ago weighs exactly as much as one from an hour ago, and it limits a loud author with a cap of three direct posts rather than a weight. Do not read the two scores as if they were computed the same way. **What the lexicon fallback is worth, measured.** When the AI is unavailable, `quality.classificationMode` reports `lexicon` and the reading's confidence is hard-capped at low. Measured on 2026-09-20 against a hand review of the 33 on-topic posts a live gold snapshot was serving: the fallback's per-post label disagreed with a human reading in 12 of them (36%), and two were outright sign inversions — it read “the short gold trade is over” as bearish, and a SELL setup as bullish because the word appeared in the template's boilerplate. Most of the rest were bullish posts read as neutral, so the error dilutes rather than reverses: the aggregate direction survived in that sample (published bullish, and a human reading of the same posts also bullish, only stronger). The caveat a client needs: **the low-confidence warning applies to the per-post `sentiment` labels too, not only to the aggregate score.** In lexicon mode, treat an individual post's label as indicative and the direction as attenuated. `sentimentModel` names the version of the classification — not the vendor — so two readings can be told apart as comparable or not; when the AI is unavailable the deterministic lexicon takes over, and `quality.classificationMode` always says which one produced the numbers. `evidenceSpread` discloses how concentrated the sample is (busiest account and share, top-three share, effective independent voices) and how fresh it is (posts in the last 24 h, median and oldest age); `author_concentration` warns when one account writes more than 30% of it. `evidenceSpread.sharedEvidence` says how much of the same sample also matches another market's terms, with the overlapping markets busiest first: two markets reading the same way are one signal, not two, when they rest on the same posts. It is disclosure only — measured on 2026-09-20 over the 119 posts the live markets served, 29 matched a second market, most of them legitimately (a gold post quoting the silver move in the same breath), and 61% of posts name their own market exactly once, so filtering on it would cost far more evidence than it saves. It describes THIS sample, not a fixed property of the market: it moves when the sample moves, so two requests minutes apart can legitimately report different shares. Measured the same day on two different snapshots, gold read 28% and then 17.5%.
Send your ra_live_… key in the x-api-key header. Pick your language:
curl "https://raspberrytrades.com/api/market-sentiment?market=btc" \
-H "x-api-key: ra_live_your_key_here"marketfreshincludex-api-key| Parameter | Type | Description |
|---|---|---|
market | string | us | gold | silver | btc | eth | oil | dollar | copper | bonds — omit for all (optional) |
fresh | 0 | 1 | 1 = request a live read; successful reads have a five-minute minimum and active source-failure cooldowns still apply (optional) |
include | mine | include=mine adds `myInfluencers`: what the X accounts in YOUR market-sentiment list said about this market, scored separately. Needs a market and an API key bound to your account; the shared reading never changes (optional) |
x-api-key | header | Your API key — market scope (required) |
Example, not a live result. Field shapes are exact; the values, prices and timestamps are illustrative. Call the endpoint for current data.
{
"id": "btc", "name": "Bitcoin", "emoji": "₿",
"updatedAt": "2026-09-18T12:00:00Z",
"windowHours": 72,
"sampleSize": 40,
"sample": { "target": 40, "total": 40, "shortfall": 0, "curated": 24, "search": 16, "distinctAuthors": 14, "curatedAuthors": 6, "searchAuthors": 8 },
"sourceHealth": { "status": "healthy", "curated": { "attempted": 8, "succeeded": 8, "failed": 0, "noPosts": [], "noRecentPosts": ["TheChartGuys"] }, "search": { "attempted": 1, "succeeded": 1, "failed": 0 } },
"quality": { "status": "ok", "confidence": "high", "score": 0.89, "classificationMode": "ai", "aiClassified": 40, "warnings": [] },
"sentiment": { "label": "bearish", "score": -0.23, "bullish": 10, "bearish": 21, "neutral": 9, "basis": "X sentiment only; price action reported separately" },
"priceAction": { "proxy": "BTC-USD", "changePct": 1.2, "asOf": "2026-09-18T11:58:00Z", "ageSeconds": 120, "maxAgeSeconds": 604800 },
"signal": { "socialDirection": "bearish", "socialScore": -0.23, "priceDirection": "up", "priceChangePct": 1.2, "priceAsOf": "2026-09-18T11:58:00Z", "priceAgeSeconds": 120, "maxPriceAgeSeconds": 604800, "alignment": "bearish-divergence", "confidence": "high", "confidenceScore": 0.89, "evidencePosts": 40, "priceNoiseBandPct": 0.1 },
"aiSummary": "The market keeps a bearish bias after losing support, though institutional buying and targets near $92k keep the bounce case alive. Caution dominates until the technical level traders point to is reclaimed.",
"bullSummary": "Institutional adoption: a UAE bank bought $137M BTC on the dip; targets near $92k.",
"bearSummary": "Price broke key support; traders warn of further downside before a bounce.",
"topTweets": [
{
"author": "PeterLBrandt",
"text": "BTC losing this level opens the door lower",
"sentiment": "bearish",
"origin": "curated",
"ageHours": 2.8,
"createdAt": "Wed Jul 01 09:12:00 +0000 2026",
"url": "https://x.com/PeterLBrandt/status/..."
}
],
"cached": true, "stale": false, "ageSeconds": 120
}Create a free account, copy your ra_live_… key and make your first call to https://raspberrytrades.com/api/market-sentiment.
Keep your key on your server — never ship it in front-end code.