Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.codex.io/llms.txt

Use this file to discover all available pages before exploring further.

This returns the order-book snapshot for a single market: best bid, best ask, last trade price, and spread per outcome. For prices across multiple markets at once (e.g. event pages, market lists), use filterPredictionMarkets, which returns market rows with their current prices inline.
This endpoint requires a Growth or Enterprise plan. Learn more.

Returns

Arguments

Usage Guidelines

  • Returns best bid, best ask, last trade price, and spread for each outcome of the market (typically YES / NO), in both USD and collateral-token (CT) units.
  • Input accepts marketId (required) and timestamp (optional, Unix seconds). Omit timestamp for the latest snapshot; pass a timestamp to fetch the snapshot as of that time.
  • Best suited for single-market detail views where you need a richer quote (bid/ask/spread) than what list-level endpoints provide.
  • For event pages or market lists, use filterPredictionMarkets. It returns prices inline with each market row and is the better fit for multi-market UIs.
  • Pair with detailedPredictionMarketStats for aggregated market statistics (volume, trade counts, trending score, lifecycle). These endpoints are complementary: detailedPredictionMarketStats gives rolled-up activity; predictionMarketPrice gives the current top-of-book.
  • Pair with predictionTraderHoldings to compute unrealized PnL on open positions.
  • Supports markets on both Polymarket (Polygon) and Kalshi.

Troubleshooting Tips

filterPredictionMarkets is the right choice for event pages, market lists, and anywhere you’re showing multiple markets at once. Each market row includes its current price inline. predictionMarketPrice is for single-market drill-down views where you need the full quote snapshot (bid/ask/spread) rather than just a current price.
Prediction markets price outcomes in their native collateral token (USDC on Polymarket, cents on Kalshi). The fields suffixed CT (bestBidCT, bestAskCT, spreadCT, lastTradePriceCT) return the collateral-token value; the Usd-suffixed fields return the USD equivalent. Choose whichever matches how you display prices in your UI.
Yes. Pass a Unix timestamp in the input to get the snapshot as of that time. Omit timestamp to get the latest.
The market may be newly listed with no activity yet, or the marketId may be malformed. Confirm the marketId is correct and the market is on Polymarket or Kalshi.