Quickstart
Get your API key and make your first request in minutes.
Authentication
Secret keys, JWT public keys, and how to call the API from a browser.
API Reference
Browse every endpoint, parameter, and response shape.
Dashboard
Manage your organisation, keys, webhooks, and billing.
Why Struct?
Materialised on write
PnL, leaderboards, positions, and metrics are pre-computed as a single row. Every query is a one-row read, not a scan over months of trades.
One unified API
REST, websockets, and webhooks for every Polymarket entity in one place. No more stitching together gamma, CLOB, the subgraph, and on-chain reads.
Real-time streams
Push delivery for trades, prices, PnL, positions, and order books over websockets, plus 25+ in-app alert types and 15+ webhook event types.
Struct vs. Polymarket’s direct APIs
| Polymarket (Gamma + Data + CLOB) | Struct | |
|---|---|---|
| Surface | Three separate APIs plus the subgraph and on-chain reads | One unified REST, websocket, and webhook API |
| Trader PnL | Available; does not include fees, win rate, open positions, etc | Fee-accurate, with win rate, hold time, best/worst trade, splits, merges, and more |
| Leaderboards | Materialised, refreshed on a periodic cycle | Materialised and updated in real time as trades settle |
| Trades stream | Available; thin payload (raw on-chain fields) | Enriched payload with slug, event, image, builder code, fee breakdown, trader pseudonym, neg-risk context |
| Pending trades | Wait for chain confirmation | Streamed from the mempool before they settle |
| Per-wallet position stream | User channel, requires that wallet’s auth | Any wallet, no per-wallet auth, server-side filtered |
| Webhooks | Not available | 15+ event types with HMAC signing, retries, rotation, delivered instantly - no polling |
| In-app alerts | Not available | Whale trades, PnL crossings, probability/price spikes, volume milestones over WS or HTTP |
| JWT public-key auth | Not supported | First-class, JWKS or inline key, per-user limits |
Use cases
Trading platforms
Custom trading UIs, aggregators, and copy-trading powered by real-time Polymarket data.
AI agents
Autonomous agents that research, monitor, and trade on prediction markets.
Analytics & research
Dashboards, quant research, and large-scale historical analysis.
Start building
TypeScript SDK
Typed clients for REST, rooms, alerts, and webhook management.
WebSockets
Subscribe to trades, prices, PnL, positions, order books, and metric streams.
Webhooks
HTTP event delivery for trades, milestones, spikes, PnL crossings, and market lifecycle.
Guides
Best practices, error handling, rate limits, and recipes for common integrations.