{
  "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": "V4r1WuexVCgKmHlNw"
  },
  "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",
              "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.",
            "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."
          },
          "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
          },
          "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.",
            "default": 200
          },
          "includeClosed": {
            "title": "Include closed and resolved markets",
            "type": "boolean",
            "description": "Off by default: only markets you can still trade.",
            "default": false
          },
          "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"
            }
          },
          "historyDays": {
            "title": "History window, days",
            "minimum": 1,
            "maximum": 90,
            "type": "integer",
            "description": "How far back the price history goes.",
            "default": 7
          },
          "seriesTicker": {
            "title": "Kalshi series ticker",
            "type": "string",
            "description": "Narrow Kalshi to one series, for example <code>KXPRESPARTY</code>."
          },
          "orderbookDepth": {
            "title": "Order book depth",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Price levels per side in the order-book mode.",
            "default": 10
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}