patternfetch › guide

How an AI trading agent gets a compact market-state brief in one API call

Short answer: don't put raw OHLCV candles in the model's context. Call one endpoint that returns the digested market state — compact candles, patterns, support/resistance, regime, and interpreted indicators — small enough to drop straight into a prompt or read from an MCP tool.

The problem with raw candles

The instinct when wiring market data into an LLM agent is to fetch the last few hundred OHLCV candles and paste them in. Two things go wrong:

What a market-state brief contains

patternfetch does the structural work deterministically, server-side, and returns a compact brief per (ticker, timeframe):

The one call

# 1) get a free key
curl -X POST https://patternfetch.com/v1/keys -d '{"email":"you@example.com"}'

# 2) get a brief
curl -X POST https://patternfetch.com/v1/brief \
  -H "authorization: Bearer pf_..." \
  -d '{"ticker":"BTC/USDT","timeframe":"4h"}'

Feed the returned brief — not the raw candles — into the model. Other endpoints: /v1/delta (what changed since last brief), /v1/candles (compact codec only), /v1/analogs (historical analogs). Full schema in the OpenAPI spec and llms.txt.

From an MCP agent

If your agent speaks MCP, point it at the patternfetch MCP server and call patternfetch_brief directly — no glue code. Tools: patternfetch_brief, patternfetch_delta, patternfetch_analogs, patternfetch_capabilities. Billed per call via x402 (USDC on Base, no account) or Stripe.

FAQ

Why not just send raw OHLCV candles to the LLM?

A few hundred candles is a large, repetitive block of numbers — it costs tokens on every call, and LLMs are unreliable at deriving structure from raw numbers. A brief does that computation deterministically and returns a small, structured result.

What timeframes and assets are supported?

Crypto spot pairs, minute to daily (1m, 5m, 15m, 1h, 4h, 1d).

Is this investment advice?

No. patternfetch returns impersonal market data and algorithmic signals for informational purposes only — not advice, not personalized, not a recommendation.

patternfetch provides impersonal market data and algorithmic signals for informational purposes only. NOT investment, financial, legal or tax advice and not a recommendation to buy, sell or hold any crypto-asset. Past performance and historical analogs do not guarantee future results. Crypto-assets are highly volatile. Not offered to US persons. See Disclaimer and Terms.