Appearance
Options
Option Contract Lookup
python
contracts = client.get_option_contract(
symbol="SPX",
expiry="20260126",
strike=6900,
right="C",
trading_class="SPXW"
)Returns: Dict or List[Dict] — single contract if one match, list if multiple.
python
{
'conid': 843637708,
'symbol': 'SPX',
'secType': 'OPT',
'right': 'C',
'strike': 6955.0,
'currency': 'USD',
'maturityDate': '20260126',
'multiplier': '100',
'tradingClass': 'SPXW',
'exchange': 'SMART',
'validExchanges': 'SMART,CBOE,IBUSOPT',
'desc2': "(SPXW) JAN 26 '26 6955 Call"
}WARNING
Returns contracts across multiple expiries. Filter by maturityDate for specific dates:
python
today = "20260126"
matches = [c for c in contracts if c.get("maturityDate") == today]Batch Contract Lookup
python
contracts = client.get_option_contracts(
symbol="SPX",
expiry="20260130",
strikes=[6000, 6010, 6020, 6030],
right="P",
trading_class="SPXW"
)Returns: List[Dict]
Option Chain
python
chain = client.get_options_chain("SPX")
chain = client.get_options_chain("SPX", month="202601") # Filter by monthReturns: Dict with chain data.
Strikes
python
strikes = client.get_strikes("SPX", month="202601")Returns: Dict with available strikes.
Find Option by Delta
Finds the option contract closest to a target delta using real IBKR Greeks.
python
contract = client.get_option_by_delta(
symbol="SPX",
expiry="20260130",
target_delta=-0.35, # Negative for puts, positive for calls
right="P",
trading_class="SPXW"
)Returns: Dict or None
python
{
'conid': 843975599,
'strike': 5985.0,
'delta': -0.348,
'expiry': '20260130'
}Delta Sign Convention
- Puts: Use negative delta (e.g.,
-0.35) - Calls: Use positive delta (e.g.,
0.35)
ATM Strike
python
atm = client.get_atm_strike("SPX", expiry="20260130") # Returns float or NoneOption Expirations
python
expirations = client.get_option_expirations("SPX")
# or
expirations = client.get_expirations("SPX") # AliasReturns: List[str] — dates in YYYYMMDD format.
Option Quote
python
quote = client.get_option_quote(conid)Returns: Dict of raw IBKR snapshot fields.
python
{
'conid': 843975599,
'31': 'C34.75', # last (string, may be prefixed)
'84': '34.70', # bid (string)
'86': '34.80', # ask (string)
'6509': 'DPBd', # market data availability
'_updated': 1769534179785
}WARNING
Values are strings. Use get_market_depth() for parsed float bid/ask.
Batch Quotes
python
quotes = client.get_option_quotes([conid1, conid2, conid3])Returns: List[Dict]
Option Greeks
Single Contract
python
greeks = client.get_greeks(conid)
# or
greeks = client.get_option_greeks(conid) # AliasReturns: Greeks dataclass
python
Greeks(conid=843975599, delta=0.42, gamma=0.01, theta=-0.12, vega=0.34, iv=18.2)Batch
python
greeks_list = client.get_option_greeks_batch([conid1, conid2])Returns: List[Dict] with fields: 7308 (delta), 7309 (gamma), 7310 (theta), 7311 (vega), 7633 (iv).
Open Interest
python
oi = client.get_option_oi("SPX", expiry="20260130")Returns: Dict mapping strikes to open interest values.
Volume
python
volume = client.get_option_volume("SPX", expiry="20260130")Returns: Dict mapping strikes to volume values.
Market Depth for Options
python
depth = client.get_market_depth(opt_conid, rows=1)Returns: Dict with parsed bid, ask, bid_size, ask_size as floats.
Placing Option Orders
Always use conid for option orders:
python
contracts = client.get_option_contract(
symbol="SPX", expiry="20260126", strike=6900, right="P", trading_class="SPXW"
)
today_contracts = [c for c in contracts if c.get("maturityDate") == "20260126"]
opt_conid = today_contracts[0]["conid"]
depth = client.get_market_depth(opt_conid, rows=1)
result = client.buy_limit("SPX", 1, price=depth["ask"], conid=opt_conid, tif="DAY")Trading Classes
| Underlying | Trading Class | Description |
|---|---|---|
| SPX | SPXW | Weekly SPX options (0DTE) |
| SPX | SPX | Monthly SPX options |
| SPY | SPY | SPY ETF options |
| QQQ | QQQ | QQQ ETF options |
Option Spreads (Combo Orders)
See Combo Orders for multi-leg strategies.
Key points:
exchange="CBOE"for SPX/SPXW optionsexchange="SMART"for ETF options (SPY, QQQ)side="BUY"for the combo order (individual leg actions determine buy/sell)