{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi Market History Scraper API - OHLC Candlesticks",
    "description": "Price history for Kalshi markets as OHLC candles with volume and open interest, at 1-minute, hourly or daily resolution, over a window up to 365 days. History depth is the gap the leading weather Actor has an open issue about. Failures are free, no run-start fee.",
    "version": "1.0",
    "x-build-id": "3a3dD6k2sClklCld7"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vonsensey~kalshi-market-history-candlesticks-scraper-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vonsensey-kalshi-market-history-candlesticks-scraper-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/vonsensey~kalshi-market-history-candlesticks-scraper-api/runs": {
      "post": {
        "operationId": "runs-sync-vonsensey-kalshi-market-history-candlesticks-scraper-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/vonsensey~kalshi-market-history-candlesticks-scraper-api/run-sync": {
      "post": {
        "operationId": "run-sync-vonsensey-kalshi-market-history-candlesticks-scraper-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": "Venues",
            "type": "array",
            "description": "Which prediction markets to read. Leave both on to get one normalised schema across the two, which is what makes the rows directly comparable.",
            "items": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi"
              ],
              "enumTitles": [
                "Polymarket",
                "Kalshi"
              ]
            },
            "default": [
              "kalshi"
            ]
          },
          "mode": {
            "title": "What to return",
            "enum": [
              "markets",
              "arbitrage"
            ],
            "type": "string",
            "description": "Markets returns one row per market. Arbitrage returns one row per cross-venue price gap — the same question priced differently on the two venues, with the edge worked out. Arbitrage always reads both venues.",
            "default": "markets"
          },
          "search": {
            "title": "Search",
            "type": "string",
            "description": "Optional. Polymarket's own search: returns the markets of events whose title matches this text, e.g. `election`, `bitcoin`, `fed`. Ignored when event slugs are set."
          },
          "eventSlugs": {
            "title": "Polymarket event slugs",
            "type": "array",
            "description": "Optional. Return only the markets of these Polymarket events, e.g. `democratic-presidential-nominee-2028`. Take the slug from the event URL (polymarket.com/event/<slug>). Takes precedence over search.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "seriesTicker": {
            "title": "Kalshi series",
            "type": "string",
            "description": "Optional. Restrict Kalshi to one or more series — comma separated. e.g. `KXHIGHNY` for New York daily highs, or `KXHIGHNY,KXHIGHCHI,KXHIGHMIA` for several cities at once. Leave empty for everything."
          },
          "tickers": {
            "title": "Kalshi market tickers",
            "type": "array",
            "description": "Optional. Restrict to specific Kalshi markets by full ticker, e.g. `KXOAIANTH-40-ANTH`.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Market status",
            "enum": [
              "open",
              "closed",
              "settled"
            ],
            "type": "string",
            "description": "Open returns markets currently trading. Closed returns markets whose trading has ended, resolved ones included. Settled returns resolved markets only, with the winning outcome in `result` (empty when a market resolved 50-50).",
            "default": "open"
          },
          "maxItems": {
            "title": "Maximum rows",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Hard ceiling on billable rows. The default of 100 keeps a first run well under a cent.",
            "default": 50
          },
          "includeOrderBook": {
            "title": "Include the live order book",
            "type": "boolean",
            "description": "Adds every bid and ask level with size, best bid, best ask, spread and total USD depth per side. Billed as its own event, and never billed when the book could not be fetched.",
            "default": false
          },
          "includeHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Adds open, high, low and close price candles over the whole history window, for the market's first outcome (Yes on a yes/no market). On Polymarket they are built from the venue's own price history, which carries prices but no traded volume, so volume is empty. Billed as its own event, and never billed when no history could be fetched (you get a free error row instead).",
            "default": true
          },
          "historyDays": {
            "title": "History window (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How far back price history goes, up to a year. 1-minute candles cover at most the last 7 days.",
            "default": 30
          },
          "historyIntervalMinutes": {
            "title": "Candle size",
            "enum": [
              "1",
              "60",
              "1440"
            ],
            "type": "string",
            "description": "Minutes per candle.",
            "default": "1440"
          },
          "monitorChangesOnly": {
            "title": "Only bill markets that moved",
            "type": "boolean",
            "description": "For schedules. The run remembers what it saw last time and bills only markets whose watched fields have changed since; unchanged markets come back as free rows. This is what makes a 5-minute cron affordable.",
            "default": false
          },
          "watchFields": {
            "title": "Fields that count as a change",
            "type": "array",
            "description": "Which fields make a market billable again on a re-run. Price and status by default. Adding volume makes any trade at all count as a change.",
            "items": {
              "type": "string",
              "enum": [
                "price",
                "status",
                "volume",
                "liquidity",
                "openInterest"
              ],
              "enumTitles": [
                "Price",
                "Status",
                "Volume",
                "Liquidity",
                "Open interest"
              ]
            },
            "default": [
              "price",
              "status"
            ]
          },
          "minEdge": {
            "title": "Minimum edge",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Arbitrage only. Smallest price gap worth reporting, in probability points × 100 — 2 means a 0.02 gap.",
            "default": 2
          },
          "minSimilarity": {
            "title": "Match strictness",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Arbitrage only. How closely two questions must match to be treated as the same market, 0–100. Higher is stricter. Pairs whose numbers disagree are always refused, whatever this is set to.",
            "default": 50
          },
          "minLiquidity": {
            "title": "Minimum liquidity per side",
            "minimum": 0,
            "type": "integer",
            "description": "Arbitrage only. Drop pairs where either venue has less than this much liquidity. Leave empty to keep all pairs."
          },
          "maxCostUsd": {
            "title": "Stop after spending (USD)",
            "minimum": 0.01,
            "type": "number",
            "description": "A hard ceiling on what one run may spend, in USD. The run stops cleanly at the limit and says so in the free summary row. Accepts cents (0.25 is valid). Leave empty for no ceiling."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}