Open Interest
FreeValueStandardPro
Fetch the open interest of every option contract for one date. The vendor keeps the most recent 7 calendar days.
from thetadatadx import Client
client = Client.from_env()
rows = client.market_data.option_flat_file_open_interest(
"",
)
for t in rows:
print(t.date, t.open_interest) Sample response ·
JSON[
{
"date": 20260803,
"expiration": 20260821,
"ms_of_day": 23401000,
"open_interest": 13122,
"right": "C",
"root": "AAPL",
"strike": "360.0"
},
{
"date": 20260803,
"expiration": 20260821,
"ms_of_day": 23419000,
"open_interest": 69,
"right": "P",
"root": "AAPL",
"strike": "360.0"
}
]Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
date | date | yes | - | Date YYYYMMDD |
timeout_ms | int | no | - | Per-request deadline in milliseconds. 0 means no deadline. |
Response
Rows of OpenInterestTick:
| Field | Type | Description |
|---|---|---|
ms_of_day | i32 | Milliseconds since midnight Eastern Time. |
open_interest | i32 | Total outstanding contracts. |
date | i32 | Trading date as a YYYYMMDD integer. |
Every row carries expiration (YYYYMMDD), strike (dollars) and right ("C" / "P"); with the row's root, which the whole result carries per row, they identify the contract.