{
  "openapi": "3.0.1",
  "info": {
    "title": "Polymarket vs Kalshi Arbitrage Finder (Fee-Adjusted)",
    "description": "Match the same event on Polymarket and Kalshi and get bid/ask, implied odds, price gap, fee-adjusted arbitrage, order-book max size and profit, annualized return, match confidence and resolution-rule warnings. Data only, no trading.",
    "version": "0.1",
    "x-build-id": "TWvz0eFEZT9yQeHQ1"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/donzely~prediction-market-arbitrage/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-donzely-prediction-market-arbitrage",
        "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/donzely~prediction-market-arbitrage/runs": {
      "post": {
        "operationId": "runs-sync-donzely-prediction-market-arbitrage",
        "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/donzely~prediction-market-arbitrage/run-sync": {
      "post": {
        "operationId": "run-sync-donzely-prediction-market-arbitrage",
        "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": {
          "keywords": {
            "title": "Keywords (optional)",
            "type": "array",
            "description": "Only return pairs whose title on either exchange contains one of these phrases (all words of a phrase must appear), e.g. \"fed\", \"bitcoin\", \"democratic nominee\", \"nba\". Leave empty to scan everything.",
            "items": {
              "type": "string"
            }
          },
          "categories": {
            "title": "Categories (optional)",
            "type": "array",
            "description": "Limit the scan to these categories: politics, sports, crypto, economics, tech, culture, weather, world, other. Empty = all.",
            "items": {
              "type": "string"
            }
          },
          "onlyArbitrage": {
            "title": "Only fee-adjusted arbitrage",
            "type": "boolean",
            "description": "Return only pairs where buying YES on one exchange and NO on the other costs less than $1 after fees. Real arbitrage is rare and short-lived, so this often returns 0 rows; leave off to also see the closest spreads.",
            "default": false
          },
          "minSpreadPct": {
            "title": "Minimum price gap (percentage points)",
            "type": "number",
            "description": "Minimum difference between the two implied probabilities (mid prices), in percentage points. 0 = no filter.",
            "default": 0
          },
          "minConfidence": {
            "title": "Minimum match confidence (0-1)",
            "type": "number",
            "description": "How sure the matcher must be that both markets describe the same event. 0.6 is balanced, 0.75+ is strict.",
            "default": 0.6
          },
          "minLiquidityUsd": {
            "title": "Minimum liquidity (USD)",
            "type": "integer",
            "description": "Skip markets with less liquidity than this (Polymarket liquidity; Kalshi approximate open interest or 24h volume).",
            "default": 1000
          },
          "maxDaysToResolution": {
            "title": "Max days to resolution",
            "type": "integer",
            "description": "Only markets that resolve within this many days.",
            "default": 180
          },
          "maxPairs": {
            "title": "Max pairs to return",
            "type": "integer",
            "description": "Maximum number of matched pairs in the output (sorted by fee-adjusted edge). You pay per returned pair.",
            "default": 50
          },
          "kalshiTakerFeeRate": {
            "title": "Kalshi taker fee rate",
            "type": "number",
            "description": "Kalshi fee = round up to the cent of rate x series multiplier x contracts x P x (1-P). Default 0.07 from Kalshi's fee schedule.",
            "default": 0.07
          },
          "polymarketFeeRate": {
            "title": "Polymarket taker fee rate override",
            "type": "number",
            "description": "Leave empty to use each market's own fee schedule from the Polymarket API (fee = rate x shares x p x (1-p), e.g. 0.05 sports/politics-elections, 0.01 economics/crypto, 0 geopolitics). Set 0 if you trade as maker."
          },
          "extraCostPerContract": {
            "title": "Extra cost per contract (USD)",
            "type": "number",
            "description": "Optional buffer for slippage, deposits/withdrawals or capital cost, subtracted from each $1 contract pair.",
            "default": 0
          },
          "includeRules": {
            "title": "Include resolution rules text",
            "type": "boolean",
            "description": "Add the first 600 characters of both resolution rules to each row so you can compare them.",
            "default": true
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Not needed: both exchanges have public APIs."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}