{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket & Kalshi Scraper: Odds, Price History, Results",
    "description": "Polymarket and Kalshi odds in one schema: implied probability, bid/ask, 24h change, volume, liquidity, open interest, close time, category. Resolved markets with results, full Kalshi series history back to 2021, daily or hourly price history, rules. Official public APIs, no login.",
    "version": "0.1",
    "x-build-id": "D3DnebvP0bhWYFjpZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/sports-odds-lab~polymarket-kalshi-odds/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-sports-odds-lab-polymarket-kalshi-odds",
        "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/sports-odds-lab~polymarket-kalshi-odds/runs": {
      "post": {
        "operationId": "runs-sync-sports-odds-lab-polymarket-kalshi-odds",
        "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/sports-odds-lab~polymarket-kalshi-odds/run-sync": {
      "post": {
        "operationId": "run-sync-sports-odds-lab-polymarket-kalshi-odds",
        "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": "Platforms",
            "type": "array",
            "description": "Which prediction markets to read. Both use their official public data APIs — no account or login needed.",
            "items": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi"
              ],
              "enumTitles": [
                "Polymarket",
                "Kalshi"
              ]
            },
            "default": [
              "polymarket",
              "kalshi"
            ]
          },
          "status": {
            "title": "Markets",
            "enum": [
              "open",
              "resolved"
            ],
            "type": "string",
            "description": "Open markets with live prices, or resolved markets with their result (for calibration studies and backtests).",
            "default": "open"
          },
          "search": {
            "title": "Keywords",
            "type": "array",
            "description": "Only markets whose event, question or outcome contains a keyword (all words of one keyword must appear), e.g. \"fed rate\", \"bitcoin\", \"election\". Leave empty for all.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Only these categories (one common list for both platforms). Leave empty for all.",
            "items": {
              "type": "string",
              "enum": [
                "politics",
                "elections",
                "economics",
                "finance",
                "crypto",
                "sports",
                "esports",
                "weather",
                "science-tech",
                "culture",
                "world",
                "companies",
                "health"
              ],
              "enumTitles": [
                "Politics",
                "Elections",
                "Economics (Fed, inflation, jobs)",
                "Finance (stocks, commodities)",
                "Crypto",
                "Sports",
                "Esports",
                "Weather & climate",
                "Science & tech (incl. AI)",
                "Culture & entertainment",
                "World & geopolitics",
                "Companies",
                "Health"
              ]
            }
          },
          "markets": {
            "title": "Specific markets",
            "type": "array",
            "description": "Polymarket event or market URLs (https://polymarket.com/event/…), Kalshi URLs or tickers (series KXFED, event KXFED-26OCT or market ticker). When set, only these are returned and the filters above are ignored.",
            "items": {
              "type": "string"
            }
          },
          "minVolume": {
            "title": "Minimum total volume",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets that traded less than this in total (USD on Polymarket, contracts on Kalshi). The default 1 skips markets that never traded.",
            "default": 1
          },
          "minVolume24h": {
            "title": "Minimum 24h volume",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets that traded less than this in the last 24 hours (USD on Polymarket, contracts on Kalshi).",
            "default": 0
          },
          "endingWithinDays": {
            "title": "Closing within (days)",
            "minimum": 0,
            "type": "integer",
            "description": "Open markets only: keep markets that close within this many days (0 = any).",
            "default": 0
          },
          "resolvedWithinDays": {
            "title": "Resolved in the last (days)",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Resolved markets only: markets that closed in this many past days (up to 30). Kalshi settles about 80,000 markets a day, so each day adds scanning time; for the full history of one topic list its series in Specific markets (e.g. KXFED).",
            "default": 3
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume24h",
              "volume",
              "liquidity",
              "endingSoon",
              "newest"
            ],
            "type": "string",
            "description": "Which markets come first (and are kept when Max markets applies). Volumes are compared within each platform.",
            "default": "volume24h"
          },
          "maxMarkets": {
            "title": "Max markets per platform",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many markets per platform (0 = no limit — Kalshi alone lists 100,000+ open markets).",
            "default": 500
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Probability over time for every market: daily over the market's life (Kalshi: up to a year) or hourly for the last 7 days.",
            "default": false
          },
          "historyResolution": {
            "title": "History resolution",
            "enum": [
              "daily",
              "hourly"
            ],
            "type": "string",
            "description": "Daily points over the market's whole life (Kalshi: up to a year) or hourly points for the last 7 days. Used only with Include price history.",
            "default": "daily"
          },
          "includeRules": {
            "title": "Include resolution rules",
            "type": "boolean",
            "description": "The full rules text of each market (how it resolves and from which source). Long text.",
            "default": 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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}