{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi Markets Scraper",
    "description": "Scrape Kalshi prediction markets into clean rows: question, probability, bid, ask, volume, open interest, status, close time and link. Pick by category, series or ticker, add price history, export to JSON, CSV or Excel. No API key needed.",
    "version": "0.1",
    "x-build-id": "Fh7A7mCPJ9u0TYHlc"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/mrbridge~kalshi-markets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-mrbridge-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/mrbridge~kalshi-markets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-mrbridge-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/mrbridge~kalshi-markets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-mrbridge-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. The series of each category are read, then their events. Leave empty to scan every market.",
            "items": {
              "type": "string",
              "enum": [
                "Business",
                "Climate and Weather",
                "Commodities",
                "Companies",
                "Crypto",
                "Economics",
                "Elections",
                "Entertainment",
                "Financials",
                "Mentions",
                "Politics",
                "Science and Technology",
                "Social",
                "Sports"
              ]
            },
            "default": []
          },
          "seriesTickers": {
            "title": "Series tickers",
            "maxItems": 100,
            "type": "array",
            "description": "Series to collect, for example KXHIGHNY. Uppercase letters, digits, dot, underscore and hyphen. Up to 100.",
            "items": {
              "type": "string",
              "pattern": "^[A-Z0-9][A-Z0-9._-]*$"
            },
            "default": []
          },
          "eventTickers": {
            "title": "Event tickers",
            "maxItems": 100,
            "type": "array",
            "description": "Events to collect, for example KXHIGHNY-26OCT30. Up to 100. An event is returned whatever its status.",
            "items": {
              "type": "string",
              "pattern": "^[A-Z0-9][A-Z0-9._-]*$"
            },
            "default": []
          },
          "marketTickers": {
            "title": "Market tickers",
            "maxItems": 100,
            "type": "array",
            "description": "Markets to collect, for example KXHIGHNY-26OCT30-T69. Up to 100. A market is returned whatever its status.",
            "items": {
              "type": "string",
              "pattern": "^[A-Z0-9][A-Z0-9._-]*$"
            },
            "default": []
          },
          "status": {
            "title": "Status",
            "enum": [
              "open",
              "closed",
              "settled",
              "all"
            ],
            "type": "string",
            "description": "Status filter of the event listings. It also applies to every market of a listed event. It filters listings only: a market or event named in event tickers or market tickers is returned whatever its status.",
            "default": "open"
          },
          "searchTerms": {
            "title": "Search terms",
            "type": "array",
            "description": "Keep the markets whose question or event title contains one of these terms (any case). A local filter, applied before the maximum is counted. With market tickers it only tests the question, because the event title is not known at that point.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Maximum markets",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Hard cap on the market rows returned and billed, from 1 to 10000. The run stops once that many rows are delivered.",
            "default": 100
          },
          "includeHistory": {
            "title": "Include price history ($)",
            "type": "boolean",
            "description": "Fill the history column with the price of the market over time. A row whose history is not empty is billed one extra market-history event. A row with no price points (history is an empty list) is not billed. Without this option, or when the history cannot be read, history is null.",
            "default": false
          },
          "historyInterval": {
            "title": "History interval",
            "enum": [
              "1h",
              "1d"
            ],
            "type": "string",
            "description": "Size of one price point. Hourly points need about 7 times more requests than daily points over the same period (for 1 000 open markets over 30 days: 77 candlestick requests hourly, 10 daily). Used only when price history is on.",
            "default": "1d"
          },
          "historyDays": {
            "title": "History days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How many days back the history goes, from 1 to 365. Used only when price history is on.",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}