patternfetch logo patternfetch

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

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.

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

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 $0.05 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

Related calls

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.

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.

Get a key & try patternfetch →