Market-state brief for AI trading agents

How does an AI trading agent get a compact market-state brief in one API call?

Crypto-first. Impersonal and non-directive by design — data, never buy/sell advice.

Short answer: An AI trading agent gets a compact market-state brief by calling patternfetch's POST /v1/brief endpoint — or its MCP tool — with a ticker and a timeframe. Instead of raw OHLCV, one call returns compact candles + a SAX shape signature, detected chart/candlestick patterns, support/resistance clusters, a trend/regime label, and interpreted indicators (RSI/EMA/ATR) plus a one-line summary — a fraction of the tokens, with the structure already computed server-side.

The problem with raw candles

The usual approach dumps hundreds of OHLCV rows per ticker straight into the model context. That is expensive in tokens, slow, and the model re-derives the same support levels, patterns, and indicator readings on every single call. The structure work is repeated, and the context window fills with numbers the agent mostly ignores.

The one call

patternfetch moves that work server-side. The agent sends only what it wants to look at:

curl -X POST https://patternfetch.com/v1/brief \
  -H "Authorization: Bearer <key>" -H "Content-Type: application/json" \
  -d '{"ticker":"BTC","timeframe":"1h"}'

Via MCP, an agent adds the server once and calls the same brief as a tool:

{ "mcpServers": { "patternfetch": {
  "url": "https://patternfetch.com/mcp",
  "headers": { "Authorization": "Bearer YOUR_KEY" } } } }

Get a key (free $3.00 credit): POST https://patternfetch.com/v1/keys {"email":"you@example.com"}

What comes back

FieldWhat it is
compact candlesdown-sampled rows + a SAX shape signature (the trend shape as a short string)
patternsdouble top/bottom, head & shoulders, engulfing, hammer, doji, …
support / resistanceclustered price levels with proximity to current price
regimetrend/volatility label (e.g. up-trend, ranging, high-vol)
indicatorsinterpreted RSI / EMA / ATR — readings, not raw arrays
summaryone-line natural-language state for the agent to reason over
EndpointUsePrice
/v1/brieffull market-state brief$0.01
/v1/deltaonly what changed since your last brief (cheap polling)$0.008
/v1/candlescompact candle codec only$0.005
/v1/analogshistorical outcome distribution (n, win-rate, median, min/max)$0.05

Pay per call via x402 (USDC on Base, no account) or Stripe. Every response carries an exact cost block.

The honesty layer: every pattern ships its base rate

Most pattern and signal APIs hand a model a confident-looking "double_bottom", 0.86 and let it quote that blind. patternfetch attaches an evidence block to every detected pattern — the backtested historical hit-rate for that exact pattern, timeframe and confidence band, the pattern-free baseline for the same market and horizon, and a cluster-robust interval on the difference — measured with no lookahead (chart patterns are scored only from the bar they become knowable). A hit rate on its own cannot be read: a drifting market moves it away from 50% with no pattern involved. Measured against the baseline instead, three of the 105 buckets we tested clear an uncorrected interval — fewer than the ~5.3 that chance alone would produce — and the only one that lands above its baseline (double_top, 1d, +9.78pp, n=149) does not survive correcting for 105 comparisons; on US stocks it is 0 of 60. The evidence block reports that, instead of laundering a shape score into a confident call. Impersonal market data, not advice. See the method →

FAQ

What is a market-state brief?
A compact, structured summary of one asset on one timeframe — candles + shape signature, patterns, support/resistance, regime, interpreted indicators — that replaces raw OHLCV in an agent's context.
Why not feed raw candles to the model?
Hundreds of rows per ticker is token-heavy and slow, and the model re-computes the same structure each call. patternfetch computes it once, server-side.
Which assets and timeframes?
Crypto-first (BTC, ETH, SOL, …) from minute to daily timeframes. GET /v1/platforms returns the live matrix.
Is this financial advice?
No — impersonal, non-directive market data only. Never recommendations.