{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi + Polymarket Prediction Markets Scraper & Monitor",
    "description": "Returns live prices, orderbooks, trades, settlement history and cross-venue spreads (Kalshi vs Polymarket pairs with executable edge) for Kalshi and Polymarket markets as one unified dataset: weather, politics, sports, crypto. Official public APIs, no login.",
    "version": "0.1",
    "x-build-id": "XU8eIrlVzeRx1iBvK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/brenton8907~prediction-markets-data/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-brenton8907-prediction-markets-data",
        "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/brenton8907~prediction-markets-data/runs": {
      "post": {
        "operationId": "runs-sync-brenton8907-prediction-markets-data",
        "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/brenton8907~prediction-markets-data/run-sync": {
      "post": {
        "operationId": "run-sync-brenton8907-prediction-markets-data",
        "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": "Mode",
            "enum": [
              "markets",
              "spread"
            ],
            "type": "string",
            "description": "'spread' pairs the same question on both exchanges (weather brackets, Fed, elections, sports...) and reports price-gap candidates. Executable edge fields are populated only when a common settlement authority is detected and close times are within 6 hours. Both sources are always fetched in spread mode.",
            "default": "markets"
          },
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Which exchanges to pull from.",
            "items": {
              "type": "string",
              "enum": [
                "kalshi",
                "polymarket"
              ],
              "enumTitles": [
                "Kalshi",
                "Polymarket"
              ]
            },
            "default": [
              "kalshi",
              "polymarket"
            ]
          },
          "status": {
            "title": "Market status",
            "enum": [
              "open",
              "settled",
              "all"
            ],
            "type": "string",
            "description": "Open markets (tradeable now), settled/closed markets (with results), or both.",
            "default": "open"
          },
          "searchQueries": {
            "title": "Search keywords",
            "type": "array",
            "description": "Case-insensitive keywords matched against market title, event title and series title. Leave empty to return the top markets by 24h volume.",
            "items": {
              "type": "string"
            }
          },
          "weatherPreset": {
            "title": "Weather markets preset",
            "type": "boolean",
            "description": "Kalshi 'Climate and Weather' series (daily high/low temperature brackets, rain, hurricanes) plus Polymarket weather tag. Combine with 'Cities' to narrow.",
            "default": false
          },
          "cities": {
            "title": "Cities (weather preset)",
            "type": "array",
            "description": "Filter weather series by city name in the series title, e.g. NYC, Chicago, Miami, Austin, Denver, Los Angeles.",
            "items": {
              "type": "string"
            }
          },
          "kalshiCategories": {
            "title": "Kalshi categories",
            "type": "array",
            "description": "Restrict Kalshi to these categories.",
            "items": {
              "type": "string",
              "enum": [
                "Politics",
                "Elections",
                "Economics",
                "Financials",
                "Companies",
                "Crypto",
                "Commodities",
                "Climate and Weather",
                "Science and Technology",
                "Health",
                "World",
                "Sports",
                "Entertainment",
                "Mentions",
                "Social",
                "Transportation",
                "Exotics"
              ]
            }
          },
          "kalshiSeriesTickers": {
            "title": "Kalshi series tickers",
            "type": "array",
            "description": "e.g. KXHIGHNY (NYC daily high temp), KXFEDDECISION. Fastest way to target a market family.",
            "items": {
              "type": "string"
            }
          },
          "kalshiEventTickers": {
            "title": "Kalshi event tickers",
            "type": "array",
            "description": "e.g. KXHIGHNY-26SEP02. Returns all bracket markets in the event.",
            "items": {
              "type": "string"
            }
          },
          "kalshiMarketTickers": {
            "title": "Kalshi market tickers",
            "type": "array",
            "description": "Exact market tickers, e.g. KXHIGHNY-26SEP02-T82.",
            "items": {
              "type": "string"
            }
          },
          "polymarketTags": {
            "title": "Polymarket tags",
            "type": "array",
            "description": "Tag slugs or numeric tag IDs, e.g. politics, crypto, fomc, weather, nba.",
            "items": {
              "type": "string"
            }
          },
          "polymarketEventSlugs": {
            "title": "Polymarket event slugs",
            "type": "array",
            "description": "From the URL polymarket.com/event/<slug>. Returns every market in the event.",
            "items": {
              "type": "string"
            }
          },
          "polymarketMarketSlugs": {
            "title": "Polymarket market slugs",
            "type": "array",
            "description": "Exact market slugs.",
            "items": {
              "type": "string"
            }
          },
          "minVolume24h": {
            "title": "Min 24h volume",
            "minimum": 0,
            "type": "integer",
            "description": "Drop markets below this 24h volume (contracts for Kalshi, USD for Polymarket).",
            "default": 0
          },
          "minLiquidity": {
            "title": "Min liquidity (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop markets below this resting liquidity.",
            "default": 0
          },
          "minOpenInterest": {
            "title": "Min open interest (Kalshi)",
            "minimum": 0,
            "type": "integer",
            "description": "Drop Kalshi markets with open interest below this many contracts.",
            "default": 0
          },
          "settledLookbackDays": {
            "title": "Settled lookback (days)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "For status 'settled' or 'all': how far back to fetch resolved markets.",
            "default": 7
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume_24h",
              "liquidity",
              "open_interest",
              "close_time"
            ],
            "type": "string",
            "description": "Order of rows before the \"Max markets\" cap is applied.",
            "default": "volume_24h"
          },
          "maxItems": {
            "title": "Max markets",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Cap on dataset rows. Applied after filtering and sorting.",
            "default": 500
          },
          "includeOrderbook": {
            "title": "Include orderbook",
            "type": "boolean",
            "description": "Attach top-of-book depth (bids/asks) per market. One extra API call per market. Billed as enriched record.",
            "default": false
          },
          "includeRecentTrades": {
            "title": "Include recent trades",
            "type": "boolean",
            "description": "Attach the most recent fills per market. One extra API call per market. Billed as enriched record.",
            "default": false
          },
          "tradesLimit": {
            "title": "Trades per market",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "How many recent fills to attach per market when \"Include recent trades\" is on.",
            "default": 25
          },
          "orderbookDepth": {
            "title": "Orderbook depth",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "Price levels per side to attach when \"Include orderbook\" is on.",
            "default": 10
          },
          "changesOnly": {
            "title": "Changes only (monitor mode)",
            "type": "boolean",
            "description": "Remember values between runs. Markets mode reports new/moved YES prices. Spread mode reports only settlement-compatible positive executable edges with two live legs, when the net edge is new or moves by the threshold.",
            "default": false
          },
          "minPriceMovePts": {
            "title": "Min monitored move (points)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Minimum move in probability points (0-100): YES price in markets mode, executable net edge after fees in spread mode.",
            "default": 2
          },
          "monitorStoreName": {
            "title": "Monitor store name",
            "type": "string",
            "description": "Named key-value store that holds the last-seen prices. Use different names for different watchlists.",
            "default": "prediction-markets-monitor"
          },
          "includeRaw": {
            "title": "Include raw API objects",
            "type": "boolean",
            "description": "Attach the untouched upstream market object under 'raw'.",
            "default": false
          },
          "pairs": {
            "title": "Explicit pairs (spread mode)",
            "type": "array",
            "description": "KALSHI_TICKER=polymarket-market-slug (or =0x condition id). Bypasses title matching, but not the settlement compatibility gate. Example: KXHIGHNY-26SEP08-T80=will-the-highest-temperature-in-new-york-city-be-between-80-81f-on-september-8",
            "items": {
              "type": "string"
            }
          },
          "minSpreadPts": {
            "title": "Min spread (points, spread mode)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Only report pairs whose absolute Kalshi-minus-Polymarket gap is at least this many probability points.",
            "default": 0
          },
          "minMatchScore": {
            "title": "Min match score (spread mode)",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Semantic/title score (0-100) required to auto-pair an event across venues. The high-precision default rejects most ambiguous cross-category pairs; lower it only when you will inspect contract rules manually.",
            "default": 80
          },
          "spreadPoolSize": {
            "title": "Polymarket candidate pool (spread mode)",
            "minimum": 100,
            "maximum": 10000,
            "type": "integer",
            "description": "How many top-volume Polymarket markets to consider for pairing when no Polymarket filter is set.",
            "default": 2000
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}