Option Full Open Interest
NOT YET WIRED BY THETADATA SOFTWARE ENGINEERS
Streaming open interest is not live on the upstream feed yet, so this subscription does not deliver ticks. For open interest today, use the flat files (last 7 days) or the historical open-interest endpoint.
Streams the morning open-interest reports for every option contract — one subscription covering the entire OPRA universe. Each report delivers an OpenInterest event.
The snippets below assume a connected client with streaming started — see Getting Started for the connect-and-stream ladder.
use thetadatadx::streaming::SecTypeExt;
use thetadatadx::streaming::{StreamData, StreamEvent};
use thetadatadx::SecType;
client.stream().start_streaming(|event: &StreamEvent| {
if let StreamEvent::Data(StreamData::OpenInterest { contract, open_interest, .. }) = event {
println!("{} oi={open_interest}", contract.symbol);
}
})?;
let sub = SecType::Option.full_open_interest();
client.stream().subscribe(sub.clone())?;
// Remove this stream; the session stays open for other subscriptions.
client.stream().unsubscribe(sub)?;from thetadatadx import SecType
def on_event(event):
if event.kind == "open_interest":
print(event.contract.symbol, event.open_interest)
client.stream.start_streaming(on_event)
sub = SecType.OPTION.full_open_interest()
client.stream.subscribe(sub)
# Remove this stream; the session stays open for other subscriptions.
client.stream.unsubscribe(sub)import { SecType } from 'thetadatadx-ts';
await client.stream.startStreaming((event) => {
if (event.kind === 'open_interest') {
const e = event.openInterest!;
console.log(e.contract.symbol, e.openInterest);
}
});
const sub = SecType.option().fullOpenInterest();
client.stream.subscribe(sub);
// Remove this stream; the session stays open for other subscriptions.
client.stream.unsubscribe(sub);client.stream().set_callback([](const thetadatadx::StreamEvent& event) {
if (event.kind == THETADATADX_STREAM_OPEN_INTEREST) {
auto& e = event.open_interest;
std::cout << e.contract.symbol << " oi=" << e.open_interest << "\n";
}
});
auto sub = thetadatadx::SecType::option().full_open_interest();
client.stream().subscribe(sub);
// Remove this stream; the session stays open for other subscriptions.
client.stream().unsubscribe(sub);GET ws://127.0.0.1:25520/v1/eventsWebSocket streaming from the bundled server binary. Send one JSON envelope per command; set "add": false to unsubscribe.
Example
websocat ws://127.0.0.1:25520/v1/events
{"msg_type": "STREAM", "sec_type": "OPTION", "req_type": "FULL_OPEN_INTEREST", "id": 1, "add": true}OpenInterest event fields
Each update arrives as a OpenInterest event with these fields:
| Field | Type | Description |
|---|---|---|
contract | contract | Resolved contract identity (symbol, security type, and option fields). |
ms_of_day | i32 | Milliseconds since midnight Eastern Time. |
open_interest | i32 | Total outstanding contracts. |
date | i32 | Trading date as a YYYYMMDD integer. |
received_at_ns | u64 | Local receive timestamp, nanoseconds since the Unix epoch. |
The contract field carries symbol, the security type, and — for options — expiration, right, and the strike. See Handling Events for the full event catalogue and per-language field shapes.