{
  "openapi": "3.0.1",
  "info": {
    "title": "Prediction Markets API — Kalshi & Polymarket Odds",
    "description": "Kalshi and Polymarket in one table: implied probability, yes and no price, best bid and ask, 24h move, volume, liquidity and close date for every market. Election odds, sports and economic event contracts, with price history and order book. No API key.",
    "version": "0.1",
    "x-build-id": "bog0pCfQMPTayeeG7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/lergassy~prediction-markets-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-lergassy-prediction-markets-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/lergassy~prediction-markets-api/runs": {
      "post": {
        "operationId": "runs-sync-lergassy-prediction-markets-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/lergassy~prediction-markets-api/run-sync": {
      "post": {
        "operationId": "run-sync-lergassy-prediction-markets-api",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "platforms": {
            "title": "🏛️ Platforms",
            "type": "array",
            "description": "Which venues to read. Keep both to get one table across the whole prediction market.",
            "items": {
              "type": "string",
              "enum": [
                "kalshi",
                "polymarket"
              ],
              "enumTitles": [
                "Kalshi (CFTC-regulated, US)",
                "Polymarket (crypto, global)"
              ]
            },
            "default": [
              "kalshi",
              "polymarket"
            ]
          },
          "mode": {
            "title": "📋 What to get",
            "enum": [
              "markets",
              "events",
              "compare",
              "search",
              "history",
              "orderbook"
            ],
            "type": "string",
            "description": "<b>Markets</b> gives one row per tradable contract. <b>Events</b> collapses them into one row per question with every outcome and its probability, which is the shape you want for “who will win” questions. <b>Compare</b> pairs the same question on Kalshi and Polymarket by its wording and close date, and returns one row with both probabilities and the gap between them.",
            "default": "markets"
          },
          "query": {
            "title": "🔍 Keyword",
            "type": "string",
            "description": "Filter to markets whose question, event or tags contain this text: <code>fed</code>, <code>election</code>, <code>bitcoin</code>, <code>super bowl</code>."
          },
          "category": {
            "title": "🏷️ Category or tag",
            "type": "string",
            "description": "Kalshi category or Polymarket tag: Politics, Economics, Crypto, Sports, Culture, Science. Several at once, comma separated — <code>Politics, Crypto</code> keeps a market matching either."
          },
          "sortBy": {
            "title": "↕️ Sort by",
            "enum": [
              "volume24h",
              "volume",
              "liquidity",
              "closing",
              "probability",
              "move24h"
            ],
            "type": "string",
            "description": "How to order the result.",
            "default": "volume24h"
          },
          "maxMarkets": {
            "title": "💯 Maximum markets",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on rows per run. The default is deliberately small so a first run costs cents; raise it once you know which markets you need.",
            "default": 25
          },
          "marketIds": {
            "title": "Market ids",
            "type": "array",
            "description": "For the history and order-book modes: Kalshi tickers such as <code>KXOAIANTH-40-OAI</code> or Polymarket numeric ids. Leave empty to use the most active markets.",
            "items": {
              "type": "string"
            }
          },
          "seriesTicker": {
            "title": "Kalshi series ticker",
            "type": "string",
            "description": "Narrow Kalshi to one series, for example <code>KXPRESPARTY</code>."
          },
          "historyDays": {
            "title": "History window, days",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "How far back the price history goes. Each day of history is many rows per market: 30 days across 50 markets is tens of thousands of rows, and every row is billed at the same flat price.",
            "default": 7
          },
          "minVolume": {
            "title": "💧 Minimum volume",
            "minimum": 0,
            "type": "integer",
            "description": "Drop thin markets. Both venues list thousands of near-empty contracts; 1000 keeps the ones people actually trade.",
            "default": 0
          },
          "minLiquidity": {
            "title": "💧 Minimum liquidity",
            "minimum": 0,
            "type": "integer",
            "description": "Drop markets with less than this much money resting in the book, in US dollars. Polymarket publishes this figure; Kalshi reports zero on almost every market, so on Kalshi use <b>Minimum open interest</b> instead.",
            "default": 0
          },
          "minOpenInterest": {
            "title": "📈 Minimum open interest",
            "minimum": 0,
            "type": "integer",
            "description": "Drop markets with fewer than this many contracts still open. This is Kalshi's measure of how much is actually at stake in a market.",
            "default": 0
          },
          "includeClosed": {
            "title": "Include closed and resolved markets",
            "type": "boolean",
            "description": "Off by default: only markets you can still trade.",
            "default": false
          },
          "orderbookDepth": {
            "title": "Order book depth",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Price levels per side in the order-book mode.",
            "default": 10
          },
          "compareMinScore": {
            "title": "🎯 Compare: how close the wording must be",
            "minimum": 0.3,
            "maximum": 1,
            "type": "number",
            "description": "Only used by compare mode. Two questions are paired when this share of the shorter one's identifying words appears in the other, and the two contracts are about the same outcome and close within three weeks of each other. Lower it to catch looser matches; raise it for near-identical wording only.",
            "default": 0.55
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}