Get Market
Fetch a single market’s detail with live price.
If include_book is true, the response also includes
a book key with the CLOB order-book snapshot (async, best-effort).
(include_book=true bypasses the SSR cache wrapper since each
book snapshot is volatile and would dirty the cached payload.)
P2.3 cache-hit DB-hold fix (sibling of P2.2 on auth.py): no
db: Session = Depends(get_db) at signature level. The Redis
cache-hit branch (the common case) returns without ever touching
DB; only the cache-miss branch lazily acquires a session via
_lazy_db_session(). This frees one pool slot per cache-hit
request, multiplied by the entire request lifetime — same pattern
as the P2.2 keystone fix.
PR (2026-05-17): wrapped in the SSR cache + single-flight helper. Under FE Next.js SSR fan-out (~30-60 parallel reads per render), every concurrent cache-cold request was doing its own DB lookup + response assembly. The wrapper coalesces them to ONE compute per (worker, condition_id, 15s window) — definitive fix for the pool-starvation failure class. See PR body for the full story.
Authorizations
Issue from /v1/keys (or admin-issued for enterprise tier).
Headers
Your PolySimulator API key
Polymarket-CLOB-compat alias for X-API-Key (underscore form). SDK clients ported from Polymarket can authenticate without changing header names. X-API-Key takes precedence when both are provided.
PM-CLOB-compat dashed-form alias for X-API-Key. Same value semantics as POLY_API_KEY but with HTTP-conventional dash separators. Audit P1 (staging audit 2026-05-16 0817 PR #1296): the per-tier middleware accepts both spellings but the auth dependency originally only matched the underscore form — now both work end-to-end.
PM-CLOB-compat: Authorization: Bearer ps_live_... (or ps_test_...) is accepted as an alias for X-API-Key so py-clob-client and other ported SDKs authenticate without header name changes. Bearer JWTs are NOT accepted here — use the dashboard-auth endpoints for those.
Path Parameters
Query Parameters
Include CLOB order book
Response
Successful Response
CLOB token ids for this market's outcomes ([yes_id, no_id]). Pass to /v1/clob/book/{token_id} to fetch the L2 order book. May be null for archived markets with no tracked outcomes.
Rolling 24-hour volume from the poller cache (USD). Stringified for floating-point precision safety. null when the poller has not yet observed this market — distinct from "0" which means zero trades.
Last trade price for the YES token (0.0–1.0 implied probability). Stringified for precision. null when untracked; for the real-time top-of-book bid/ask use live_price.buy / live_price.sell.
PM-shape per-outcome token list. Each entry carries {token_id, outcome, price, winner} — the documented Polymarket contract that py-clob-client reads. price is the YES/NO probability at response-build time; winner is True only when the market is resolved AND this outcome is the settled winner (NEVER derived from price >= 0.99). For the legacy CLOB asset-id string list use clob_token_ids.
PM-shape: alias of condition_id (the on-chain market identifier). PM SDKs read this key by name; we surface the same value under both keys for cross-SDK compatibility.
PM-shape: alias of slug. PM SDKs use market_slug; polysim has historically used slug. Both are exposed with the same value so SDKs that branch on either key work.
PM-shape: negative-risk routing flag. true when the market is part of a negative-risk auction (single-winner across many outcomes); false for standard binary. null if not classified — treat as false.