{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi & Polymarket Order Book, 24h Change & Price History",
    "description": "Name a Kalshi or Polymarket market and get its price, 24h change, rules, order book, price history and trades, in one shape across both venues.",
    "version": "0.0",
    "x-build-id": "cFGykwiaSq3K3ImgY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapebench~kalshi-polymarket-orderbook-history-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapebench-kalshi-polymarket-orderbook-history-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/scrapebench~kalshi-polymarket-orderbook-history-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapebench-kalshi-polymarket-orderbook-history-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/scrapebench~kalshi-polymarket-orderbook-history-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapebench-kalshi-polymarket-orderbook-history-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": {
          "queries": {
            "title": "Keywords",
            "type": "array",
            "description": "Find markets by words: 'fed rate', 'bitcoin', 'hurricane', 'temperature'. Kalshi is matched on its series titles, Polymarket through its own search. Use tickers for an exact market.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "query": {
            "title": "Keyword",
            "type": "string",
            "description": "One keyword. Kept alongside 'Keywords' for saved tasks and API callers."
          },
          "tickers": {
            "title": "Kalshi tickers",
            "type": "array",
            "description": "Exact Kalshi markets: a series (KXFED), an event (KXFED-26DEC) or a single market (KXFED-26DEC-T2.75).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "polymarketSlugs": {
            "title": "Polymarket slugs or links",
            "type": "array",
            "description": "Exact Polymarket markets or events: a slug ('will-bitcoin-reach-100k-in-november-2026') or the polymarket.com link.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "venue": {
            "title": "Venue",
            "enum": [
              "both",
              "kalshi",
              "polymarket"
            ],
            "type": "string",
            "description": "Where keywords are searched: Kalshi, Polymarket or both. Tickers and slugs always go to their own venue.",
            "default": "both"
          },
          "includeOrderbook": {
            "title": "Include the order book",
            "type": "boolean",
            "description": "One row per market with every resting bid and ask of the YES contract, best first, in the same shape on both venues. Billed per row.",
            "default": false
          },
          "includeHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "One row per point: price, and on Kalshi open/high/low, volume, open interest and bid/ask. Billed per point.",
            "default": false
          },
          "historyDays": {
            "title": "History: days back",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "How far back the price history reaches.",
            "default": 7
          },
          "historyInterval": {
            "title": "History: point size",
            "enum": [
              "hourly",
              "daily"
            ],
            "type": "string",
            "description": "One point per hour or per day.",
            "default": "hourly"
          },
          "maxHistoryPoints": {
            "title": "History: points per market",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Cap per market; the most recent points are kept.",
            "default": 500
          },
          "includeTrades": {
            "title": "Include recent trades",
            "type": "boolean",
            "description": "One row per trade: time, price, size and side. Billed per trade.",
            "default": false
          },
          "maxTrades": {
            "title": "Trades per market",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cap per market, newest first.",
            "default": 100
          },
          "includeClosed": {
            "title": "Include closed markets",
            "type": "boolean",
            "description": "Also read settled markets, with their result. Off = open markets only.",
            "default": false
          },
          "maxMarkets": {
            "title": "Maximum markets",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Cap on markets for the whole run: your spend control. The busiest markets (by volume) are kept. Order book, history and trade rows follow the markets returned.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional and off by default: Kalshi and Polymarket are public, keyless APIs.",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}