# Option tape

Every US option print of your own list of underlyings, each with its quote, side and sweep, by cursor or on the stream.

The option tape is every US option print of the underlyings a key lists, one row a print, at any size and never aggregated: its contract, size, price and time, its exchange and condition, the bid and ask it traded against with that quote's own time, its side, and the sweep it was part of. Take it live on the [WebSocket stream](https://gloom.sh/datasets/docs/streaming), and pull it by cursor to fill a gap or go over a session after the close.

While coverage is `live`, every contract of a listed underlying comes through: every expiry and strike, new strikes and expiries included from the day they list.

The tape is an add-on: a key whose account does not hold it gets `402` `dataset_not_included`. Its reads cost no credits. To add it, write to hello@gloom.sh.

## Your underlyings

Each key keeps its own list of up to 125 underlyings: US stocks and ETFs by symbol, such as `AAPL` or `BRK.B`, and the indexes `^SPX`, `^XSP`, `^NDX`, `^RUT` and `^VIX` (`SPX` and roots such as `SPXW` read as `^SPX`). An index takes every root of its options. A `PUT` replaces the whole list:

```bash
curl -X PUT "https://api.gloom.sh/v1/options/tape/underlyings" \
  -H "Authorization: Bearer $GLOOM_DATASETS_KEY" \
  -H "Content-Type: application/json" \
  -d '{"underlyings": ["SPY", "QQQ", "^SPX", "NVDA"]}'
```

`GET /v1/options/tape/underlyings` reads it back. A name is recorded from about a minute after a key lists it, once the tape holds its chain's quotes: earlier prints are not on the tape.

## A 125-name feed, step by step

1. Put the list once. It stays with the key, across streams, restarts and days, until you put another. With one name a line in `names.txt`:

```bash
jq -Rn '{underlyings: [inputs | select(length > 0)]}' names.txt |
  curl -X PUT "https://api.gloom.sh/v1/options/tape/underlyings" \
    -H "Authorization: Bearer $GLOOM_DATASETS_KEY" \
    -H "Content-Type: application/json" \
    -d @-
```

The answer is the list as the tape reads it (`BRK-B` as `BRK.B`, `SPX` as `^SPX`). A name it cannot read fails the whole `PUT` and changes nothing.

