{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket & Kalshi Scraper - Prediction Market Odds API",
    "description": "Polymarket and Kalshi prediction market odds in one table, no API key: chance in percent, volume, close date, result, link and 24h change per market. Search both sites, compare Polymarket vs Kalshi (gap in points), browse Fed, election, sports and crypto markets, paste URLs, add price history.",
    "version": "0.1",
    "x-build-id": "HGS46CwMhNkyycJdy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/michael_b~prediction-market-odds/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-michael_b-prediction-market-odds",
        "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/michael_b~prediction-market-odds/runs": {
      "post": {
        "operationId": "runs-sync-michael_b-prediction-market-odds",
        "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/michael_b~prediction-market-odds/run-sync": {
      "post": {
        "operationId": "run-sync-michael_b-prediction-market-odds",
        "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": {
          "query": {
            "title": "Search phrase",
            "type": "string",
            "description": "Words to search for on both sites, e.g. \"fed decision\", \"bitcoin 100k\", \"super bowl\". Results are ordered by trading volume (see Sort by), not by best match, so add a word like \"october\" to narrow down. Not case-sensitive; every word must appear in the question, its group title or its answer label, in any order. Common aliases count: BTC = Bitcoin, 100k = 100,000, fed = Federal Reserve, Super Bowl = Pro Football Champion. Leave empty to browse the most-traded markets instead."
          },
          "marketIds": {
            "title": "Specific markets (URLs or ids)",
            "type": "array",
            "description": "Paste the page URL from polymarket.com or kalshi.com, one per line, to fetch exactly those markets. A page with several answers returns all of them (up to 100, most traded first). Kalshi's short codes also work (KXFED-26SEP-T3.75 for one market, the shorter KXFED-26SEP for its whole group), as do the long 0x codes from the marketId column. This replaces search: query, sites, category, status, sort, limit, the filters and 'Answers shown per question' are ignored, and settled markets come back too. Ids that can't be found come back as free lookup_failed rows. Up to 200 per run.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "venues": {
            "title": "Sites",
            "uniqueItems": true,
            "type": "array",
            "description": "Polymarket, Kalshi, or both (default). Not used when looking up specific markets.",
            "items": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi"
              ],
              "enumTitles": [
                "Polymarket",
                "Kalshi"
              ]
            },
            "default": [
              "polymarket",
              "kalshi"
            ]
          },
          "category": {
            "title": "Topic",
            "enum": [
              "all",
              "politics",
              "elections",
              "sports",
              "crypto",
              "economics",
              "finance",
              "science_tech",
              "entertainment",
              "weather",
              "world",
              "health"
            ],
            "type": "string",
            "description": "One topic list for both sites (their own category names are translated to it). 'politics' and 'elections' are separate topics; use 'all' plus a search phrase to span both.",
            "default": "all"
          },
          "status": {
            "title": "Open or settled",
            "enum": [
              "open",
              "resolved"
            ],
            "type": "string",
            "description": "Open = still trading (default). A few rows may say 'closed' in the status column: trading just ended, result not posted yet. Resolved = finished markets with their result, most recently settled first, useful for checking past predictions.",
            "default": "open"
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "volume24h",
              "volume",
              "liquidity",
              "endingSoon",
              "newest"
            ],
            "type": "string",
            "description": "Order within each site (the two sites are then interleaved by rank). 'volume24h' = most traded in the last 24 hours (default, shows what's hot right now, on a match day that is the games). 'volume' = most traded ever (the big standing questions). 'liquidity' = most money waiting to trade (Polymarket; Kalshi uses open interest instead). 'endingSoon' = closest close date first. 'newest' = most recently listed. With status = resolved, volume24h and endingSoon both mean most recently settled first; the other options still apply.",
            "default": "volume24h"
          },
          "limit": {
            "title": "Rows per site (max)",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Up to this many rows from each site, 1 to 500, after the filters are applied. 25 per site (50 rows) is a readable list. If you get exactly this many rows there were probably more; raise the number to see them. Rows from the two sites are interleaved by rank so both appear on the first screen.",
            "default": 25
          },
          "endingWithinDays": {
            "title": "Closing within N days",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "Only markets closing within this many days from now. 0 = no limit. Try 7 for \"what gets decided this week\". Ignored for resolved markets.",
            "default": 0
          },
          "matchAcrossVenues": {
            "title": "Compare Polymarket vs Kalshi",
            "type": "boolean",
            "description": "Pair up markets that ask the same question on both sites and add the other site's id, question and chance plus the gap in points to both rows. Pairs are only looked for among the rows this run returns, so use a search phrase that finds the question on both sites and raise 'Answers shown per question' for multi-answer questions. Matching is strict (numbers and direction must agree); unmatched rows are left blank. Needs both sites selected, otherwise you get a free invalid_input row and unmatched rows.",
            "default": false
          },
          "includePriceHistory": {
            "title": "Add daily price history",
            "type": "boolean",
            "description": "Add `priceHistory`: one {date, probability} point per day for the last `historyDays` days, so you see the trend, not just today's move. Blank on markets younger than a day.",
            "default": false
          },
          "historyDays": {
            "title": "Days of history (with the switch above)",
            "minimum": 1,
            "maximum": 365,
            "type": "integer",
            "description": "1 to 365 days of daily points when 'Add daily price history' is on. Longer than the market's life is clipped, not rejected.",
            "default": 30
          },
          "maxMarketsPerEvent": {
            "title": "Answers shown per question (max)",
            "minimum": 1,
            "maximum": 100,
            "type": "integer",
            "description": "A question with many answers (election winner, Fed decision, a game's side bets) becomes many rows, one per answer, all sharing the same eventTitle. Only the most-traded answers are shown, up to this many per question; eventMarketCount on each row tells you how many the question has in total. 3 keeps \"Fed decision\" readable; set 100 to see every answer (do this before comparing sites on multi-answer questions), 1 for just the top answer. Not used when looking up specific markets.",
            "default": 3
          },
          "minVolume": {
            "title": "Min lifetime volume (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip markets with less than this much traded ever. 10000 skips thin markets where the price means little.",
            "default": 0
          },
          "maxDescriptionChars": {
            "title": "Max length of the rules text",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "How many characters of the market's rules to keep in `description`. 0 drops the column (shorter rows if you only need the odds); 400 or more reads as a full sentence.",
            "default": 150
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}