{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket Scraper: Election Odds & Midterms 2026 Markets",
    "description": "Election odds and implied probability from Polymarket: House, Senate and Governor midterms 2026 markets as JSON (yes/no price, bid/ask, volume, liquidity, close time). Input {\"electionMode\":true,\"maxItems\":25}. $0.003/row. Kalshi markets optional. Public API, no login or wallet. AI-operated.",
    "version": "0.1",
    "x-build-id": "fyhmYU0DyfDEFdiqe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pennydata~polymarket-markets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pennydata-polymarket-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/pennydata~polymarket-markets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-pennydata-polymarket-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/pennydata~polymarket-markets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-pennydata-polymarket-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": {
          "electionMode": {
            "title": "Election night mode",
            "type": "boolean",
            "description": "Only US 2026 midterm Senate, House and governor markets (tag midterms), sorted by 24h volume, with priceChange24h, volume24h and endDate on every row. Overrides keyword, preset and tag in markets mode.",
            "default": false
          },
          "moversOnly": {
            "title": "Movers only",
            "type": "boolean",
            "description": "Markets mode: keep only markets whose yes price moved at least the minimum points over the last 24h (up or down). Combine with electionMode or the US midterms preset for a daily movers feed. Rows without a 24h change are skipped.",
            "default": false
          },
          "sinceLastRun": {
            "title": "Compare with last run",
            "type": "boolean",
            "description": "Use with Movers only, for scheduled runs. Compares the yes price with the snapshot stored by your previous run (same keyword/preset/race) and returns only markets that moved at least the minimum points, with prev_price, delta (points) and hours_since. The first run returns all markets and stores the baseline.",
            "default": false
          },
          "minMovePts": {
            "title": "Minimum move (points)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Used with Movers only. Minimum 24h move of the yes price in percentage points, e.g. 5 = 0.05 probability.",
            "default": 5
          },
          "movers": {
            "title": "Movers mode (window change)",
            "type": "object",
            "description": "Optional. {\"windowHours\": 1|6|24, \"minAbsChange\": 0.02}. Markets mode, Polymarket: pulls the public CLOB price history for the Yes token of the most traded matching markets, adds priceFrom, priceTo, priceChange (probability delta, 0.05 = 5 points), pctChange and windowHours, drops markets below minAbsChange and sorts by absolute change, biggest mover first. Max items limits rows returned (and charged). Kalshi is not included. Leave empty for the normal behaviour."
          },
          "source": {
            "title": "Source",
            "enum": [
              "polymarket",
              "kalshi",
              "both"
            ],
            "type": "string",
            "description": "polymarket (default) = Polymarket only; kalshi = Kalshi public markets only (markets mode; keyword, election mode, US midterms preset, race filter and movers options apply, tag slug does not); both = Polymarket then Kalshi, about half of Max items from each. Every row has a source field. market-detail and price-history modes are Polymarket only.",
            "default": "polymarket"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "markets",
              "market-detail",
              "price-history"
            ],
            "type": "string",
            "description": "markets = search markets by keyword or tag (or top markets by 24h volume when both are empty); market-detail = current prices for the given market ids or slugs; price-history = price history per outcome for the given market ids or slugs.",
            "default": "markets"
          },
          "query": {
            "title": "Search keyword",
            "type": "string",
            "description": "Keyword for markets mode, e.g. bitcoin, fed rate, election. Leave empty to list top markets by 24h volume."
          },
          "preset": {
            "title": "Election preset",
            "enum": [
              "custom",
              "us-midterms",
              "all-elections"
            ],
            "type": "string",
            "description": "One-click election odds. us-midterms = union of tags midterms, governor-midterms, senate-midterms, referendums-midterms plus slugs matching midterm / election-2026 / balance-of-power, deduped by event and sorted by volume (Nov 3 2026); all-elections = tag elections (worldwide elections). custom = use the Tag slug below. A keyword, if given, still takes priority.",
            "default": "custom"
          },
          "race": {
            "title": "Race filter",
            "enum": [
              "any",
              "senate",
              "house",
              "governor",
              "balance-of-power",
              "ballot-measures"
            ],
            "type": "string",
            "description": "Keep only markets whose question or event title mentions this race: senate, house (also congress), governor, balance-of-power, ballot-measures (referendums such as California's wealth tax). any = no filter. Works with the US midterms preset or any tag/keyword in markets mode.",
            "default": "any"
          },
          "tagSlug": {
            "title": "Tag slug",
            "type": "string",
            "description": "Polymarket tag slug for markets mode, e.g. midterms, elections, politics, crypto, sports. Used when no keyword is given. Default midterms = US midterm election markets; clear it (and the keyword) to list top markets by 24h volume.",
            "default": "midterms"
          },
          "marketIds": {
            "title": "Market ids or slugs",
            "type": "array",
            "description": "Polymarket market ids (e.g. 5409680) or slugs. Used by market-detail and price-history modes.",
            "items": {
              "type": "string"
            }
          },
          "activeOnly": {
            "title": "Active markets only",
            "type": "boolean",
            "description": "Skip closed and resolved markets in markets mode.",
            "default": true
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Maximum rows to return (1-2000).",
            "default": 25
          },
          "historyInterval": {
            "title": "History window",
            "enum": [
              "1h",
              "6h",
              "1d",
              "1w",
              "1m",
              "max"
            ],
            "type": "string",
            "description": "price-history mode: how far back to read prices.",
            "default": "1w"
          },
          "historyFidelity": {
            "title": "History resolution (minutes)",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "price-history mode: minutes between price points (for example 60 = hourly).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}