{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket & Kalshi Odds Scraper ($1/1K markets)",
    "description": "Polymarket and Kalshi odds scraper for prediction markets: question, outcome, implied probability, bid, ask, last price, 24h change, volume, liquidity and end date. Takes keywords, the sources to read and a minimum volume. Use it to track prediction market odds on elections, sports or economics.",
    "version": "1.0",
    "x-build-id": "2lCSlqg6gEW2Merr4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tamnt67~prediction-markets-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tamnt67-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/tamnt67~prediction-markets-scraper/runs": {
      "post": {
        "operationId": "runs-sync-tamnt67-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/tamnt67~prediction-markets-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-tamnt67-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": {
          "sources": {
            "title": "Sources",
            "type": "array",
            "description": "Exchanges to read: polymarket, kalshi or both, one per line.",
            "default": [
              "polymarket",
              "kalshi"
            ],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Keywords",
            "type": "array",
            "description": "Keep a market when its question or event title contains any of these words, for example bitcoin or election. Leave empty for all markets.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Optional. Polymarket tags (for example crypto, politics, sports, economy) and Kalshi categories (for example Crypto, Politics, Economics, Sports). Empty keeps every category.",
            "items": {
              "type": "string"
            }
          },
          "marketIds": {
            "title": "Market IDs",
            "type": "array",
            "description": "Optional. Read only these markets: Polymarket market IDs (numbers) or slugs, and Kalshi market tickers (upper case, for example KXBTCD-26NOV2222-T59499.99). Replaces the listing scan.",
            "items": {
              "type": "string"
            }
          },
          "kalshiSeriesTickers": {
            "title": "Kalshi series tickers",
            "type": "array",
            "description": "Optional. Read only the Kalshi events of these series, for example KXBTCD or KXFED. Much faster than scanning every Kalshi market.",
            "items": {
              "type": "string"
            }
          },
          "maxMarketsPerSource": {
            "title": "Maximum markets per source",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Stop after this many markets from each exchange.",
            "default": 100
          },
          "minVolumeUsd": {
            "title": "Minimum volume",
            "minimum": 0,
            "maximum": 1000000000,
            "type": "integer",
            "description": "Skip markets with less total volume than this (USD for Polymarket, contracts for Kalshi). 0 keeps all.",
            "default": 0
          },
          "minVolume24hUsd": {
            "title": "Minimum 24h volume",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with less 24-hour volume than this. 0 keeps all.",
            "default": 0
          },
          "minLiquidityUsd": {
            "title": "Minimum liquidity",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with less liquidity than this (USD). Kalshi reports no liquidity, so any value above 0 drops Kalshi markets. 0 keeps all.",
            "default": 0
          },
          "minOpenInterest": {
            "title": "Minimum open interest",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with less open interest than this. 0 keeps all.",
            "default": 0
          },
          "includeClosed": {
            "title": "Include closed and resolved markets",
            "type": "boolean",
            "description": "After the open markets, also read closed and resolved markets, with the winning outcome in result. Off by default (open markets only).",
            "default": false
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "",
              "volume24h",
              "volume",
              "liquidity",
              "closing",
              "probability",
              "move24h"
            ],
            "type": "string",
            "description": "Optional order of the saved markets of each source. Polymarket is also scanned in this order (for 24h volume, volume, liquidity and closing date); Kalshi markets are sorted after they are collected."
          },
          "includeRules": {
            "title": "Include rules",
            "type": "boolean",
            "description": "Add the resolution rules text of each market.",
            "default": false
          },
          "includePriceHistory": {
            "title": "Include price history",
            "type": "boolean",
            "description": "Add priceHistory: one Yes price per day for the last History window days. One extra request per market.",
            "default": false
          },
          "historyDays": {
            "title": "History window, days",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "Number of days of daily prices with Include price history.",
            "default": 30
          },
          "includeOrderBook": {
            "title": "Include order book",
            "type": "boolean",
            "description": "Add orderBook: the best Yes bids and asks with their sizes. One extra request per market.",
            "default": false
          },
          "orderBookDepth": {
            "title": "Order book depth",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Number of price levels per side with Include order book.",
            "default": 5
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Proxy used for the requests. The default datacenter proxy works.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}