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.
| Field | Meaning |
|---|---|
| id | MKT News item id. |
| published_at | When the source published it (UTC). |
| enriched_at | When it was scored. Delayed plans receive the item 15 minutes after this time. |
| headline, body, url | Source 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.label | bullish, bearish, neutral or mixed. |
| sentiment.confidence | 0 to 1, the model's own estimate. Not a calibrated probability. |
| impact.magnitude | 0 to 10. Expected SPY reaction size: 0 irrelevant, 3–4 low, 5–6 moderate, 7–8 high, 9–10 systemic. |
| impact.direction, impact.score | up, down or flat; score = magnitude × direction (−10 to +10). Sum it for net pressure. |
| impact.horizon | intraday, days or weeks. |
| relevance | none, 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_of | Set when the source re-issued the same story under a new id. Hidden unless you ask for duplicates. |
| model, version | Which 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.
| Parameter | Matches signals that… |
|---|---|
| tags=a,b | Has every listed tag. |
| any=a,b | Has at least one of the listed tags. |
| not=a,b | Has none of the listed tags. |
| symbols=NVDA,SPY | Shorthand for any=asset:NVDA,asset:SPY. |
| q=powell | Full-text search over headline and body. |
| min_sentiment, max_sentiment | Bounds on sentiment.score. |
| min_abs_sentiment=0.5 | Strong in either direction. |
| min_impact=6 | impact.magnitude at least this. |
| min_confidence=0.7 | sentiment.confidence at least this. |
| direction=up|down|flat | Expected SPY direction. |
| relevance=medium,high | Any of these relevance levels. |
| since, until | RFC 3339 time or a lookback such as 90m, 24h, 7d. |
| include_duplicates=true | Include re-issued copies. |
| include_pending=true | Include items not yet scored (tag filters only). |
REST endpoints
| Endpoint | Returns |
|---|---|
| GET /v1/signals | Matching signals, newest first. limit and cursor paginate; the response has data and next_cursor. |
| GET /v1/signals/{id} | One signal. |
| GET /v1/sentiment | Time buckets (bucket=1h by default) with count, average and impact-weighted sentiment, net impact, bullish and bearish counts. |
| GET /v1/tags/top | Most frequent tags among matching signals, for example what is driving today. |
| GET /v1/taxonomy | The full tag vocabulary and factor catalog. |
| GET /v1/me | Your plan and today's usage. |
| GET /v1/plans | Plan 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"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
};| Message | Meaning |
|---|---|
| {"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: welcome | Your plan, including its delay. |
| type: signal | data is a signal; sub is your subscription id; event is replay, raw or enriched. |
| type: error | Bad 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.
| Status | When |
|---|---|
| 400 | Invalid filter, unknown tag or bad cursor. The error field says which. |
| 401 | Unknown or disabled key. |
| 403 | Your plan doesn't include this yet, for example a signal still inside your delay window. |
| 429 | Per-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…