{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi & Polymarket Scraper — Odds, Orderbooks & Arbitrage",
    "description": "Scrape real-time prediction market odds, volume, liquidity, order books, and cross-platform arbitrage spreads from Kalshi and Polymarket via official public APIs. No login, no cookies, zero proxy overhead.",
    "version": "1.0",
    "x-build-id": "jQZndBxN8a7gyelpz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/qilu~kalshi-polymarket-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-qilu-kalshi-polymarket-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/qilu~kalshi-polymarket-scraper/runs": {
      "post": {
        "operationId": "runs-sync-qilu-kalshi-polymarket-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/qilu~kalshi-polymarket-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-qilu-kalshi-polymarket-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": "Run Mode",
            "enum": [
              "markets",
              "arbitrage",
              "both"
            ],
            "type": "string",
            "description": "Choose whether to output unified live markets, cross-platform Kalshi vs Polymarket arbitrage spreads, or both.",
            "default": "markets"
          },
          "platforms": {
            "title": "Platforms",
            "uniqueItems": true,
            "type": "array",
            "description": "Select which prediction market exchanges to fetch in 'markets' mode. In 'arbitrage' or 'both' mode, both platforms are queried automatically.",
            "items": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi"
              ],
              "enumTitles": [
                "Polymarket",
                "Kalshi"
              ]
            },
            "default": [
              "polymarket",
              "kalshi"
            ]
          },
          "searchQuery": {
            "title": "Search Keyword (optional)",
            "type": "string",
            "description": "Case-insensitive keyword or phrase to match against event title, market question, category, or tags (e.g. 'Fed', 'Bitcoin', 'Trump', 'Recession'). Markets that do not match are skipped and never charged.",
            "default": ""
          },
          "category": {
            "title": "Category Filter (optional)",
            "type": "string",
            "description": "Filter markets by category or tag substring (e.g. 'Politics', 'Economy', 'Crypto', 'Tech', 'Climate', 'Sports', 'Elections'). Leave empty for all categories.",
            "default": ""
          },
          "excludeSports": {
            "title": "Exclude Sports Markets",
            "type": "boolean",
            "description": "Skip sports game lines and parlays so results focus on politics, macroeconomics, crypto, tech, and world events.",
            "default": false
          },
          "minVolume24h": {
            "title": "Minimum 24h Volume (USD / Contracts)",
            "minimum": 0,
            "type": "number",
            "description": "Only return markets with 24-hour volume at or above this threshold.",
            "default": 0
          },
          "minTotalVolume": {
            "title": "Minimum Total Volume",
            "minimum": 0,
            "type": "number",
            "description": "Skip illiquid or untraded markets whose cumulative volume is below this value. Set to 0 to include all open markets.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort Markets By",
            "enum": [
              "volume24h",
              "totalVolume",
              "liquidity",
              "closeTime"
            ],
            "type": "string",
            "description": "Sort order applied before returning up to maxItems results.",
            "default": "volume24h"
          },
          "maxItems": {
            "title": "Max Items to Return",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Maximum number of market records (or arbitrage matches in arbitrage mode) to output. Free Apify accounts are capped at 20 preview items.",
            "default": 50
          },
          "maxScanEventsPerPlatform": {
            "title": "Max Events Scanned Per Platform",
            "minimum": 20,
            "maximum": 2000,
            "type": "integer",
            "description": "How many open events to scan from each exchange before filtering and sorting. Increase this when searching for niche topics or running deep arbitrage scans.",
            "default": 200
          },
          "includeOrderbook": {
            "title": "Include Live Order Book Depth (Add-on)",
            "type": "boolean",
            "description": "Fetch live top-of-book bids and asks for each returned market via Polymarket CLOB and Kalshi Orderbook APIs.",
            "default": false
          },
          "orderbookDepth": {
            "title": "Order Book Depth Levels",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Number of bid and ask price levels to keep per market when Include Live Order Book Depth is enabled.",
            "default": 5
          },
          "minArbSpreadPct": {
            "title": "Min Spread % (Arbitrage Mode)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Minimum absolute YES probability gap (in percentage points) required to emit a cross-platform match in arbitrage/both mode.",
            "default": 2
          },
          "minMatchScore": {
            "title": "Min Title Match Score (Arbitrage Mode)",
            "minimum": 0.2,
            "maximum": 0.95,
            "type": "number",
            "description": "Similarity threshold (0.20 to 0.95) for pairing Kalshi and Polymarket questions. Higher values give stricter matches.",
            "default": 0.55
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}