{
  "openapi": "3.0.1",
  "info": {
    "title": "Prediction Market Scraper - Kalshi + Polymarket",
    "description": "Kalshi + Polymarket in one schema: live odds, prices, volume, open interest, full order-book depth, settled results for backtesting, and Kalshi candlestick history. Keyless public APIs, no browser. Targets the most actively traded markets by default, and never charges you for empty results.",
    "version": "0.1",
    "x-build-id": "sfDD0r6n2gmVr3HKK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/oddsmith~prediction-market-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-oddsmith-prediction-market-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/oddsmith~prediction-market-scraper/runs": {
      "post": {
        "operationId": "runs-sync-oddsmith-prediction-market-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/oddsmith~prediction-market-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-oddsmith-prediction-market-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",
        "required": [
          "mode"
        ],
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "markets",
              "orderbook",
              "settled",
              "candlesticks"
            ],
            "type": "string",
            "description": "What to pull. 'markets' lists markets; 'orderbook' captures point-in-time depth; 'settled' returns resolved markets with results; 'candlesticks' returns Kalshi OHLC history.",
            "default": "markets"
          },
          "venues": {
            "title": "Venues",
            "type": "array",
            "description": "Which prediction markets to query.",
            "items": {
              "type": "string",
              "enum": [
                "kalshi",
                "polymarket"
              ],
              "enumTitles": [
                "Kalshi",
                "Polymarket"
              ]
            },
            "default": [
              "kalshi",
              "polymarket"
            ]
          },
          "status": {
            "title": "Market status (markets mode)",
            "enum": [
              "open",
              "closed",
              "settled"
            ],
            "type": "string",
            "description": "Which markets to return in 'markets' mode: currently tradable (Open), no longer trading but not yet resolved (Closed), or resolved with a known result (Settled).",
            "default": "open"
          },
          "closeWithinDays": {
            "title": "Only markets closing within N days (Kalshi discovery)",
            "minimum": 0,
            "maximum": 365,
            "type": "integer",
            "description": "Restricts Kalshi discovery to markets closing inside this window. This is a quality filter: Kalshi's unfiltered listing is dominated by internal shard markets with no trading activity, and the close-time window removes them. Ignored when a series ticker is given. Set 0 to disable and return everything.",
            "default": 30
          },
          "seriesTicker": {
            "title": "Kalshi series ticker (optional filter)",
            "type": "string",
            "description": "Restrict Kalshi results to one series, e.g. KXBTC, KXHIGHNY, KXMLBGAME. Leave blank for all."
          },
          "tickers": {
            "title": "Explicit tickers / token ids (orderbook & candlesticks)",
            "type": "array",
            "description": "Specific Kalshi tickers or Polymarket CLOB token ids to snapshot. If empty, targets are discovered from open markets.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Upper bound on results. For 'markets'/'settled' this bounds items returned directly. For 'orderbook'/'candlesticks' with self-discovered targets, this bounds how many candidate markets are scanned, not how many snapshots/batches are delivered -- billing guards skip candidates with no book or no trades, so a thin market in the scanned slice yields fewer paid results than requested.",
            "default": 100
          },
          "orderbookDepth": {
            "title": "Order book depth (Kalshi)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "How many price levels to capture per side of the Kalshi order book. Higher values give deeper liquidity detail per snapshot.",
            "default": 10
          },
          "startTs": {
            "title": "Candlestick start (unix seconds)",
            "type": "integer",
            "description": "Start of the candlestick window, as a Unix timestamp in seconds. Defaults to 24 hours before the run."
          },
          "endTs": {
            "title": "Candlestick end (unix seconds)",
            "type": "integer",
            "description": "End of the candlestick window, as a Unix timestamp in seconds. Defaults to the run start time."
          },
          "periodInterval": {
            "title": "Candlestick period (minutes)",
            "type": "integer",
            "description": "Candle size in minutes (for example 1, 60, or 1440 for daily). Applies to candlesticks mode only.",
            "default": 60
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}