
Ib Option Chain
This pulls option chain data directly from your Interactive Brokers account through TWS or IB Gateway. You get calls and puts with all the expected fields: strikes, bid/ask spreads, volume, open interest, and implied volatility. It's built for when you need actual IBKR data instead of a third-party feed, which matters if you're trading through IB and want to see exactly what your broker sees. The two-step flow is a bit clunky (fetch expiries first, then the chain), but that's how IB's API works. Outputs clean JSON that includes the underlying price for reference. Requires your local IB gateway running, so this isn't pulling data from the cloud.
- GitHub stars
- 248
- last updated
- Jun 11, 2026
Install
$ npx -y skills add staskh/trading_skills --skill ib-option-chain --agent claude-codeInstalls into .claude/skills of the current project.
Files
IB Option Chain
Fetch option chain data from Interactive Brokers for a specific expiration date.
Handles equities/ETFs (Stock/OPT) and futures options (FOP). The asset type and
exchange are resolved from IB contract details (no hardcoded symbol table): auto-detect
tries a SMART stock first and falls back to a future when no stock exists (so NQ, GC,
RTY resolve as futures, while AAPL resolves as a stock even though it has an obscure
single-stock future). Tickers that are both a stock and a futures root (e.g. ES=Eversource,
CL=Colgate) default to the equity — pass --sec-type fut to force the future.
IB Connection
TWS or IB Gateway must be running locally with API enabled:
- Paper trading — port 7497
- Live trading — port 7496
IB_PORTenv var — default port when--portis omitted (e.g.IB_PORT=4001for a Gateway container). Precedence:--portflag >IB_PORT> built-in default. Set it in the shell or a.envfile.
Sponsors
Details
- Repository
- github.com/staskh/trading_skills
- Categories
- Backend & APIs, Finance & Trading
- License
- MIT
- First seen
- Jun 11, 2026
More from staskh/trading_skills
All 28- Ib Pmcc Advisor
- Ib Portfolio
- Ib Portfolio Action Report
- Ib Report Delta Adjusted Notional Exposure
- Ib Stop Loss
- Ib Trades History
- Ib Trailing Stop
- Insider Trading
- Markdown To Pdf
- Price History
- Scanner Bullish
- Scanner Pmcc
- Spread Analysis
- Whale Hunting
- Technical Analysis598
- News Sentiment246
- Fundamentals182
- Stock Quote131
- Greeks128
- Report Stock117
- Option Chain111
- Risk Assessment105
- Earnings Calendar
- Ib Account