{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi Markets Scraper",
    "description": "Prediction markets from Kalshi's public trade API: every open event and its markets with bid/ask/last in dollars, implied probability, volume, open interest, close and expiration times, strikes and rules, by category or series. Skips the exchange's auto-minted parlay markets.",
    "version": "0.1",
    "x-build-id": "PbQntgHsdE5GrLqDH"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapyx~kalshi-markets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapyx-kalshi-markets-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/scrapyx~kalshi-markets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapyx-kalshi-markets-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/scrapyx~kalshi-markets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapyx-kalshi-markets-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": {
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Kalshi categories to keep: Politics, Elections, Economics, Financials, Crypto, Commodities, Companies, Climate and Weather, Science and Technology, Entertainment, Sports, Mentions, Social, World, Health, AI. Empty = everything (about half of Kalshi is sports match markets). Applied locally while walking the exchange - the API's own category filter is inert.",
            "items": {
              "type": "string"
            }
          },
          "seriesTickers": {
            "title": "Series tickers",
            "type": "array",
            "description": "Restrict the walk to specific series, e.g. KXBTC (Bitcoin price ranges), KXNEWPOPE, KXFED. Each is its own target. Unknown tickers return nothing.",
            "items": {
              "type": "string"
            }
          },
          "eventTickers": {
            "title": "Event tickers",
            "type": "array",
            "description": "Specific events, e.g. KXNEWPOPE-70. One request each; an unknown ticker is reported as not_found.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Status",
            "enum": [
              "open",
              "closed",
              "settled",
              "unopened"
            ],
            "type": "string",
            "description": "Which markets to list. The API rejects anything else with a 400.",
            "default": "open"
          },
          "excludeMultivariate": {
            "title": "Exclude multivariate parlays",
            "type": "boolean",
            "description": "On by default. Kalshi auto-mints tens of thousands of KXMVE... combination markets ('yes Arsenal, yes Barcelona 1st half, ...') with zero volume; /markets is 99.6% of them. The events walk this Actor uses does not surface them, but series and ticker targets can; each row carries isMultivariate.",
            "default": true
          },
          "minVolume": {
            "title": "Min volume (contracts)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with lifetime volume below this. Applied locally."
          },
          "closingAfter": {
            "title": "Closing after (date)",
            "type": "string",
            "description": "Only markets closing on or after this date, YYYY-MM-DD. Sent to the API."
          },
          "closingBefore": {
            "title": "Closing before (date)",
            "type": "string",
            "description": "Only markets closing on or before this date, YYYY-MM-DD. Applied locally (the API ignores its own max_close_ts on the events endpoint)."
          },
          "sortBy": {
            "title": "Sort the collected rows",
            "enum": [
              "none",
              "volume",
              "volume24h",
              "openInterest",
              "liquidity",
              "closeTime"
            ],
            "type": "string",
            "description": "The API has no sort; this orders the rows the run collected (within maxItems), not the whole exchange.",
            "default": "none"
          },
          "includeEventRows": {
            "title": "Also emit one EVENT row per event",
            "type": "boolean",
            "description": "Off by default: rows are MARKETs, each with its event's ticker, title, category and market count. On: an EVENT row with an outcome/price summary precedes each event's markets.",
            "default": false
          },
          "maxItems": {
            "title": "Max market rows",
            "minimum": 1,
            "maximum": 150000,
            "type": "integer",
            "description": "Overall cap on MARKET rows across every target. ~13,500 open events carry ~125,000 markets; a full walk is 68 pages of ~3.6 MB.",
            "default": 500
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 6,
            "type": "integer",
            "description": "Parallel requests across targets.",
            "default": 2
          },
          "minRequestInterval": {
            "title": "Min seconds between requests",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "Politeness delay between request starts. The API tolerated 40 unpaced requests in 11 s.",
            "default": 0
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Not needed: the API answered from a plain IP. Enable Apify's free datacenter proxy only if a cloud run reports fetch_failed.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}