{
  "openapi": "3.0.1",
  "info": {
    "title": "Kalshi Settlement Calendar & Order Book Depth",
    "description": "Kalshi markets ranked by when they settle, with the order book depth, spread and settlement source of each one.",
    "version": "0.6",
    "x-build-id": "oZf50foiWVqiOdUty"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/datagrit~kalshi-settlement-calendar/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-datagrit-kalshi-settlement-calendar",
        "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/datagrit~kalshi-settlement-calendar/runs": {
      "post": {
        "operationId": "runs-sync-datagrit-kalshi-settlement-calendar",
        "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/datagrit~kalshi-settlement-calendar/run-sync": {
      "post": {
        "operationId": "run-sync-datagrit-kalshi-settlement-calendar",
        "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": {
          "settlesWithinHours": {
            "title": "Settles within (hours)",
            "minimum": 0,
            "maximum": 87600,
            "type": "number",
            "description": "Keep markets whose expected settlement time is at most this many hours from now. 24 means everything that settles today and tonight; 168 is one week.",
            "default": 24
          },
          "settlesAfterHours": {
            "title": "Settles after (hours)",
            "minimum": -720,
            "maximum": 87600,
            "type": "number",
            "description": "Keep markets whose expected settlement time is at least this many hours from now. 0 starts at the present moment; a negative value also returns markets whose expected time has passed but which are not settled yet (for example -6).",
            "default": 0
          },
          "categories": {
            "title": "Categories",
            "type": "array",
            "description": "Optional. Only markets of series that Kalshi lists under these categories (a series can be listed under several, so a row can show another category than the one you asked for; see the categories field), for example Sports, Crypto, Financials, Politics, Economics, Transportation, Climate and Weather, Entertainment. Case-insensitive; leave empty for all categories.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "seriesTickers": {
            "title": "Series tickers",
            "type": "array",
            "description": "Optional. Only these Kalshi series, for example KXBTCD or KXNASDAQ100U. Scanning named series is much faster than scanning the whole exchange.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "keywords": {
            "title": "Title keywords",
            "type": "array",
            "description": "Optional. Keep markets whose market title contains at least one of these words or phrases (case-insensitive). Only the market title is searched, not the outcome or series name.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "minVolume24h": {
            "title": "Minimum 24h volume",
            "minimum": 0,
            "type": "integer",
            "description": "Keep markets with at least this many contracts traded in the last 24 hours. 0 turns the filter off.",
            "default": 0
          },
          "minOpenInterest": {
            "title": "Minimum open interest",
            "minimum": 0,
            "type": "integer",
            "description": "Keep markets with at least this many contracts outstanding. 0 turns the filter off.",
            "default": 0
          },
          "requireTwoSidedQuote": {
            "title": "Only two-sided quotes",
            "type": "boolean",
            "description": "Keep only markets with a YES bid of at least 1 cent and a YES ask of at most 99 cents, so that you can actually trade both ways. Turn off to also list markets that nobody quotes.",
            "default": true
          },
          "maxSpreadCents": {
            "title": "Maximum spread (cents)",
            "minimum": 0,
            "maximum": 100,
            "type": "number",
            "description": "Keep markets whose YES ask minus YES bid is at most this many cents. 100 turns the filter off; any lower value also drops markets that are not quoted on both sides.",
            "default": 100
          },
          "sortBy": {
            "title": "Sort by",
            "enum": [
              "settlement",
              "volume24h",
              "openInterest",
              "spread"
            ],
            "type": "string",
            "description": "Order of the results before \"Maximum results\" is applied: soonest settlement, highest 24h volume, highest open interest or tightest spread.",
            "default": "settlement"
          },
          "includeOrderbook": {
            "title": "Include order book depth",
            "type": "boolean",
            "description": "Read the order book of every returned market and add the depth fields (contracts near the best bid and ask, levels, totals). Turn off for a faster run without depth.",
            "default": true
          },
          "depthCents": {
            "title": "Depth window (cents)",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Width of the window used by the depth fields: contracts resting within this many cents of the best bid, and within this many cents of the best ask.",
            "default": 5
          },
          "includeRules": {
            "title": "Include rules text",
            "type": "boolean",
            "description": "Add the primary and secondary settlement rules text of every market. Makes the rows larger.",
            "default": false
          },
          "maxItems": {
            "title": "Maximum results",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Stop after this many markets.",
            "default": 20
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional proxy. Leave disabled: the Kalshi public API does not need one.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}