{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi Scraper: Prediction Markets, Odds, Trades, Order Books",
    "description": "Scrape Kalshi prediction markets: yes and no bid and ask, last price, implied probability, volume, open interest, close dates, results and rules. Search, browse by category or paste tickers and links. Also events, series, trades and order books. No login or API key.",
    "version": "0.1",
    "x-build-id": "WZyXdMq6qFS7dyXzc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/themineworks~kalshi-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-themineworks-kalshi-scraper",
        "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/themineworks~kalshi-scraper/runs": {
      "post": {
        "operationId": "runs-sync-themineworks-kalshi-scraper",
        "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/themineworks~kalshi-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-themineworks-kalshi-scraper",
        "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": {
          "mode": {
            "title": "What to scrape",
            "enum": [
              "markets",
              "events",
              "series",
              "trades",
              "orderbook"
            ],
            "type": "string",
            "description": "Markets: one row per market with yes and no bid and ask, last price, implied probability, volume, open interest, dates, result and rules. Events: one row per event with all its outcomes and the leading one. Series: one row per series (the recurring question behind events). Trades: one row per trade. Order book: one row per market with its live order book and liquidity.",
            "default": "markets"
          },
          "searchText": {
            "title": "Search Kalshi",
            "type": "string",
            "description": "Words to search for, the same as the search box on kalshi.com, for example \"fed\", \"bitcoin\", \"super bowl\" or \"election\". Leave empty, along with the fields below, to browse Kalshi's markets in the order set in Sort by."
          },
          "category": {
            "title": "Category",
            "enum": [
              "",
              "Politics",
              "Elections",
              "Economics",
              "Financials",
              "Crypto",
              "Commodities",
              "Companies",
              "Climate and Weather",
              "Science and Technology",
              "Entertainment",
              "Sports",
              "Mentions",
              "Health",
              "Social",
              "World"
            ],
            "type": "string",
            "description": "Only markets in this Kalshi category. Works alone (browse a category) or with a search.",
            "default": ""
          },
          "seriesTickers": {
            "title": "Series tickers",
            "type": "array",
            "description": "Kalshi series tickers, for example KXFEDDECISION (Fed meeting), KXBTC (Bitcoin price range) or KXHIGHNY (New York high temperature). Each series returns its events and their markets, newest first.",
            "items": {
              "type": "string"
            }
          },
          "eventTickers": {
            "title": "Event tickers",
            "type": "array",
            "description": "Kalshi event tickers, for example KXFEDDECISION-26OCT. Each event returns all its markets (outcomes).",
            "items": {
              "type": "string"
            }
          },
          "marketTickers": {
            "title": "Market tickers or kalshi.com links",
            "type": "array",
            "description": "Market tickers such as KXFEDDECISION-26OCT-H0, or links copied from kalshi.com such as https://kalshi.com/markets/kxfeddecision/fed-meeting/kxfeddecision-26oct. A link to an event returns all its markets. Up to 500 lines.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Market status",
            "enum": [
              "open",
              "closed",
              "settled",
              "all"
            ],
            "type": "string",
            "description": "Open: markets still trading. Closed: trading ended, result not final yet. Settled: finished markets with their result. All: every status.",
            "default": "open"
          },
          "sortBy": {
            "title": "Sort by (search and browse)",
            "enum": [
              "trending",
              "volume",
              "totalVolume",
              "newest",
              "closingSoon",
              "relevance"
            ],
            "type": "string",
            "description": "Order of a search, a category or the browse feed: trending now, most traded recently, most traded ever, newest, closing soonest, or best text match. Ticker, event and series inputs keep Kalshi's own order.",
            "default": "trending"
          },
          "minVolume": {
            "title": "Minimum volume (contracts)",
            "minimum": 0,
            "type": "integer",
            "description": "Only markets (or events, series) that traded at least this many contracts in total. One contract pays $1. 0 keeps everything.",
            "default": 0
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "The most rows this run returns in total, 1 to 20,000. In Trades mode each trade is a row.",
            "default": 100
          },
          "maxMarketsPerEvent": {
            "title": "Max markets per event",
            "minimum": 0,
            "maximum": 1000,
            "type": "integer",
            "description": "The most markets (outcomes) taken from each event, the most traded first. A golf tournament can have 120 outcomes; 5 keeps its top 5 and moves on to the next event. 0 keeps every outcome.",
            "default": 0
          },
          "tradesPerMarket": {
            "title": "Max trades per market",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Trades mode with markets selected: the most recent trades taken from each market, newest first. 1 to 10,000.",
            "default": 100
          },
          "tradesSince": {
            "title": "Trades since",
            "type": "string",
            "description": "Trades mode: only trades on or after this day (YYYY-MM-DD)."
          },
          "orderbookDepth": {
            "title": "Order book depth",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Order book mode: price levels kept per side, best first. 0 keeps the whole book. 0 to 100.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}