Raw and daily sentiment history with time-aware slope, fit, volatility and evidence gaps.
/api/historySentiment over time for a ticker, with raw observations plus a polling-resistant daily series. `daily` averages all observations in each UTC day so a frequently queried hour cannot dominate a multi-day conclusion. With at least three distinct days, `analytics` calculates a time-aware OLS slope per day, fit quality (R²), mean, volatility, range and latest-vs-mean. `momentum` adds observed advances/declines, the current run, largest move with its real calendar gap and the latest directional reversal. Both raw and daily data use the requested window; nothing is interpolated. Sampling is on demand, at most once per 15 minutes, and retains at most 300 observations per ticker.
Use it toSee whether the mood on a stock is building or fading — momentum in the sentiment itself.
`analytics.method=utc-daily-mean-ols`; slope is in sentiment-score units per day and remains null below three daily observations. `calendarCoverageRatio` quantifies how dense the actually observed days are. `methodologyComparable` is true only when the whole window has a known, consistent, single-method provenance; a `mixed` series stays null because its AI/fallback proportion is not retained. `classificationMethods` lists the methods present. Every day keeps its `classification` counts; `latestClassificationChanged` and `largestMove.classificationChanged` warn when the comparison crosses a confirmed method change. `evidenceCountsMethod=sum-of-snapshot-counts-not-deduplicated` clarifies that daily counts add up snapshots and may repeat posts; they are not unique mentions. `momentum.method=observed-utc-day-deltas` uses ±0.05 as the movement threshold. Missing dates are never filled: `latestGapDays`, `latestChangePerDay`, `largestMove.gapDays` and `currentRun.calendarDays` expose elapsed time. R² measures fit to the observed series, not predictive accuracy. `coverage.sampling` is `scheduled-and-on-demand` while the Stock Sentiment pre-warm refreshes stored tickers (about every 6 h, subject to budget) and `on-demand` if it is disabled, in which case the `on_demand_sampling` warning appears; `coverage.medianObservationGapSeconds` reports the cadence actually achieved. Retention keeps 300 raw observations per ticker — about three days for a ticker polled every 15 minutes — so every completed UTC day is archived before its points age out: `daily`, `analytics` and `momentum` reach back up to 400 days whatever the polling rate, and `coverage.dailySeries` reports the days that came from the archive alone plus its status, and `trend.fromAt`/`trend.toAt` give the two observations the delta is measured between, which can span far less than the period requested.
Send your ra_live_… key in the x-api-key header. Pick your language:
curl "https://raspberrytrades.com/api/history?ticker=NVDA&window=7" \
-H "x-api-key: ra_live_your_key_here"tickerwindowx-api-key| Parameter | Type | Description |
|---|---|---|
ticker | string | US stock symbol, e.g. NVDA (required) |
window | number | Window for both points and trend, in days (default 7, min 1, max 365). Actual coverage depends on recorded observations (optional). |
x-api-key | header | Your API key — history scope (required) |
Example, not a live result. Field shapes are exact; the values, prices and timestamps are illustrative. Call the endpoint for current data.
{
"ticker": "NVDA",
"windowDays": 7,
"evidence": {
"observationSpanSeconds": 252000,
"largestGapSeconds": 158400,
"lastObservationAgeSeconds": 3600,
"classification": { "ai": 3, "mixed": 0, "lexicon": 0, "unknown": 0 },
"classificationChanged": false,
"warnings": ["observation_gap_over_24h"]
},
"trend": { "direction": "improving", "change": 0.18, "from": 0.12, "to": 0.30, "points": 3 },
"daily": [
{ "date": "2026-09-15", "score": 0.12, "observations": 1, "mentions": 22, "bullish": 13, "bearish": 4, "neutral": 5, "evidenceCountsMethod": "sum-of-snapshot-counts-not-deduplicated", "classification": { "ai": 1, "mixed": 0, "lexicon": 0, "unknown": 0 }, "classificationChanged": false },
{ "date": "2026-09-17", "score": 0.24, "observations": 1, "mentions": 31, "bullish": 19, "bearish": 5, "neutral": 7, "evidenceCountsMethod": "sum-of-snapshot-counts-not-deduplicated", "classification": { "ai": 1, "mixed": 0, "lexicon": 0, "unknown": 0 }, "classificationChanged": false },
{ "date": "2026-09-18", "score": 0.30, "observations": 1, "mentions": 28, "bullish": 18, "bearish": 4, "neutral": 6, "evidenceCountsMethod": "sum-of-snapshot-counts-not-deduplicated", "classification": { "ai": 1, "mixed": 0, "lexicon": 0, "unknown": 0 }, "classificationChanged": false }
],
"analytics": { "status": "available", "method": "utc-daily-mean-ols", "dailyPoints": 3, "spanDays": 3, "slopePerDay": 0.06, "rSquared": 1, "meanScore": 0.22, "volatility": 0.0748, "latestVsMean": 0.08, "calendarCoverageRatio": 0.75, "methodologyComparable": true, "classificationMethods": ["ai"], "range": { "low": 0.12, "high": 0.30 } },
"momentum": { "status": "available", "method": "observed-utc-day-deltas", "movementThreshold": 0.05, "latestChange": 0.06, "latestGapDays": 1, "latestChangePerDay": 0.06, "latestClassificationChanged": false, "advances": 2, "declines": 0, "unchanged": 0, "largestMove": { "fromDate": "2026-09-15", "toDate": "2026-09-17", "change": 0.12, "gapDays": 2, "classificationChanged": false }, "currentRun": { "direction": "improving", "intervals": 2, "calendarDays": 3, "change": 0.18 }, "lastReversal": null },
"points": [
{ "at": "2026-09-15T14:00:00Z", "score": 0.12, "label": "bullish", "mentions": 22, "classification": "ai" },
{ "at": "2026-09-17T10:00:00Z", "score": 0.24, "label": "bullish", "mentions": 31, "classification": "ai" },
{ "at": "2026-09-18T12:00:00Z", "score": 0.30, "label": "bullish", "mentions": 28, "classification": "ai" }
]
}Create a free account, copy your ra_live_… key and make your first call to https://raspberrytrades.com/api/history.
Keep your key on your server — never ship it in front-end code.