1. Raw Exchange Incompatibilities vs. PredictionMarket API Unified Schema
Integrating both leading prediction market venues directly forces engineers to reconcile mismatched price units, identifier conventions, and orderbook representations.
| Dimension | Polymarket Raw APIs | Kalshi Trade API v2 | PredictionMarket API |
|---|---|---|---|
| Metadata + Depth | Split across Gamma & CLOB hosts | Events + nested markets + orderbook | 1 unified base URL (api.predictionmarketapi.dev) |
| Outcome Prices | Escaped JSON string array | Separate yes_bid_dollars / no_bid_dollars | Typed floats: yes_probability & no_probability |
| Orderbook Asks | Direct YES asks array | NO bids only (requires 1 - p transform) | Normalized YES bids[] & YES asks[] + spread_bps |
| Multivariate Noise | Mixed closed & low-liq contracts | Multivariate cross-category combos first | Filtered canonical single-event contracts |
2. Inspecting Cross-Venue Orderbook Depth with GET /v1/markets/orderbook
Pass either a Kalshi ticker (?ticker=KXELONMARS-99), a Polymarket CLOB asset (?token_id=...), or a unified ?market_id=.
Fetch Normalized Live Orderbook
Returns best_bid, best_ask, mid_price, spread_bps, total USD notional depth, and top 25 bid/ask levels.
curl -sS "https://api.predictionmarketapi.dev/v1/markets/orderbook?ticker=KXELONMARS-99" \
-H "x-api-key: pm_live_YOUR_API_KEY"import requests
book = requests.get(
"https://api.predictionmarketapi.dev/v1/markets/orderbook",
params={"ticker": "KXELONMARS-99"},
headers={"x-api-key": "pm_live_YOUR_API_KEY"},
).json()["data"]
print(book["best_bid"], book["best_ask"], book["spread_bps"])const book = await fetch(
"https://api.predictionmarketapi.dev/v1/markets/orderbook?ticker=KXELONMARS-99",
{ headers: { "x-api-key": "pm_live_YOUR_API_KEY" } }
).then(r => r.json());
console.log(book.data.spread_bps);{
"code": 0,
"provider": "https://predictionmarketapi.dev",
"status": "ok",
"data": {
"venue": "kalshi",
"ticker": "KXELONMARS-99",
"best_bid": 0.1,
"best_ask": 0.13,
"mid_price": 0.115,
"spread_bps": 300,
"total_bid_depth_usd": 1450.25,
"total_ask_depth_usd": 2910.4
}
}Interactive Quant Forecasting Underwriting Terminal · GET /v1/markets/search
Verify real-time latency, parcel credit math & JSON schema
Frequently Asked Questions
- Can I query Polymarket only or Kalshi only?
- Yes. Pass ?venue=polymarket or ?venue=kalshi to /v1/markets/search or /v1/markets/movers, or use ?venue=all to interleave both venues.