Skip to main content
Use the Real-Time Data API when you need raw market data for a terminal, dashboard, bot, or trading agent. This surface is separate from simplefunctions.dev/api/public/*. The public API is for analytical objects and agent workflows. The data API is for fast market data. Last verified: 2026-05-06.

Base URLs

REST:
Current public WebSocket:
Do not use wss://data.simplefunctions.dev/v1/ws yet. It is the intended canonical data-domain WebSocket name, but current routing can return 426 Upgrade Required. Use wss://app.simplefunctions.dev/ws until the WS route is moved off Vercel or a direct WS CNAME is configured.

Data conventions

Coverage and hydration

The data API is backed by an in-memory market registry plus venue REST fallbacks. Hydration is exact-ticker only. It is not a general text-search crawler.

REST endpoints

Heartbeat

Markets

Market object:
Parameters: Response:

Raw snapshot

Use this for bot cold-start. It intentionally omits title, close time, and heat to keep the payload small. Markets pinned outside [0.01, 0.99] are excluded.

Movers

Parameters: /v1/movers is powered by in-memory tick/trade samples. After deploy or reconnect, short windows can return count: 0 until samples accumulate.

Orderbook, candles, trades

For valid Kalshi tickers that are not already in the warm registry, the market, orderbook, and candle paths attempt direct venue hydration before returning the current cache view. Orderbook:
Candles:
Trades:

WebSocket

Subscribe:
Unsubscribe:
Legacy single-topic subscribe is also accepted:

WebSocket topics

When subscribing to a ticker topic, the server may send initial cached ticker_info and orderbook frames if available.

Frame shapes

featured:
ticker_info:
orderbook, trade, and candle use the same shapes as the REST examples above, with a top-level type.

Operational notes

  • Public REST callers use https://data.simplefunctions.dev/v1; the edge proxy injects the internal origin token.
  • Direct origin routes at https://app.simplefunctions.dev/api/data/v1/* are edge-token gated and return 403 without the internal token.
  • Anonymous WebSocket connections are capped per IP.
  • The server pings WebSocket clients every 30 seconds and closes stale connections after a failed pong.
  • Kalshi and Polymarket are normalized into one ticker namespace, but not all fields are available from both venues.
  • A non-empty market response and an empty trades response can both be healthy: trades are process-local recent prints, while market metadata can be hydrated from venue REST.