{"openapi":"3.1.0","info":{"title":"The Prediction Markets API","description":"\nCompare Kalshi and Polymarket in one API: events matched across both venues, every\noutcome's live price with its freshness, price history, cross-venue gaps and a\nlive-quote WebSocket.\n\n**Quick start**\n1. Get a key at [thepredictionmarkets.com/api-keys](https://thepredictionmarkets.com/api-keys)\n   (or click **Authorize** and use the demo key `tpm_demo_key_authorized_2026`).\n2. Send it as the `X-API-Key` header.\n3. `GET /api/public/v1/events?q=fed` → pick a `slug` → `GET /api/public/v1/events/{slug}`.\n\n**Conventions**\n- Prices are probabilities from 0 to 1. Missing numbers are `null`, never `0`.\n- Every price carries `quote.freshness`: `live`, `fresh`, `aging`, `stale` or `unknown`.\n- Lists return `{data, pagination}`; pass `pagination.next_cursor` as `cursor` for the next page.\n- Errors return `{\"error\": {\"code\", \"message\", \"request_id\"}}` with dotted codes such as\n  `auth.invalid_key`, `rate_limit.per_second`, `validation.invalid_parameter`, `not_found.event`.\n- Every response has `X-Request-ID`; keyed responses have `X-RateLimit-*` and `X-Quota-*`\n  headers, and a 429 has `Retry-After`.\n\n**Live quotes:** WebSocket `wss://api.thepredictionmarkets.com/api/public/v1/stream`\n(protocol `tpm.quotes.v1`). Subscribe with the `stream` ids from any outcome in this API.\n[WebSocket guide](https://thepredictionmarkets.com/api/docs/websocket).\n\n**Stability:** v1 only grows. Fields and endpoints are added, never renamed or removed;\na breaking change would ship as `/api/public/v2` with notice.\n","version":"1.0.0"},"servers":[{"url":".","description":"This server"},{"url":"https://api.thepredictionmarkets.com","description":"Production"}],"paths":{"/api/public/v1/status":{"get":{"tags":["Status"],"summary":"API and venue health","description":"Is the API up, how fresh is each venue's catalog, and is its live feed healthy.\nNo API key needed; does not count against your quota.","operationId":"get_status_api_public_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiStatus"}}}}}}},"/api/public/v1/rate-limit":{"get":{"tags":["Account"],"summary":"Your plan and usage","description":"Your key's plan, per-second limit and this month's usage. Calling it is not counted\nas a data request, but it does pass through the same per-second limit.","operationId":"get_rate_limit_api_public_v1_rate_limit_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RateLimitStatus"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/public/v1/events":{"get":{"tags":["Events"],"summary":"List and search events","description":"An event is one real-world question (e.g. *Democratic nominee 2028*) with its listings\non Kalshi and Polymarket grouped together. Rows carry the leading outcome's price and a\ncatalog `freshness`. For prices of every outcome, fetch `/events/{slug}`.","operationId":"list_events_api_public_v1_events_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search event titles, e.g. `fed rate` or `nba champion`.","title":"Q"},"description":"Search event titles, e.g. `fed rate` or `nba champion`."},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Category slug from `/categories`.","examples":["politics"],"title":"Category"},"description":"Category slug from `/categories`."},{"name":"venue","in":"query","required":false,"schema":{"anyOf":[{"enum":["kalshi","polymarket"],"type":"string"},{"type":"null"}],"description":"Only events listed on this venue.","title":"Venue"},"description":"Only events listed on this venue."},{"name":"status","in":"query","required":false,"schema":{"enum":["active","trading","closed","resolved","all"],"type":"string","description":"`active` (default), `trading` (a venue still trades it), `closed`, `resolved` or `all`.","default":"active","title":"Status"},"description":"`active` (default), `trading` (a venue still trades it), `closed`, `resolved` or `all`."},{"name":"tag","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Comma-separated topic tags.","title":"Tag"},"description":"Comma-separated topic tags."},{"name":"closing_within_days","in":"query","required":false,"schema":{"anyOf":[{"enum":[1,7,30],"type":"integer"},{"type":"null"}],"description":"Only events closing within 1, 7 or 30 days.","title":"Closing Within Days"},"description":"Only events closing within 1, 7 or 30 days."},{"name":"sort","in":"query","required":false,"schema":{"enum":["trending","volume","probability_change","end_date","created_at"],"type":"string","default":"trending","title":"Sort"}},{"name":"order","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"desc","title":"Order"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse_EventSummary_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad parameter (`validation.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/public/v1/events/{slug}":{"get":{"tags":["Events"],"summary":"One event with every venue's prices","description":"Every venue market for the event, each outcome's current quote (live when the venue\nfeed has it), how outcomes are matched across venues, and the cross-venue price gap per\nmatched outcome. Gaps are gross: before fees and order-book depth.","operationId":"get_event_api_public_v1_events__slug__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","description":"Event slug from `/events`.","examples":["democratic-presidential-nominee-2028"],"title":"Slug"},"description":"Event slug from `/events`."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemResponse_EventDetail_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not tracked (`not_found.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/public/v1/events/{slug}/history":{"get":{"tags":["Events"],"summary":"Price history for an outcome","description":"OHLC candles built from the live quote stream where we have it, otherwise polled\nprice snapshots (`source` says which). Prices are probabilities 0-1.","operationId":"get_event_history_api_public_v1_events__slug__history_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"slug","in":"path","required":true,"schema":{"type":"string","examples":["democratic-presidential-nominee-2028"],"title":"Slug"}},{"name":"outcome_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Outcome `id` from `/events/{slug}`; defaults to the leading outcome.","title":"Outcome Id"},"description":"Outcome `id` from `/events/{slug}`; defaults to the leading outcome."},{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":4320,"minimum":1,"description":"How far back, in hours (default 7 days, max 180 days).","default":168,"title":"Hours"},"description":"How far back, in hours (default 7 days, max 180 days)."},{"name":"interval_minutes","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":1440,"minimum":1},{"type":"null"}],"description":"Candle width; chosen automatically when omitted.","title":"Interval Minutes"},"description":"Candle width; chosen automatically when omitted."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemResponse_History_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not tracked (`not_found.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/public/v1/categories":{"get":{"tags":["Events"],"summary":"Categories","description":"Category slugs for the `category` filter, with active event counts.","operationId":"list_categories_api_public_v1_categories_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse_Category_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"security":[{"APIKeyHeader":[]}]}},"/api/public/v1/markets":{"get":{"tags":["Markets"],"summary":"List venue markets","description":"The raw venue listings TPM tracks (a Kalshi event ticker or a Polymarket event),\nlargest by volume first. Use this to mirror a venue catalog or map venue ids to TPM\nevents; use `/events` for the cross-venue view.","operationId":"list_markets_api_public_v1_markets_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"venue","in":"query","required":false,"schema":{"anyOf":[{"enum":["kalshi","polymarket"],"type":"string"},{"type":"null"}],"title":"Venue"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Search titles and venue ids.","title":"Q"},"description":"Search titles and venue ids."},{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only markets grouped under this event slug.","title":"Event"},"description":"Only markets grouped under this event slug."},{"name":"status","in":"query","required":false,"schema":{"enum":["active","all"],"type":"string","default":"active","title":"Status"}},{"name":"include","in":"query","required":false,"schema":{"anyOf":[{"enum":["outcomes"],"const":"outcomes","type":"string"},{"type":"null"}],"description":"`outcomes` adds each market's outcomes and quotes.","title":"Include"},"description":"`outcomes` adds each market's outcomes and quotes."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"`next_cursor` from the previous page.","title":"Cursor"},"description":"`next_cursor` from the previous page."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse_Market_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad parameter (`validation.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/public/v1/markets/{venue}/{market_id}":{"get":{"tags":["Markets"],"summary":"One venue market with outcomes and rules","description":"A single venue listing with every outcome's quote and the settlement rules text.","operationId":"get_market_api_public_v1_markets__venue___market_id__get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"venue","in":"path","required":true,"schema":{"enum":["kalshi","polymarket"],"type":"string","title":"Venue"}},{"name":"market_id","in":"path","required":true,"schema":{"type":"string","description":"Kalshi event ticker or Polymarket event slug.","examples":["KXPRESNOMD-28"],"title":"Market Id"},"description":"Kalshi event ticker or Polymarket event slug."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemResponse_Market_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not tracked (`not_found.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/public/v1/matches":{"get":{"tags":["Matching"],"summary":"Find the same market on the other venue","description":"Give a venue link (`url`) or a venue id (`venue` + `id`); get the TPM event and the\nmatching markets on the other venue. `match_state` says how sure we are; settlement\nrules can still differ, so check `/events/{slug}` before treating prices as one bet.","operationId":"find_matches_api_public_v1_matches_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"url","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"A Kalshi or Polymarket market or event link.","examples":["https://kalshi.com/markets/kxpresnomd"],"title":"Url"},"description":"A Kalshi or Polymarket market or event link."},{"name":"venue","in":"query","required":false,"schema":{"anyOf":[{"enum":["kalshi","polymarket"],"type":"string"},{"type":"null"}],"description":"With `id`: the venue the id belongs to.","title":"Venue"},"description":"With `id`: the venue the id belongs to."},{"name":"id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"With `venue`: a market id or contract id (Kalshi ticker, Polymarket event slug or condition id).","title":"Id"},"description":"With `venue`: a market id or contract id (Kalshi ticker, Polymarket event slug or condition id)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ItemResponse_MatchResult_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad parameter (`validation.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Not tracked (`not_found.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/public/v1/prices":{"get":{"tags":["Prices"],"summary":"Latest quotes for up to 100 contracts","description":"One request for many prices. Each row has the same quote, freshness and stream ids as\n`/events/{slug}`; ids TPM does not track come back in `unresolved`. For continuous\nupdates, subscribe on the WebSocket with each row's `stream` ids instead of polling.","operationId":"get_prices_api_public_v1_prices_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"ids","in":"query","required":true,"schema":{"type":"string","description":"Comma-separated `venue:contract_id` pairs (Kalshi market ticker, Polymarket condition id), up to 100.","examples":["kalshi:KXPRESNOMD-28-GN,kalshi:KXPRESNOMD-28-JOSS"],"title":"Ids"},"description":"Comma-separated `venue:contract_id` pairs (Kalshi market ticker, Polymarket condition id), up to 100."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PricesResponse"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"400":{"description":"Bad parameter (`validation.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/public/v1/spreads":{"get":{"tags":["Spreads"],"summary":"Cross-venue price gaps","description":"Where the same outcome is cheaper to buy on one venue than it sells for on the other,\nfrom executable bid/ask. Gaps are **gross**: before fees, and not capped by order-book\ndepth, so a gap is a lead to check, not guaranteed arbitrage.","operationId":"list_spreads_api_public_v1_spreads_get","security":[{"APIKeyHeader":[]}],"parameters":[{"name":"event","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only this event slug.","title":"Event"},"description":"Only this event slug."},{"name":"min_gap","in":"query","required":false,"schema":{"type":"number","maximum":1.0,"minimum":0.0,"description":"Minimum gap in probability points (0.02 = 2 points).","default":0.02,"title":"Min Gap"},"description":"Minimum gap in probability points (0.02 = 2 points)."},{"name":"min_volume","in":"query","required":false,"schema":{"type":"number","minimum":0.0,"description":"Minimum volume on each venue.","default":1000.0,"title":"Min Volume"},"description":"Minimum volume on each venue."},{"name":"parity","in":"query","required":false,"schema":{"enum":["reviewed","any"],"type":"string","description":"`reviewed` (default): only outcomes whose settlement rules a person checked match. `any`: every matched outcome; rules may differ.","default":"reviewed","title":"Parity"},"description":"`reviewed` (default): only outcomes whose settlement rules a person checked match. `any`: every matched outcome; rules may differ."},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ListResponse_Spread_"}}}},"401":{"description":"Missing or invalid API key (`auth.*`).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"429":{"description":"Rate limit or monthly quota exceeded (`rate_limit.*`); see `Retry-After`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}}},"components":{"schemas":{"ApiStatus":{"properties":{"status":{"type":"string","enum":["ok","degraded"],"title":"Status"},"api_version":{"type":"string","title":"Api Version","examples":["v1"]},"server_time":{"type":"string","title":"Server Time"},"venues":{"items":{"$ref":"#/components/schemas/VenueStatus"},"type":"array","title":"Venues"}},"type":"object","required":["status","api_version","server_time","venues"],"title":"ApiStatus"},"CatalogFreshness":{"properties":{"state":{"type":"string","enum":["fresh","aging","stale","unknown"],"title":"State"},"age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age Seconds"},"observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observed At"}},"type":"object","required":["state"],"title":"CatalogFreshness"},"Category":{"properties":{"slug":{"type":"string","title":"Slug","examples":["politics"]},"name":{"type":"string","title":"Name","examples":["Politics"]},"event_count":{"type":"integer","title":"Event Count"}},"type":"object","required":["slug","name","event_count"],"title":"Category"},"ErrorBody":{"properties":{"code":{"type":"string","title":"Code","description":"Stable, dotted error code.","examples":["not_found.event"]},"message":{"type":"string","title":"Message","examples":["Event not found"]},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id","description":"Quote this when contacting support."}},"type":"object","required":["code","message"],"title":"ErrorBody"},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorBody"}},"type":"object","required":["error"],"title":"ErrorResponse"},"EventDetail":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug"},"title":{"type":"string","title":"Title"},"question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Question"},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"resolution":{"$ref":"#/components/schemas/Resolution"},"comparison":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Comparison","description":"`verified`: venues list the same bet. `comparable`: similar, check the rules. Absent for one venue."},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"venues":{"items":{"type":"string","enum":["kalshi","polymarket"]},"type":"array","title":"Venues"},"markets":{"items":{"$ref":"#/components/schemas/Market"},"type":"array","title":"Markets"},"spreads":{"items":{"$ref":"#/components/schemas/OutcomeSpread"},"type":"array","title":"Spreads"},"web_url":{"type":"string","title":"Web Url"}},"type":"object","required":["id","slug","title","resolution","venues","markets","spreads","web_url"],"title":"EventDetail"},"EventSummary":{"properties":{"id":{"type":"string","title":"Id"},"slug":{"type":"string","title":"Slug","examples":["democratic-presidential-nominee-2028"]},"title":{"type":"string","title":"Title","examples":["Democratic Presidential Nominee 2028"]},"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category","examples":["politics"]},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","examples":["active"]},"trading_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Trading State","description":"`trading` while a venue still trades it."},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"venues":{"items":{"type":"string","enum":["kalshi","polymarket"]},"type":"array","title":"Venues","examples":[["kalshi","polymarket"]]},"outcome_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Outcome Count"},"leading_outcome":{"$ref":"#/components/schemas/LeadingOutcome"},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"volume_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume 24H"},"liquidity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Liquidity"},"freshness":{"$ref":"#/components/schemas/CatalogFreshness"},"web_url":{"type":"string","title":"Web Url","examples":["https://thepredictionmarkets.com/odds/democratic-presidential-nominee-2028"]}},"type":"object","required":["id","slug","title","leading_outcome","freshness","web_url"],"title":"EventSummary"},"History":{"properties":{"event_slug":{"type":"string","title":"Event Slug"},"outcome_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome Id"},"source":{"type":"string","title":"Source","description":"`quote_candles` (streamed by TPM), `venue_history` (the venue's own price history, for markets TPM doesn't stream), `mixed` (venue history for the older part, streamed candles after), `snapshots` (legacy polls) or `none`."},"interval_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Interval Minutes"},"points":{"items":{"$ref":"#/components/schemas/HistoryPoint"},"type":"array","title":"Points"}},"type":"object","required":["event_slug","source","points"],"title":"History"},"HistoryPoint":{"properties":{"timestamp":{"type":"string","title":"Timestamp"},"probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Probability","description":"Close price for candles."},"open":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Open"},"high":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"High"},"low":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Low"},"close":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Close"}},"type":"object","required":["timestamp"],"title":"HistoryPoint"},"ItemResponse_EventDetail_":{"properties":{"data":{"$ref":"#/components/schemas/EventDetail"}},"type":"object","required":["data"],"title":"ItemResponse[EventDetail]"},"ItemResponse_History_":{"properties":{"data":{"$ref":"#/components/schemas/History"}},"type":"object","required":["data"],"title":"ItemResponse[History]"},"ItemResponse_Market_":{"properties":{"data":{"$ref":"#/components/schemas/Market"}},"type":"object","required":["data"],"title":"ItemResponse[Market]"},"ItemResponse_MatchResult_":{"properties":{"data":{"$ref":"#/components/schemas/MatchResult"}},"type":"object","required":["data"],"title":"ItemResponse[MatchResult]"},"LeadingOutcome":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","examples":["Gavin Newsom"]},"probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Probability","examples":[0.16]},"change_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Change 24H"}},"type":"object","title":"LeadingOutcome"},"ListResponse_Category_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Category"},"type":"array","title":"Data"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}]}},"type":"object","required":["data"],"title":"ListResponse[Category]"},"ListResponse_EventSummary_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/EventSummary"},"type":"array","title":"Data"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}]}},"type":"object","required":["data"],"title":"ListResponse[EventSummary]"},"ListResponse_Market_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Market"},"type":"array","title":"Data"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}]}},"type":"object","required":["data"],"title":"ListResponse[Market]"},"ListResponse_Spread_":{"properties":{"data":{"items":{"$ref":"#/components/schemas/Spread"},"type":"array","title":"Data"},"pagination":{"anyOf":[{"$ref":"#/components/schemas/Pagination"},{"type":"null"}]}},"type":"object","required":["data"],"title":"ListResponse[Spread]"},"Market":{"properties":{"venue":{"type":"string","enum":["kalshi","polymarket"],"title":"Venue"},"market_id":{"type":"string","title":"Market Id","description":"The venue's listing: Kalshi event ticker or Polymarket event slug.","examples":["KXPRESNOMD-28"]},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","examples":["Democratic presidential nominee 2028"]},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url","examples":["https://kalshi.com/markets/kxpresnomd"]},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","examples":["active"]},"event_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Slug","examples":["democratic-presidential-nominee-2028"]},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"liquidity":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Liquidity"},"end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"},"last_seen_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Seen At","description":"Last time TPM polled this listing from the venue."},"outcome_count":{"type":"integer","title":"Outcome Count","default":0},"outcomes":{"anyOf":[{"items":{"$ref":"#/components/schemas/Outcome"},"type":"array"},{"type":"null"}],"title":"Outcomes","description":"Included on single-market requests and with `include=outcomes`."},"rules":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rules","description":"Settlement rules text, on single-market requests."}},"type":"object","required":["venue","market_id"],"title":"Market"},"MarketRef":{"properties":{"venue":{"type":"string","enum":["kalshi","polymarket"],"title":"Venue"},"market_id":{"type":"string","title":"Market Id","examples":["KXPRESNOMD-28"]},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},"type":"object","required":["venue","market_id"],"title":"MarketRef"},"MatchResult":{"properties":{"source":{"$ref":"#/components/schemas/MarketRef","description":"The venue market your link or id points at."},"matched_contract":{"anyOf":[{"$ref":"#/components/schemas/MatchedContract"},{"type":"null"}],"description":"The contract a link or id pointed at, when narrower than the market."},"event_slug":{"type":"string","title":"Event Slug","description":"TPM event for `/events/{slug}`."},"web_url":{"type":"string","title":"Web Url"},"matches":{"items":{"$ref":"#/components/schemas/MatchedMarket"},"type":"array","title":"Matches"}},"type":"object","required":["source","event_slug","web_url","matches"],"title":"MatchResult"},"MatchedContract":{"properties":{"title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Title","examples":["Gavin Newsom"]},"platform_outcome_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Platform Outcome Id","description":"Its `contract_id`.","examples":["KXPRESNOMD-28-GN"]}},"type":"object","title":"MatchedContract"},"MatchedMarket":{"properties":{"venue":{"type":"string","enum":["kalshi","polymarket"],"title":"Venue"},"market_id":{"type":"string","title":"Market Id"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"},"event_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Slug"},"match_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match State","description":"Canonical link state (e.g. `AUTO_CANONICAL`, `MANUAL_CANONICAL`); `SAME_EVENT` when both sit under one TPM event; `COMPARABLE` when only the titles match (check the rules)."},"match_score":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Match Score"}},"type":"object","required":["venue","market_id"],"title":"MatchedMarket"},"MonthlyWindow":{"properties":{"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"},"used":{"type":"integer","title":"Used"},"period":{"type":"string","title":"Period","examples":["202610"]}},"type":"object","required":["used","period"],"title":"MonthlyWindow"},"Outcome":{"properties":{"id":{"type":"string","title":"Id","description":"TPM outcome id (stable)."},"title":{"type":"string","title":"Title","examples":["Gavin Newsom"]},"contract_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Id","description":"The venue's tradable contract: Kalshi market ticker or Polymarket condition id.","examples":["KXPRESNOMD-28-GN"]},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status","examples":["active"]},"volume":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Volume"},"probability_change_24h":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Probability Change 24H"},"quote":{"$ref":"#/components/schemas/Quote"},"stream":{"anyOf":[{"$ref":"#/components/schemas/StreamIds"},{"type":"null"}]},"match":{"anyOf":[{"$ref":"#/components/schemas/OutcomeMatch"},{"type":"null"}]}},"type":"object","required":["id","title","quote"],"title":"Outcome"},"OutcomeMatch":{"properties":{"group_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Group Id","description":"Cross-venue outcome group; equal ids are the same outcome."},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key","examples":["candidate:gnewsom"]},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State","description":"How the link was made, e.g. AUTO_MATCHED or MANUAL."},"contract_compatibility":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contract Compatibility","description":"`verified` only when settlement rules were checked to match; otherwise `unverified`."}},"type":"object","title":"OutcomeMatch"},"OutcomeSpread":{"properties":{"outcome_key":{"type":"string","title":"Outcome Key","examples":["candidate:acor"]},"gap":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Gap","description":"Sell bid minus buy ask across venues (gross: before fees and depth).","examples":[0.024]},"buy":{"anyOf":[{"$ref":"#/components/schemas/SpreadLeg"},{"type":"null"}],"description":"Cheapest venue to buy Yes (its ask)."},"sell":{"anyOf":[{"$ref":"#/components/schemas/SpreadLeg"},{"type":"null"}],"description":"Best venue to sell Yes (its bid)."}},"type":"object","required":["outcome_key"],"title":"OutcomeSpread"},"Pagination":{"properties":{"limit":{"type":"integer","title":"Limit","examples":[50]},"has_more":{"type":"boolean","title":"Has More","examples":[true]},"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Pass as `cursor` with the same filters to get the next page.","examples":["eyJ2IjoxLCJvIjo1MH0"]}},"type":"object","required":["limit","has_more"],"title":"Pagination"},"PriceRow":{"properties":{"id":{"type":"string","title":"Id","description":"The id you asked for, `venue:contract_id`.","examples":["kalshi:KXPRESNOMD-28-GN"]},"venue":{"type":"string","enum":["kalshi","polymarket"],"title":"Venue"},"contract_id":{"type":"string","title":"Contract Id"},"title":{"type":"string","title":"Title"},"market_id":{"type":"string","title":"Market Id"},"event_slug":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Slug"},"quote":{"$ref":"#/components/schemas/Quote"},"stream":{"anyOf":[{"$ref":"#/components/schemas/StreamIds"},{"type":"null"}]}},"type":"object","required":["id","venue","contract_id","title","market_id","quote"],"title":"PriceRow"},"PricesResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/PriceRow"},"type":"array","title":"Data"},"unresolved":{"items":{"type":"string"},"type":"array","title":"Unresolved","description":"Requested ids TPM does not track."}},"type":"object","required":["data"],"title":"PricesResponse"},"Quote":{"properties":{"probability":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Probability","description":"Displayed price as a probability 0-1 (the venue's own display rule).","examples":[0.16]},"best_bid":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Best Bid","examples":[0.15]},"best_ask":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Best Ask","examples":[0.16]},"spread":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Spread","description":"best_ask - best_bid.","examples":[0.01]},"source":{"type":"string","enum":["live","snapshot"],"title":"Source","description":"`live`: venue WebSocket feed. `snapshot`: venue REST poll."},"observed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Observed At","description":"When this price was last known to be current (UTC)."},"age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Age Seconds","examples":[4]},"freshness":{"type":"string","enum":["live","fresh","aging","stale","unknown"],"title":"Freshness","description":"How current the price is. `live`: streaming quote under 15 s old (or a quiet book a healthy feed vouches for). `fresh`: polled under 10 min ago. `aging`: 10 min-2 h, or a degraded stream. `stale`: older; do not trade on it. `unknown`: never observed."}},"type":"object","required":["source","freshness"],"title":"Quote"},"RateLimitStatus":{"properties":{"plan":{"type":"string","title":"Plan","examples":["tier_1"]},"plan_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan Label"},"requests_per_second":{"$ref":"#/components/schemas/RateLimitWindow"},"monthly":{"$ref":"#/components/schemas/MonthlyWindow"}},"type":"object","required":["plan","requests_per_second","monthly"],"title":"RateLimitStatus"},"RateLimitWindow":{"properties":{"limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Limit"},"used":{"type":"integer","title":"Used"}},"type":"object","required":["used"],"title":"RateLimitWindow"},"Resolution":{"properties":{"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"resolved_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resolved At"}},"type":"object","title":"Resolution"},"Spread":{"properties":{"event_slug":{"type":"string","title":"Event Slug"},"event_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Title"},"outcome_key":{"type":"string","title":"Outcome Key"},"outcome_title":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome Title"},"gap":{"type":"number","title":"Gap","description":"Gross price gap (probability points), before fees and depth."},"buy":{"$ref":"#/components/schemas/SpreadLeg"},"sell":{"$ref":"#/components/schemas/SpreadLeg"},"quote_basis":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quote Basis","description":"`executable_bid_ask` when both legs are live bid/ask."},"price_state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Price State","description":"`actionable`, `indicative` or `stale`."},"quote_age_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Quote Age Seconds"},"match_quality":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Match Quality"}},"type":"object","required":["event_slug","outcome_key","gap","buy","sell"],"title":"Spread"},"SpreadLeg":{"properties":{"venue":{"type":"string","enum":["kalshi","polymarket"],"title":"Venue"},"price":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Price"}},"type":"object","required":["venue"],"title":"SpreadLeg"},"StreamIds":{"properties":{"provider":{"type":"string","enum":["kalshi","polymarket"],"title":"Provider"},"market_id":{"type":"string","title":"Market Id","examples":["KXPRESNOMD-28-GN"]},"outcome_id":{"type":"string","title":"Outcome Id","examples":["yes"]}},"type":"object","required":["provider","market_id","outcome_id"],"title":"StreamIds","description":"Ids to subscribe to this outcome on the `tpm.quotes.v1` WebSocket."},"VenueStatus":{"properties":{"venue":{"type":"string","enum":["kalshi","polymarket"],"title":"Venue"},"active_markets":{"type":"integer","title":"Active Markets"},"last_catalog_update":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Catalog Update"},"live_feed":{"type":"string","title":"Live Feed","description":"Venue WebSocket collector: `ok`, `degraded`, `down` or `unknown`."}},"type":"object","required":["venue","active_markets","live_feed"],"title":"VenueStatus"}},"securitySchemes":{"APIKeyHeader":{"type":"apiKey","description":"Your key from https://thepredictionmarkets.com/api-keys. The docs demo key `tpm_demo_key_authorized_2026` works for trying requests.","in":"header","name":"X-API-Key"}}},"tags":[{"name":"Status","description":"Health of the API and each venue feed. No key needed."},{"name":"Events","description":"Real-world questions grouped across Kalshi and Polymarket, with every outcome's price."},{"name":"Markets","description":"Raw venue listings (Kalshi event tickers, Polymarket events) and their outcomes."},{"name":"Matching","description":"Find the same market on the other venue from a link or a venue id."},{"name":"Prices","description":"Latest quotes for many contracts in one call."},{"name":"Spreads","description":"Cross-venue price gaps on matched outcomes (gross, before fees)."},{"name":"Account","description":"Your plan and usage."}]}