{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi Sports Markets",
    "description": "Track live Kalshi sports markets in one run: game lines, spreads, totals and prices, with the event, league, market type, line, yes/no prices, volume and liquidity per record. Source identifiers are preserved for cross-book comparison, and every run returns a fresh full-board snapshot.",
    "version": "0.1",
    "x-build-id": "BgirFTD4fafVARzMB"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/barefoot_grade~kalshi-sports/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-barefoot_grade-kalshi-sports",
        "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/barefoot_grade~kalshi-sports/runs": {
      "post": {
        "operationId": "runs-sync-barefoot_grade-kalshi-sports",
        "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/barefoot_grade~kalshi-sports/run-sync": {
      "post": {
        "operationId": "run-sync-barefoot_grade-kalshi-sports",
        "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": "Run mode",
            "enum": [
              "markets",
              "discover"
            ],
            "type": "string",
            "description": "markets collects market records; discover lists the valid series ticker values (read-only) that the Series tickers filter accepts. Copy seriesTicker from discovery rows into seriesTickers for collection runs.",
            "default": "markets"
          },
          "seriesTickers": {
            "title": "Series tickers",
            "maxItems": 100,
            "type": "array",
            "description": "Optional Kalshi series tickers, for example KXEPLGAME or KXMLB. Each series is paged independently and rows are de-duplicated by ticker. Empty (with no eventTicker) uses the default sports scope (KXEPLGAME, KXNBAGAME) and fails clearly if none of them is available. In discover mode this scopes the listing, which verifies whether the values are valid.",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          },
          "eventTicker": {
            "title": "Event ticker",
            "type": "string",
            "description": "Optional exact Kalshi event ticker for one fixture, for example KXEPLGAME-26SEP06EVEMUN."
          },
          "statusFilter": {
            "title": "Market status filter",
            "enum": [
              "open",
              "unopened",
              "closed",
              "final",
              "settled",
              "all"
            ],
            "type": "string",
            "description": "Kalshi market status filter. open (default) matches tradable markets; all includes every status.",
            "default": "open"
          },
          "minCloseTs": {
            "title": "Earliest close time",
            "minimum": 0,
            "type": "integer",
            "description": "Optional Unix-seconds lower bound on market close time."
          },
          "maxCloseTs": {
            "title": "Latest close time",
            "minimum": 0,
            "type": "integer",
            "description": "Optional Unix-seconds upper bound on market close time."
          },
          "pageSize": {
            "title": "Markets per API page",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Kalshi page size; its documented maximum is 1000.",
            "default": 200
          },
          "maxResults": {
            "title": "Maximum market records",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Global cap after filters and series de-duplication. Unsupported multi-event combo shards are excluded before this budget, so it counts only useful fixture markets.",
            "default": 500
          },
          "includeEventContext": {
            "title": "Include event context",
            "type": "boolean",
            "description": "Enrich rows with the parent event's title and league. A failed enrichment degrades to a warning, never a failed run.",
            "default": true
          },
          "includeOrderbook": {
            "title": "Include order book",
            "type": "boolean",
            "description": "Enrich rows with top-of-book bids (one request per market, bounded by maxResults). If enrichment is unavailable, it stops, rows keep a null orderbook and the run still succeeds with a warning.",
            "default": false
          },
          "includeRaw": {
            "title": "Include raw source objects",
            "type": "boolean",
            "description": "Embed each original Kalshi market object for debugging.",
            "default": false
          },
          "requestDelaySecs": {
            "title": "Delay between requests",
            "minimum": 0,
            "maximum": 10,
            "type": "number",
            "description": "Pause between requests.",
            "default": 0.25
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}