{
  "openapi": "3.0.1",
  "info": {
    "title": "Prediction Markets Scraper – Kalshi + Polymarket Odds & Prices",
    "description": "Kalshi and Polymarket prediction markets in one normalized table: question, yes/no price, bid/ask, volume, liquidity, close time, result. Politics, sports, crypto, economics and Kalshi weather markets (KXHIGH/KXLOW daily temperature). Public APIs, no login. Pay only for records delivered.",
    "version": "0.2",
    "x-build-id": "rim6drGnFEPatLJSj"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gratified_ashram~prediction-markets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gratified_ashram-prediction-markets-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/gratified_ashram~prediction-markets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-gratified_ashram-prediction-markets-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/gratified_ashram~prediction-markets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-gratified_ashram-prediction-markets-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": {
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which exchanges to pull from. Both by default.",
            "items": {
              "type": "string",
              "enum": [
                "kalshi",
                "polymarket"
              ],
              "enumTitles": [
                "Kalshi",
                "Polymarket"
              ]
            },
            "default": [
              "kalshi",
              "polymarket"
            ]
          },
          "status": {
            "title": "Market status",
            "enum": [
              "open",
              "settled",
              "both"
            ],
            "type": "string",
            "description": "Open = currently tradeable markets with live prices. Settled = resolved markets with results (Kalshi: within the lookback window; Polymarket: most recently ended first). Both = open then settled.",
            "default": "open"
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep only markets whose question, event title or ticker contains any of these words (case-insensitive). Empty = keep everything.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Keep only markets whose category or tag contains any of these words, e.g. politics, sports, crypto, economics, weather, entertainment, science. Matches Kalshi categories and Polymarket tags.",
            "items": {
              "type": "string"
            }
          },
          "minVolume": {
            "title": "Minimum total volume (USD / contracts)",
            "type": "integer",
            "description": "Drop markets with less lifetime volume than this. Useful to skip toy markets.",
            "default": 0
          },
          "minLiquidity": {
            "title": "Minimum liquidity (USD)",
            "type": "integer",
            "description": "Drop markets with thinner books than this.",
            "default": 0
          },
          "maxItems": {
            "title": "Maximum records",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on records pushed to the dataset per run. Controls cost: 1,000 records = $1.",
            "default": 500
          },
          "includeOrderbook": {
            "title": "Attach order book",
            "type": "boolean",
            "description": "Adds the top 10 bid/ask levels per market (one extra API call per market, slower, +$1 per 1,000). Kalshi: yes and no bids. Polymarket: yes-token bids and asks.",
            "default": false
          },
          "lookbackDays": {
            "title": "Settled lookback (days, Kalshi)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "For status = settled/both: how many days back of Kalshi settlements to pull (by close time). 1–365.",
            "default": 7
          },
          "excludeMultiLeg": {
            "title": "Exclude Kalshi multi-leg (parlay) markets",
            "type": "boolean",
            "description": "Kalshi lists thousands of auto-generated parlay combinations (KXMVE…). They are excluded by default because they drown out real markets.",
            "default": true
          },
          "kalshiSeriesTickers": {
            "title": "Kalshi series tickers",
            "type": "array",
            "description": "Restrict Kalshi to specific series. Exact tickers (KXBTC, KXFED, KXNBA) or a prefix with a trailing * that expands to every matching series: KXHIGH* = all daily-high temperature cities, KXLOW* = all daily-low cities (add category \"weather\" to exclude the Lowe's earnings series KXLOW). Empty = all series.",
            "items": {
              "type": "string"
            }
          },
          "polymarketTagIds": {
            "title": "Polymarket tag IDs",
            "type": "array",
            "description": "Restrict Polymarket to tag IDs from https://gamma-api.polymarket.com/tags (e.g. 2 = politics, 100639 = crypto). Empty = all markets, sorted by 24h volume. Prefer the Categories filter above unless you need a precise tag.",
            "items": {
              "type": "string"
            }
          },
          "language": {
            "title": "Market text language (Kalshi)",
            "enum": [
              "en",
              "es",
              "pt"
            ],
            "type": "string",
            "description": "Kalshi serves market titles and rules in Spanish or Portuguese as well as English. Polymarket is English only.",
            "default": "en"
          },
          "archiveDatasetName": {
            "title": "Archive dataset name",
            "type": "string",
            "description": "Also append every record to a named dataset in your account (e.g. kalshi-weather-history). Run on a schedule and the dataset becomes a price and settlement history that outlives Kalshi's ~68-day API window. No extra charge; the dataset is yours."
          },
          "archiveOnly": {
            "title": "Archive only",
            "type": "boolean",
            "description": "With an archive dataset set: write only to the archive, not to this run's dataset. Halves storage writes on scheduled runs. Records are still charged.",
            "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}