Signature
Parameters
The outcome token ID to get pricing for.
Returns
| Field | Type | Description |
|---|---|---|
token_id | string | The token ID |
last_price | float or None | Last traded price (None if unavailable) |
midpoint | float or None | Midpoint between best bid and ask (None if order book unavailable) |
best_bid | float or None | Best (highest) bid price (None if no bids) |
best_ask | float or None | Best (lowest) ask price (None if no asks) |
All price fields may be
None if market data is temporarily unavailable. Always check for None values before using.Why Use This Over Polymarket’s Gamma API?
Polymarket’s Gamma API only returnslast_price—the most recent trade price. This can be stale on low-volume markets or misleading if the last trade was a one-off.
get_ticker() combines two data sources in a single call:
| Field | Source | Why It Matters |
|---|---|---|
last_price | Gamma API | Historical reference |
best_bid / best_ask | Live CLOB order book | Real liquidity you can trade against |
midpoint | Calculated from bid/ask | More accurate fair value than last trade |
- Real-time order book depth — see actual prices you can buy/sell at right now
- Automatic fallback — if Gamma is slow, falls back to CLOB data
- Better fair value — midpoint reflects current market, not last trade