Skip to content
Stoner Agents

API reference

Base URL https://api.stoneragents.com. Every response is JSON. The REST query string and the WebSocket filter use the same fields, so a query you test with curl is exactly what your agent will stream.

Authentication

Send your key in an X-API-Key header, as Authorization: Bearer …, or as an api_key query parameter (browsers can't set headers on WebSockets). Requests without a key work on the no-key plan with a 15-minute delay. Request a key.

The signal object

One headline and everything computed about it.

FieldMeaning
idMKT News item id.
published_atWhen the source published it (UTC).
enriched_atWhen it was scored. Delayed plans receive the item 15 minutes after this time.
headline, body, urlSource text and a link to the original.
sentiment.score−1 to +1. Risk-on (+) or risk-off (−) for US equities broadly; 0 is neutral.
sentiment.labelbullish, bearish, neutral or mixed.
sentiment.confidence0 to 1, the model's own estimate. Not a calibrated probability.
impact.magnitude0 to 10. Expected SPY reaction size: 0 irrelevant, 3–4 low, 5–6 moderate, 7–8 high, 9–10 systemic.
impact.direction, impact.scoreup, down or flat; score = magnitude × direction (−10 to +10). Sum it for net pressure.
impact.horizonintraday, days or weeks.
relevancenone, low, medium or high relevance to US-tradable markets. none forces scores to zero.
assets[]Per-symbol direction, score (−1 to +1), magnitude, horizon and a short rationale.
factors[]Market drivers moved by the news, each with pressure, confidence and a verbatim quote as evidence.
tags[]Controlled facet:value tags. See the vocabulary below.
duplicate_ofSet when the source re-issued the same story under a new id. Hidden unless you ask for duplicates.
model, versionWhich model and prompt produced the scores, for reproducible backtests.

Filters

All conditions are combined with AND. Unknown tags return a 400 error naming the tag, so typos surface immediately instead of returning nothing.

ParameterMatches signals that…
tags=a,bHas every listed tag.
any=a,bHas at least one of the listed tags.
not=a,bHas none of the listed tags.
symbols=NVDA,SPYShorthand for any=asset:NVDA,asset:SPY.
q=powellFull-text search over headline and body.
min_sentiment, max_sentimentBounds on sentiment.score.
min_abs_sentiment=0.5Strong in either direction.
min_impact=6impact.magnitude at least this.
min_confidence=0.7sentiment.confidence at least this.
direction=up|down|flatExpected SPY direction.
relevance=medium,highAny of these relevance levels.
since, untilRFC 3339 time or a lookback such as 90m, 24h, 7d.
include_duplicates=trueInclude re-issued copies.
include_pending=trueInclude items not yet scored (tag filters only).

REST endpoints

EndpointReturns
GET /v1/signalsMatching signals, newest first. limit and cursor paginate; the response has data and next_cursor.
GET /v1/signals/{id}One signal.
GET /v1/sentimentTime buckets (bucket=1h by default) with count, average and impact-weighted sentiment, net impact, bullish and bearish counts.
GET /v1/tags/topMost frequent tags among matching signals, for example what is driving today.
GET /v1/taxonomyThe full tag vocabulary and factor catalog.
GET /v1/meYour plan and today's usage.
GET /v1/plansPlan limits.
# Inflation and Fed headlines with SPY impact of 6 or more, last 24 hours
curl -H "X-API-Key: $STONER_KEY" \
  "https://api.stoneragents.com/v1/signals?any=theme:inflation,entity:fed&min_impact=6&since=24h"
REST examples

WebSocket stream

Connect to wss://api.stoneragents.com/v1/stream and send one or more subscriptions. Each has your own id and a filter in the same shape as the REST parameters (lists as arrays). Add replay: N to receive the last N matches (up to 100) before live ones; an item can arrive in both, so de-duplicate by id.

const ws = new WebSocket("wss://api.stoneragents.com/v1/stream?api_key=" + STONER_KEY);

ws.onopen = () => ws.send(JSON.stringify({
  op: "subscribe",
  id: "rates",
  filter: { any: ["theme:inflation", "entity:fed"], min_impact: 5 },
  replay: 20,               // last 20 matches first, then live
}));

ws.onmessage = (e) => {
  const m = JSON.parse(e.data);
  if (m.type === "signal") agent.consider(m.data);   // de-dup by m.data.id
};
WebSocket examples
MessageMeaning
{"op":"subscribe","id","filter","replay"}Start or replace a subscription.
{"op":"unsubscribe","id"}Stop one.
{"op":"ping"}Answered with pong. The server also pings every 25 s.
type: welcomeYour plan, including its delay.
type: signaldata is a signal; sub is your subscription id; event is replay, raw or enriched.
type: errorBad filter or limit reached; error explains which.

With include_pending: true you get a raw event as soon as a headline arrives and an enriched event when it is scored. Clients that fall more than 512 messages behind are disconnected and should reconnect.

Limits and errors

Responses carry X-Tier and, on delayed plans, X-Data-Delay-Seconds. Plan limits are listed on the pricing page.

StatusWhen
400Invalid filter, unknown tag or bad cursor. The error field says which.
401Unknown or disabled key.
403Your plan doesn't include this yet, for example a signal still inside your delay window.
429Per-minute or daily limit reached, or too many stream connections.

Tag vocabulary

Tags are facet:value. The model can only choose values from this list, which is what keeps queries reliable over time.

Loading the tag vocabulary…