Get Price
Get a price for a single token.
Public endpoint — no authentication required.
Mirrors Polymarket’s GET /price?token_id=...&side=BUY|SELL.
side=BUY returns the best BID; side=SELL returns the best
ASK — matching Polymarket’s LIVE CLOB wire behaviour and its API
reference (“Returns the best bid price for BUY side or best ask
price for SELL side” — docs.polymarket.com/api-reference/
market-data/get-market-price). NOTE: PM’s own docs are
self-contradictory here — the orderbook guide
(trading/orderbook#prices) claims “getPrice BUY → Best ask”, which
contradicts PM’s actual wire. The wire is the authority; this
endpoint mirrors it. side is treated as REQUIRED at the handler
level — both missing and invalid values return 400 {"error": "Invalid side"} matching Polymarket’s CLOB contract.
Implementation note: side is declared Optional in the
FastAPI signature (not Query(...)) precisely so the missing-side
case lands in this handler — not in api_validation_error_handler
as a 422 — and yields the PM-style 400 uniformly. PM SDK porters
branching on {"error": "Invalid side"} would otherwise hit two
different envelopes for the same logical error.
Query Parameters
Required (handler-validated) — CLOB outcome token ID. Missing OR empty returns 400 {"error": "Invalid token_id"} uniformly (no 422 leak). Same handler-validation pattern as side per Polymarket's CLOB contract.
Required (handler-validated) — BUY returns the best BID, SELL returns the best ASK, matching Polymarket's live CLOB wire ("Returns the best bid price for BUY side or best ask price for SELL side" — PM api-reference, get-market-price). Mirrors Polymarket's strict-side contract: missing OR invalid side returns 400 {"error": "Invalid side"} uniformly (no 422 leak). For midpoint use GET /v1/midpoint; for last-traded price use GET /v1/last-trade-price.