2. [Connect to the stream](https://gloom.sh/datasets/docs/streaming#connect) and subscribe to the tape, without names: the key's list is the subscription.

```json
{"type": "subscribe", "tape": "options"}
```

`subscribed` names all 125, with the cursor the prints start after and the tape's `status`.

3. Keep the `cursor` of every `option_prints` frame. After a drop, connect again and subscribe from it: you get everything since, once.

```json
{"type": "subscribe", "tape": "options", "cursor": "48120941"}
```

4. To change names, put the whole new list. An open stream gets `option_tape_underlyings` within 15 seconds and switches without a new subscribe.

A print's `id` is the same on the stream and on the route, and a cursor from either works in both. To fill a gap by pull while the stream runs, page from the stream's last cursor and drop any `id` you already hold.

## Read by cursor

```bash
curl "https://api.gloom.sh/v1/options/tape?cursor=48120933&limit=5" \
  -H "Authorization: Bearer $GLOOM_DATASETS_KEY"
```

```json
{
  "data": [
    {"id": "48120934", "underlying": "SPY", "contract": "SPY261204C00685000", "size": 50, "price": 1.42, "time": 1796394662117, "exchange": "C", "condition": "S", "bid": 1.4, "ask": 1.42, "quoteTime": 1796394662086, "side": "ask", "sweepId": "k3f9q2-1x7"},
    {"id": "48120935", "underlying": "SPY", "contract": "SPY261204C00685000", "size": 35, "price": 1.42, "time": 1796394662155, "exchange": "X", "condition": "S", "bid": 1.4, "ask": 1.42, "quoteTime": 1796394662086, "side": "ask", "sweepId": "k3f9q2-1x7"},
    {"id": "48120936", "underlying": "QQQ", "contract": "QQQ261204P00610000", "size": 12, "price": 0.87, "time": 1796394662169, "exchange": "Q", "condition": "I", "bid": 0.85, "ask": 0.89, "quoteTime": 1796394661907, "side": "mid", "sweepId": null},
    {"id": "48120937", "underlying": "^SPX", "contract": "SPXW261204C06850000", "size": 5, "price": 9.6, "time": 1796394662214, "exchange": "C", "condition": "I", "bid": 9.6, "ask": 9.9, "quoteTime": 1796394662129, "side": "bid", "sweepId": null},
    {"id": "48120938", "underlying": "NVDA", "contract": "NVDA261211C00190000", "size": 200, "price": 3.15, "time": 1796394662257, "exchange": "X", "condition": "f", "bid": null, "ask": null, "quoteTime": null, "side": "unknown", "sweepId": null}
  ],
  "meta": {
    "dataset": "options-tape",
    "requestId": "9f1c2e4a-7b3d-4c1e-a2f0-5d8e6b7c9a10",
    "asOf": null,
    "dataThrough": null,
    "historyStart": null,
    "updatedAt": null,
    "page": {"limit": 5, "hasMore": true, "nextCursor": "48120938", "total": null, "retryAfter": null},
    "next": "/v1/options/tape?cursor=48120938&limit=5",
    "coverage": {"status": "live", "underlyings": ["SPY", "QQQ", "^SPX", "NVDA"]},
    "source": [],
    "notices": [],
    "symbols": null
  }
}
```

The first two prints are one sweep: the same contract on two exchanges 38 ms apart. Prints come oldest first, of your list's underlyings only. Send each page's `nextCursor` as the next `cursor`: no print is skipped or sent twice, and a cursor stays valid across restarts. With `hasMore: false` you are caught up: ask again with the same cursor in a second or so. A print is on the tape about half a second after it trades.

- `cursor`: resume after this print. Without one, `since` starts from the first print recorded at or after a time (milliseconds, or ISO 8601 such as `2026-12-04T14:30:00Z`); with neither, from midnight New York. The tape keeps the current session and the one before it whole, and the last seven days.
- `limit`: prints a page, 1 to 5,000, 1,000 by default. A page can hold fewer, even none, with `hasMore: true` when your names are a small part of the tape: keep following `nextCursor`.
- `underlyings`: a comma list narrowing the page to some names of your list.

A key makes up to 600 pulls a minute here, apart from its plan's per-minute limit; past that it gets `429` with `retryAfter`. A busy session over 125 names is about 8 million prints: 1,600 pages of 5,000, about three minutes at that pace.

## Fields

**All routes (11)**

| Field |  |
| --- | --- |
| `id` | The print's place on the tape, a string: the cursor after it, on the stream and the route alike. |
| `underlying` | The name it is listed under: `^SPX` for an SPXW contract. |
| `contract` | The OCC symbol, as `/v1/options/chains` names it. |
| `size`, `price` | Contracts and price per share. |
| `time` | When it printed, milliseconds since the epoch. |
| `exchange` | The exchange's one-letter code, below. |
| `condition` | The print's condition code, below; `null` without one. |
| `bid`, `ask` | The quote in force when it printed: the contract's live quote where the tape held one, else the last quote known before the print. |
| `quoteTime` | That quote's own time, in milliseconds: how far before the print it was. `null` with no quote. |
| `side` | `ask` at or above the ask, `bid` at or below the bid, `mid` between them, `unknown` without the quote to say. |
| `sweepId` | Shared by the prints of one contract within 200 ms of the first of them, when they are on more than one exchange; `null` for any other print. |

Every print carries the last quote of its contract the tape held before it. With none, `bid`, `ask` and `quoteTime` are `null` and `side` is `unknown`: a contract not quoted yet that session, or, for a minute after the tape restarts, one that had not printed in the quarter hour before.

The side and sweep rules are the ones the options flow uses.

### Condition codes

Codes are case-sensitive: `S` and `s` differ.

**All routes (22)**

| Code | The print is |
| --- | --- |
| `I` | Executed electronically |
| `S` | An intermarket sweep order |
| `J` | A reopening after a halt |
| `a`, `b` | A single-leg auction, not an ISO (`a`) or an ISO (`b`) |
| `c`, `d` | A single-leg cross, not an ISO (`c`) or an ISO (`d`) |
| `e` | A single-leg floor trade |
| `f` | A multi-leg electronic trade: a spread, straddle or other order of several legs |
| `g`, `h`, `i` | A multi-leg auction (`g`), cross (`h`) or floor trade (`i`) |
| `j`, `l`, `m` | A multi-leg electronic trade (`j`), auction (`l`) or floor trade (`m`) against single legs |
| `k`, `n`, `o`, `p` | A stock-option trade, an order with a stock leg: auction (`k`), electronic (`n`), cross (`o`) or floor (`p`) |
| `q`, `r`, `s` | A stock-option electronic trade (`q`), auction (`r`) or floor trade (`s`) against single legs |
| `t` | A multi-leg floor trade of proprietary products |
| `u` | A multilateral compression trade of proprietary products |
| `v` | An extended-hours trade |
| `B` | Reported late, out of sequence |
| `D` | Reported late, in sequence |
| `F` | A late report of the opening trade, out of sequence |
| `H` | A late report of the opening trade, in sequence |
| `A` | A cancel of an earlier print |
| `C` | A cancel of the contract's last print |
| `E` | A cancel of the contract's opening print |
| `G` | A cancel of the contract's only print of the day |

A cancel (`A`, `C`, `E`, `G`) is not a trade: it carries the cancelled print's contract, size and price, to take off your totals. A multi-leg or stock-option print (`f` to `u`) is one leg of a package priced as a whole, so its side against the contract's own quote says less.

### Exchange codes

`A` NYSE American, `B` BOX, `C` Cboe, `D` MIAX Emerald, `E` Cboe EDGX, `H` Nasdaq GEMX, `I` Nasdaq ISE, `J` Nasdaq MRX, `M` MIAX, `N` NYSE Arca, `P` MIAX Pearl, `Q` Nasdaq, `S` MIAX Sapphire, `T` Nasdaq BX, `U` MEMX, `W` Cboe C2, `X` Nasdaq PHLX, `Z` Cboe BZX.

## Coverage

`meta.coverage.status` is the tape's status where the page ends, from the same read as its prints, so how it stands now once `hasMore` is false: `live` records every print of your names, `partial` only those of their busiest contracts, `starting` is on its way to `live`, and `stopped` records none. Under `partial` and `stopped` a notice says so. A recorder silent for 30 seconds is marked `stopped` after its last print. If the server cannot check that, or cannot yet read the tape as far as your cursor, the status read stands with a `tape_status_unconfirmed` notice. A stretch recorded while partial misses other contracts' prints for good; the cursor still moves through it. On the stream, `option_tape_status` tells each change in its place.

## On the stream

The [stream](https://gloom.sh/datasets/docs/streaming) carries the tape to a key that holds it, alone or beside quotes and options. Subscribe from your last cursor, or from now without one:

```json
{"type": "subscribe", "tape": "options", "cursor": "48120938"}
{"type": "unsubscribe", "tape": "options"}
```

```json
{"type": "subscribed", "tape": "options", "underlyings": ["SPY", "QQQ", "^SPX", "NVDA"], "cursor": "48120938", "status": "live"}
{"type": "option_prints", "prints": [{"id": "48120939", "underlying": "SPY", "contract": "SPY261204P00680000", "size": 120, "price": 0.64, "time": 1796394662511, "exchange": "Z", "condition": "I", "bid": 0.63, "ask": 0.65, "quoteTime": 1796394662402, "side": "mid", "sweepId": null}, {"id": "48120940", "underlying": "QQQ", "contract": "QQQ261204C00612000", "size": 1, "price": 1.08, "time": 1796394662530, "exchange": "I", "condition": "I", "bid": 1.05, "ask": 1.08, "quoteTime": 1796394662498, "side": "ask", "sweepId": null}, {"id": "48120941", "underlying": "SPY", "contract": "SPY261204C00685000", "size": 50, "price": 1.42, "time": 1796394662707, "exchange": "C", "condition": "A", "bid": 1.43, "ask": 1.45, "quoteTime": 1796394662560, "side": "bid", "sweepId": null}], "cursor": "48120941"}
{"type": "option_tape_status", "status": "partial", "cursor": "48120942", "at": 1796394663020}
{"type": "option_tape_underlyings", "underlyings": ["SPY", "QQQ", "^SPX", "NVDA", "AMD"]}
```

`option_prints` carries up to 500 prints with the same fields, oldest first; keep its `cursor`, and send it on a new stream after a drop or a `restarting` message to resume with nothing missed or repeated. `since` works as on the route. `option_tape_underlyings` follows a change to the key's list.

`option_tape_status` follows each change of the tape's coverage status: `status` is the new one, `cursor` the change's own place on the tape, between the prints' ids, to keep and resume from as a print's, and `at` when it changed, in milliseconds. It comes in its place among the prints: each print sent before it was recorded under the old status, each one after it under the new, so `stopped` follows the last print recorded. `subscribed` gives the status at the cursor you start from; if the tape cannot be read that far just now, an `unavailable` error asks you to subscribe again. A stream resumed from an older cursor hears every change since, in its place. With no change, none comes. A client slower than the tape is sent nothing until it reads, then everything it missed, changes included.

A key whose account holds the tape and not real-time prices opens a stream for the tape alone: a subscribe to symbols or options there gets `dataset_not_included`, as does a tape subscribe from a key without the add-on. If the account stops holding the tape, its prints stop with a `dataset_not_included` error, and a stream on the tape alone closes with `4002`.

- [Previous Streaming](https://gloom.sh/datasets/docs/streaming)
- [Next Paging](https://gloom.sh/datasets/docs/paging)
