Use this cookbook when you need to assemble live market data into an agent or trading workflow. The Real-Time Data API page lists endpoints. This page shows how to combine them with the CLI and agent APIs. Last live probe: 2026-05-06 UTC, after the data API registry-hydration deploy.Documentation Index
Fetch the complete documentation index at: https://docs.simplefunctions.dev/llms.txt
Use this file to discover all available pages before exploring further.
Tested observations
The live probes produced these operational facts:| Probe | Result |
|---|---|
sf discover --quality --json --limit 3 | Returned ranked opportunities from world, contagion, cross-venue, ideas, and new markets. |
sf inspect KXHORMUZWEEKLY-26MAY10-T40 --json | Returned price, best bid/ask, spread, volume, indicators, regime, contagion, trend, and next actions. |
sf book KXHORMUZWEEKLY-26MAY10-T40 --json | Returned bid/ask levels and depth. |
GET /v1/search?q=fed&limit=2 | Returned autocomplete-grade Polymarket results. |
GET /v1/search?q=KXHORMUZWEEKLY-26MAY10-T40&limit=5&strict=0 | Hydrated and returned the exact Kalshi ticker with score 1000. |
GET /v1/markets/KXHORMUZWEEKLY-26MAY10-T40 | Hydrated and returned Kalshi metadata, last price, best bid/ask, volume, close time, and heat. |
GET /v1/movers?window=1h&n=3&minVol=1000 | Returned live movers, mostly Polymarket in this probe. |
GET /v1/orderbook/KXHORMUZWEEKLY-26MAY10-T40 | Hydrated the market and returned non-empty bids, asks, and ts. |
GET /v1/candles/KXHORMUZWEEKLY-26MAY10-T40?tf=1h&limit=5 | Returned five 1-hour OHLCV candles. |
GET /v1/trades/KXHORMUZWEEKLY-26MAY10-T40?limit=5 | Returned an empty recent-trades array, which is normal when no recent in-memory trade prints are cached. |
sf inspect and sf book remain the richer analytical fallback because they add regime, indicators, suggestion, and CLI-native receipts.
Choose the right surface
| Need | Use first | Fallback |
|---|---|---|
| Cold-start candidate list | sf discover --quality --json | GET /v1/movers, GET /v1/search |
| Ticker autocomplete | GET /v1/search?q=... | sf query ... --json |
| Agent world context | sf world --json | GET /api/agent/world?format=json |
| One market dossier | sf inspect <ticker> --json | GET /api/agent/inspect/{ticker} |
| Orderbook depth | GET /v1/orderbook/{ticker} | sf book <ticker> --json |
| Fast movers | GET /v1/movers | sf discover --quality --json |
| Historical strategy check | sf backtest <ticker> ... --json | stored traces / snapshots |
| Custom market making | GET /v1/orderbook, GET /v1/trades, WebSocket | QuoteEngine paper mode |
Cold-start loop
Start broad:Data API cold start
Use data API search and movers before subscribing to individual topics:| Field | Convention |
|---|---|
| Data API prices | Decimal probabilities in [0, 1]. |
| CLI prices | Usually cents for human/agent trade surfaces. |
generated_at | Unix seconds. |
ts | Unix milliseconds. |
| Exact Kalshi ticker miss | The API attempts direct Kalshi hydration before returning not found or an empty cache. |
| Empty orderbook | Usually invalid ticker, inactive venue book, temporary venue failure, or an actually empty market. Check /v1/markets/{ticker} next. |
| Empty trades | Often just no recent in-memory trade prints for that process. It is not proof that the market has never traded. |
Coverage contract
The data API has two layers:| Layer | What it covers | How to use it |
|---|---|---|
| Warm registry | Fast browse, featured, snapshot, movers, and common search. | Use for cold start and broad discovery. |
| Exact-ticker hydration | Valid Kalshi tickers that missed the warm registry. | Use /v1/markets/{ticker}, /v1/orderbook/{ticker}, /v1/candles/{ticker}, or exact ticker search. |
sf discover, sf query, /v1/search, /v1/movers, and /v1/snapshot.
Orderbook fallback pattern
When building a market-making or alpha pipeline, use a fallback chain:WebSocket subscription
Use WebSocket when you have a known ticker set:discover, movers, search, or snapshot.
Replay record shape
For custom research, store normalized frames:Alpha research packet
A practical read-only packet for an agent:dataPoints as a warning that the result is not a full evaluation.
Market-making packet
Before creating a quote:Related docs
Real-Time Data API
Endpoint reference and WebSocket topics.
Market making
QuoteEngine workflow and operational gates.
Evaluation and replay
How to evaluate agents and strategies from traces and backtests.
World Model
Agent context and delta strategy.