{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket & Kalshi Scraper - Prediction Market Odds API",
    "description": "Live odds from Kalshi and Polymarket in one clean format: YES probability, bid/ask, volume, liquidity, close date, rules. Search, categories (politics, weather, crypto...), links, order books, price history, odds-change alerts. $1 per 1,000 markets.",
    "version": "0.1",
    "x-build-id": "1tuT4mTBwhexhgNAq"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tidytools~polymarket-kalshi-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tidytools-polymarket-kalshi-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/tidytools~polymarket-kalshi-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tidytools-polymarket-kalshi-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/tidytools~polymarket-kalshi-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tidytools-polymarket-kalshi-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": "Venues",
            "type": "array",
            "description": "Which prediction markets to read: Kalshi (US-regulated exchange) and/or Polymarket. Both by default; with both, the results alternate between the two venues by rank.",
            "items": {
              "type": "string",
              "enum": [
                "kalshi",
                "polymarket"
              ],
              "enumTitles": [
                "Kalshi",
                "Polymarket"
              ]
            },
            "default": [
              "kalshi",
              "polymarket"
            ]
          },
          "search": {
            "title": "Search keywords (optional)",
            "type": "array",
            "description": "Markets whose event title, question or outcome contains these words (one phrase per line; every word of a phrase must appear; any phrase may match), e.g. election, fed rate, bitcoin. Empty = the most active markets.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories (optional)",
            "type": "array",
            "description": "Topic filter for both venues: politics, elections, economics, finance, crypto, weather, climate, sports, entertainment, tech, science, ai, companies, commodities, health, world, mentions. Exact Kalshi categories (e.g. \"Climate and Weather\") and Polymarket tag slugs (e.g. fed-rates) also work.",
            "items": {
              "type": "string"
            }
          },
          "marketUrls": {
            "title": "Market links, tickers or slugs (optional)",
            "type": "array",
            "description": "Specific markets: kalshi.com/markets/... links or tickers (market KXPRESPERSON-28-JVAN, event KXPRESPERSON-28 or series KXHIGHNY), polymarket.com/event/<slug> links or event slugs. When set, only these markets are returned (search and categories are ignored). Failed lines are free.",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "title": "Market status",
            "enum": [
              "open",
              "closed",
              "all"
            ],
            "type": "string",
            "description": "Open markets (default), closed / settled markets, or both. Closed Polymarket markets come from the venue's archive; on Kalshi closed means settled.",
            "default": "open"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume24h",
              "volume",
              "liquidity",
              "closingSoon"
            ],
            "type": "string",
            "description": "Order of the results within each venue. 24 h volume finds what is moving today. Kalshi volume is in contracts and Polymarket's in USD, so both venues are ranked separately and then alternated.",
            "default": "volume24h"
          },
          "closingWithinDays": {
            "title": "Closing within N days (optional)",
            "minimum": 1,
            "maximum": 3650,
            "type": "integer",
            "description": "Only markets that close in the next N days (e.g. 7 for this week's weather, game and data-release markets)."
          },
          "minVolumeUsd": {
            "title": "Minimum total volume (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip thin markets. Polymarket: USD traded. Kalshi: contracts traded (each contract pays $1, so this is the notional in dollars)."
          },
          "min24hVolumeUsd": {
            "title": "Minimum 24 h volume (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Only markets with at least this much trading in the last 24 hours (same units as above)."
          },
          "maxMarkets": {
            "title": "Maximum markets",
            "minimum": 1,
            "maximum": 20000,
            "type": "integer",
            "description": "Upper limit of markets returned (and charged) in this run.",
            "default": 100
          },
          "includeOrderBook": {
            "title": "Include order book",
            "type": "boolean",
            "description": "Add the best bids and asks with sizes (top of book) to each market. Extra 'Order book' event per market with a non-empty book.",
            "default": false
          },
          "orderBookDepth": {
            "title": "Order book depth",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Price levels per side when the order book is included.",
            "default": 5
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Add the YES probability history (one point per day or hour) to each market. Extra 'Price history' event per market with at least one point.",
            "default": false
          },
          "priceHistoryDays": {
            "title": "Price history: days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "How many past days of history to include.",
            "default": 30
          },
          "priceHistoryInterval": {
            "title": "Price history: interval",
            "enum": [
              "day",
              "hour"
            ],
            "type": "string",
            "description": "One point per day or per hour.",
            "default": "day"
          },
          "detailsMaxMarkets": {
            "title": "Order book / history for the first N markets",
            "minimum": 0,
            "maximum": 20000,
            "type": "integer",
            "description": "Order books and price histories are read for the first N results only (0 = all). Keeps big runs fast and cheap.",
            "default": 50
          },
          "onlyChanges": {
            "title": "Only changes (odds alerts)",
            "type": "boolean",
            "description": "For schedules: return only markets that are new since the previous run of this monitor or whose YES probability moved at least the threshold below. Unchanged markets are skipped and free. The first run returns everything.",
            "default": false
          },
          "matchAcrossVenues": {
            "title": "Match markets across venues",
            "type": "boolean",
            "description": "Find the closest Kalshi/Polymarket question among markets already fetched in this run. Requires close dates within 3 days and at least 0.6 text similarity. Approximate matches: check both settlement rules. Adds no requests or fees.",
            "default": false
          },
          "minProbabilityChange": {
            "title": "Alert threshold (percentage points)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "With Only changes: report a market when its YES probability moved at least this many points since it was last reported (2 = e.g. 40% to 42%).",
            "default": 2
          },
          "monitorName": {
            "title": "Monitor name (optional)",
            "type": "string",
            "description": "With Only changes: name of the stored comparison, so several schedules can watch different markets. Empty = derived from your venues, search and categories."
          },
          "csvExport": {
            "title": "CSV export",
            "type": "boolean",
            "description": "Also save the results as MARKETS.csv in the run's key-value store (Excel-friendly, UTF-8).",
            "default": true
          },
          "httpVia": {
            "title": "Network route (advanced)",
            "enum": [
              "auto",
              "direct",
              "backend"
            ],
            "type": "string",
            "description": "How Polymarket is reached: Auto (default) connects directly and, only if Polymarket is unreachable from the run's network, retries through our Cloudflare backend; Direct only; Backend only. Kalshi is always read directly.",
            "default": "auto"
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}