{
  "openapi": "3.0.1",
  "info": {
    "title": "Prediction Market Data Suite (Polymarket + Kalshi)",
    "description": "Unified, normalized prediction-market data from Polymarket and Kalshi: market listings, live prices, orderbooks, recent trades and official resolutions in one cross-platform schema. No auth required.",
    "version": "0.1",
    "x-build-id": "Ju219Pe3F7Wsn8wee"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/ichigowa~prediction-market-data-suite/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-ichigowa-prediction-market-data-suite",
        "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/ichigowa~prediction-market-data-suite/runs": {
      "post": {
        "operationId": "runs-sync-ichigowa-prediction-market-data-suite",
        "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/ichigowa~prediction-market-data-suite/run-sync": {
      "post": {
        "operationId": "run-sync-ichigowa-prediction-market-data-suite",
        "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": "Mode",
            "enum": [
              "markets",
              "orderbook",
              "trades",
              "resolutions"
            ],
            "type": "string",
            "description": "What to fetch. <b>markets</b>: normalized market listings with current prices (default). <b>orderbook</b>: bid/ask depth for specific markets (provide <code>marketIds</code>). <b>trades</b>: recent trades for specific markets (provide <code>marketIds</code>). <b>resolutions</b>: settled markets with their official outcomes.",
            "default": "markets"
          },
          "platforms": {
            "title": "Platforms",
            "type": "array",
            "description": "Which platforms to query. Used by <b>markets</b> and <b>resolutions</b> modes (orderbook/trades modes infer the platform from each market ID).",
            "items": {
              "type": "string",
              "enum": [
                "polymarket",
                "kalshi"
              ],
              "enumTitles": [
                "Polymarket",
                "Kalshi"
              ]
            },
            "default": [
              "polymarket",
              "kalshi"
            ]
          },
          "keyword": {
            "title": "Keyword filter",
            "type": "string",
            "description": "Case-insensitive substring filter applied to the market question/title, slug and ticker (markets & resolutions modes). Example: <code>bitcoin</code>."
          },
          "status": {
            "title": "Market status",
            "enum": [
              "active",
              "closed",
              "settled"
            ],
            "type": "string",
            "description": "Filter for <b>markets</b> mode. <b>active</b> = currently tradable, <b>closed</b> = trading ended (may or may not be resolved yet), <b>settled</b> = officially resolved. The <b>resolutions</b> mode always uses settled markets.",
            "default": "active"
          },
          "maxResults": {
            "title": "Max results per platform",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of markets returned per platform (markets & resolutions modes). Pagination (Gamma offset / Kalshi cursor) is handled automatically.",
            "default": 200
          },
          "marketIds": {
            "title": "Market IDs",
            "type": "array",
            "description": "For <b>orderbook</b> and <b>trades</b> modes. Mixed list, auto-detected by format: Polymarket CLOB token IDs (long numeric strings, orderbook), Polymarket condition IDs (<code>0x…</code>, trades/orderbook) or Kalshi tickers (e.g. <code>KXHIGHNY-26JUL22-T91</code>). If empty, the actor auto-discovers one liquid market per platform as a demo.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "limit": {
            "title": "Rows per market (trades mode)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of recent trades fetched per market in <b>trades</b> mode.",
            "default": 100
          },
          "kalshiExcludeMultivariate": {
            "title": "Exclude Kalshi multivariate combo markets",
            "type": "boolean",
            "description": "Kalshi's market list contains thousands of auto-generated multivariate parlay combinations (MVE) with little or no liquidity. Keep this on to return only regular markets.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}