# Option trades `GET` `https://api.unusualwhales.com/api/socket/option_trades` **NOTE:** This is the documentation for websocket channels `option_trades` and `option_trades:`. Websocket access for personal use is only available through the [Advanced plan](https://unusualwhales.com/pricing?product=api). You can find fully-functional examples that stream data from many channels here: - Python: [https://github.com/unusual-whales/api-examples/tree/main/examples/ws-multi-channel-multi-output](https://github.com/unusual-whales/api-examples/tree/main/examples/ws-multi-channel-multi-output) - Javascript: [https://github.com/unusual-whales/api-examples/tree/main/examples/ws-multi-channel-multi-output-nodejs](https://github.com/unusual-whales/api-examples/tree/main/examples/ws-multi-channel-multi-output-nodejs) Connect to the websocket URI: `wss://api.unusualwhales.com/socket?token=` then `join` the channel(s) you wish to stream, for example `option_trades` for all tickers or `option_trades:TSLA` for TSLA transactions only. Payload format: ``` { "id":"a4dc6020-0611-4c23-b0bc-99944c7348ab", "underlying_symbol":"UVIX", "executed_at":1726670167412, "nbbo_bid":"0.01", "nbbo_ask":"0.09", "size":1, "price":"0.01", "option_symbol":"UVIX240920C00025000", "created_at":1726670167461, "report_flags":[ ], "tags":[ "bid_side", "bearish", "etf" ], "expiry":"2024-09-20", "option_type":"call", "open_interest":410, "strike":"25.0000000000", "premium":"1.00", "volume":105, "underlying_price":"4.9261", "ewma_nbbo_ask":"0.09", "ewma_nbbo_bid":"0.01", "implied_volatility":"8.46381958089369", "delta":"0.01132315610146539", "theta":"-0.02291485773244166", "gamma":"0.00962272181839715", "vega":"0.0001082948756510385", "rho":"0.000002508438316242667", "theo":"0.01", "trade_code":"slan", "exchange":"XCBO", "ask_vol":10, "bid_vol":95, "no_side_vol":0, "mid_vol":0, "multi_vol":0, "stock_multi_vol":0 } ``` ### Field reference | Field | Type | Description | |---|---|---| | `id` | uuid string | Unique trade identifier. Use this to dedupe and to cross-reference `flow-alerts.trade_ids`. | | `underlying_symbol` | string | Underlying ticker (e.g. `AAPL`, `SPX`). | | `executed_at` | int (ms) | Trade execution time, unix epoch milliseconds (UTC). | | `nbbo_bid` / `nbbo_ask` | decimal string | NBBO at the time of the trade. | | `ewma_nbbo_bid` / `ewma_nbbo_ask` | decimal string | Exponentially-weighted moving average of the NBBO; smoother reference price for noisy quotes. | | `size` | int | Number of contracts in this trade. | | `price` | decimal string | Per-contract price. | | `premium` | decimal string | Total dollar premium for the trade (`size * price * multiplier`). The multiplier is `100` for most contracts; `NANOS` uses `1` and `XSP` uses `10`. | | `option_symbol` | string | OSI option chain id (e.g. `UVIX240920C00025000`). | | `expiry` | date string `YYYY-MM-DD` | Contract expiration. | | `option_type` | `"call"` \| `"put"` | | | `strike` | decimal string | Strike price. | | `open_interest` | int | Open interest as of the most recent trading day's close. | | `volume` | int | Cumulative session volume on this contract up to and including this trade. | | `underlying_price` | decimal string | Spot price of the underlying at the time of the trade. Empty string when `tags` contains `"index"`. | | `implied_volatility`, `delta`, `theta`, `gamma`, `vega`, `rho`, `theo` | decimal string | Greeks and theoretical price computed from the NBBO mid at trade time. | | `trade_code` | string | Upstream condition codes (comma-separated), e.g. `"slan"`, `"auto"`, `"slan,isoi"`. | | `exchange` | string | OPRA exchange identifier (`XCBO`, `MPRL`, `XPHL`, ...). | | `report_flags` | string[] | Out-of-band reporting flags from upstream (e.g. `"cross_trade"`). Empty for normal prints. | | `tags` | string[] | Side and classification tags. Side: `"ask_side"` / `"bid_side"` / `"mid_side"` / `"no_side"`. Classification: `"bullish"` / `"bearish"`, plus `"index"`, `"etf"`, `"china"`, `"volatility"`, `"dividend"`, `"arbitrage"`. | | `ask_vol` / `bid_vol` / `mid_vol` / `no_side_vol` | int | Cumulative session volume on this contract attributed to each side (NBBO at trade time). Sums to `volume` minus `multi_vol` and `stock_multi_vol`. | | `multi_vol` | int | Cumulative session volume from multi-leg option trades. | | `stock_multi_vol` | int | Cumulative session volume from option-stock combos (delta-neutral packages, etc.). | ## Authentication ``` Authorization: Bearer YOUR_API_KEY ``` ## Example ### curl ```bash curl -X GET "https://api.unusualwhales.com/api/socket/option_trades" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Accept: application/json" ``` ### Python ```python import http.client conn = http.client.HTTPSConnection("api.unusualwhales.com") headers = {"Authorization": "Bearer YOUR_API_KEY", "Accept": "application/json"} conn.request("GET", "/api/socket/option_trades", headers=headers) response = conn.getresponse() print(response.read().decode("utf-8")) ``` ## Response Example ```json { "data": [] } ```