{
  "openapi": "3.0.1",
  "info": {
    "title": "Unusual Options Activity Scanner",
    "description": "Scans US options markets (stocks, ETFs, indices) for unusual activity (extreme Vol/OI smart-money signal) or most-active contracts. Returns strike, expiration, volume, open interest, Vol/OI, bid/ask, IV, delta, underlying price, optional Greeks. Built for AI trading agents and options flow analysis.",
    "version": "0.1",
    "x-build-id": "kb3viK2Noc4R1rfA4"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/michael_b~stock-unusual-options-activity/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-michael_b-stock-unusual-options-activity",
        "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/michael_b~stock-unusual-options-activity/runs": {
      "post": {
        "operationId": "runs-sync-michael_b-stock-unusual-options-activity",
        "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/michael_b~stock-unusual-options-activity/run-sync": {
      "post": {
        "operationId": "run-sync-michael_b-stock-unusual-options-activity",
        "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": "Scan Mode",
            "enum": [
              "unusual_activity",
              "most_active",
              "ticker_flow_summary"
            ],
            "type": "string",
            "description": "unusual_activity returns contracts with high Vol/OI ratio (smart-money signal). most_active returns contracts with the highest absolute volume regardless of OI. ticker_flow_summary aggregates unusual activity into one row per underlying ticker (call/put premium totals, put/call ratio, net delta exposure) — the context-efficient choice for AI agents asking 'which tickers have notable flow'.",
            "default": "unusual_activity"
          },
          "tickers": {
            "title": "Filter by Underlying Tickers (optional)",
            "type": "string",
            "description": "Comma-separated list of underlying tickers to filter by (e.g. 'AAPL,NVDA,SPY'). Leave blank to scan the whole market."
          },
          "optionType": {
            "title": "Option Type",
            "enum": [
              "both",
              "call",
              "put"
            ],
            "type": "string",
            "description": "Filter by call, put, or return both.",
            "default": "both"
          },
          "minVolume": {
            "title": "Minimum Volume",
            "minimum": 0,
            "type": "integer",
            "description": "Contracts below this day-volume are excluded. Barchart's own unusual-activity default is 500.",
            "default": 500
          },
          "minVolumeOIRatio": {
            "title": "Minimum Vol/OI Ratio",
            "minimum": 0,
            "type": "number",
            "description": "Contracts with today-volume / prior-day-OI below this ratio are excluded. Barchart's unusual-activity default is 1.25. Ignored when mode is most_active.",
            "default": 1.25
          },
          "minPremium": {
            "title": "Minimum Premium (USD)",
            "minimum": 0,
            "type": "number",
            "description": "Exclude contracts whose estimated traded premium (volume x midpoint x 100) is below this dollar amount. Useful to focus on institutional-scale flow, e.g. 250000. Contracts without a computable premium (missing midpoint) are also excluded when this is set. 0 disables the filter.",
            "default": 0
          },
          "excludeIndexETFs": {
            "title": "Exclude Index/Sector ETFs and Indices",
            "type": "boolean",
            "description": "When enabled, drops index options ($SPX, $VIX, ...) and broad index/sector/bond/commodity/volatility ETFs (SPY, QQQ, XLF, TLT, GLD, VXX, ...) whose flow is dominated by hedging. Single-stock ETFs are kept. Off by default so whole-market scans include SPY and QQQ as expected.",
            "default": false
          },
          "daysToExpirationMin": {
            "title": "Min Days to Expiration",
            "minimum": 0,
            "type": "integer",
            "description": "Exclude contracts expiring within fewer than this many calendar days. Set to 1 to skip same-day (0DTE) expirations.",
            "default": 0
          },
          "daysToExpirationMax": {
            "title": "Max Days to Expiration",
            "minimum": 1,
            "type": "integer",
            "description": "Exclude contracts expiring more than this many calendar days out. Default 365 includes LEAPS up to one year.",
            "default": 365
          },
          "sortBy": {
            "title": "Sort By",
            "enum": [
              "volumeOIRatio",
              "volume",
              "volatility",
              "daysToExpiration",
              "expirationDate"
            ],
            "type": "string",
            "description": "Which metric to rank results by before applying the row limit.",
            "default": "volumeOIRatio"
          },
          "sortDirection": {
            "title": "Sort Direction",
            "enum": [
              "desc",
              "asc"
            ],
            "type": "string",
            "description": "Direction to apply to the Sort By metric. Descending puts the most unusual or most active rows first.",
            "default": "desc"
          },
          "limit": {
            "title": "Max Rows",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Maximum number of rows to return. Barchart caps at 1000 per request. In ticker_flow_summary mode this limits the number of tickers (the underlying contract fetch always uses the full 1000).",
            "default": 100
          },
          "includeGreeks": {
            "title": "Enrich with Full Greeks (CBOE)",
            "type": "boolean",
            "description": "When enabled, adds gamma, theta, vega, and rho to each row by fetching the CBOE option chain for every underlying in the result. Adds a few hundred KB of transfer per unique underlying.",
            "default": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}