{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket vs Kalshi API: Matched Markets, Gaps & Sports",
    "description": "The same prediction market on Polymarket and Kalshi, matched and verified, with both prices, the gap and alerts when a gap opens. Elections, economics, crypto and sports: winner, spread and total lines in 100+ leagues. Instant API. $3 per 1,000 rows.",
    "version": "0.0",
    "x-build-id": "wpln8O81O3bZboER8"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/forgedata~prediction-markets-api/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-forgedata-prediction-markets-api",
        "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/forgedata~prediction-markets-api/runs": {
      "post": {
        "operationId": "runs-sync-forgedata-prediction-markets-api",
        "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/forgedata~prediction-markets-api/run-sync": {
      "post": {
        "operationId": "run-sync-forgedata-prediction-markets-api",
        "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": {
          "mode": {
            "title": "What to get",
            "enum": [
              "pairs",
              "alerts",
              "markets",
              "refresh"
            ],
            "type": "string",
            "description": "Pairs: the same market on Polymarket and Kalshi with both prices and the gap. Markets: every open market on both platforms in one format.",
            "default": "pairs"
          },
          "q": {
            "title": "Keywords",
            "type": "string",
            "description": "Keep rows that mention all of these words, e.g. senate, fed rate, bitcoin, trump. Leave empty for everything.",
            "default": ""
          },
          "category": {
            "title": "Category",
            "type": "string",
            "description": "Optional, e.g. Elections, Politics, Economics, Crypto, Financials, Science and Technology, Entertainment, Climate and Weather.",
            "default": ""
          },
          "sports": {
            "title": "Sports (pairs and alerts)",
            "enum": [
              "",
              "only",
              "exclude"
            ],
            "type": "string",
            "description": "Only sports games, no sports, or both.",
            "default": ""
          },
          "league": {
            "title": "League (sports)",
            "type": "string",
            "description": "Comma-separated Polymarket league codes, e.g. nba, nfl, nhl, cfb, epl, lal, cs2.",
            "default": ""
          },
          "type": {
            "title": "Bet type (sports)",
            "enum": [
              "",
              "moneyline",
              "spread",
              "total"
            ],
            "type": "string",
            "description": "Game winner, spread or total points.",
            "default": ""
          },
          "tier": {
            "title": "Match quality (pairs)",
            "enum": [
              "verified",
              "candidate",
              "all"
            ],
            "type": "string",
            "description": "Verified pairs passed every check: names, numbers, thresholds and deadlines agree. Candidates are close matches that failed at least one check, with the reason in notes.",
            "default": "verified"
          },
          "minGap": {
            "title": "Minimum gap in points (pairs)",
            "minimum": 0,
            "type": "integer",
            "description": "Only pairs whose Yes prices differ by at least this many cents.",
            "default": 0
          },
          "minEdge": {
            "title": "Minimum pre-fee edge in points (pairs)",
            "minimum": 0,
            "type": "integer",
            "description": "Only pairs where buying Yes on one side and No on the other would lock in at least this many cents before fees.",
            "default": 0
          },
          "hours": {
            "title": "Alert window in hours (alerts)",
            "minimum": 1,
            "maximum": 72,
            "type": "integer",
            "description": "Alerts: gaps that opened within this many hours (max 72).",
            "default": 6
          },
          "tradedToday": {
            "title": "Traded in the last 24 hours on both platforms (pairs)",
            "type": "boolean",
            "description": "Only pairs with volume in the last 24 hours and live quotes on both sides.",
            "default": false
          },
          "platform": {
            "title": "Platform (markets)",
            "enum": [
              "",
              "polymarket",
              "kalshi"
            ],
            "type": "string",
            "description": "Markets mode: which platform to list.",
            "default": ""
          },
          "minVolume": {
            "title": "Minimum total volume",
            "minimum": 0,
            "type": "integer",
            "description": "Dollars on Polymarket, contracts on Kalshi. For pairs, both sides must reach it.",
            "default": 0
          },
          "closesBefore": {
            "title": "Closes before (markets)",
            "type": "string",
            "description": "Optional date, e.g. 2026-12-31.",
            "default": ""
          },
          "sort": {
            "title": "Sort by",
            "enum": [
              "gap",
              "edge",
              "volume",
              "volume24h",
              "closes"
            ],
            "type": "string",
            "description": "How to order the results.",
            "default": "gap"
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Most rows to return.",
            "default": 100
          },
          "signupUrl": {
            "title": "Signup link for the public page (refresh only)",
            "type": "string",
            "description": "Link for the Get early access button on the public page.",
            "default": ""
          },
          "showApiUrl": {
            "title": "Show the API address on the public page (refresh only)",
            "type": "boolean",
            "description": "Shows the API address at the bottom of the public page.",
            "default": false
          },
          "includeSports": {
            "title": "Include sports markets (refresh only)",
            "type": "boolean",
            "description": "On by default.",
            "default": true
          },
          "approvePairs": {
            "title": "Approve pairs by id (refresh only)",
            "type": "array",
            "description": "Pair ids like 516706~KXALIENS-27 to mark as verified. Saved for future runs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "rejectPairs": {
            "title": "Reject pairs by id (refresh only)",
            "type": "array",
            "description": "Pair ids that are not the same market. Saved for future runs.",
            "default": [],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}