IBKR Pro charges $0 commission on US stocks with a $1 minimum per order, $0.65 per options contract, and tiered margin rates that start at 5.83% and decrease to 4.83% for balances above $1M. IBKR Pro does not receive payment for order flow (PFOF), which means orders route to exchanges rather than to PFOF wholesalers. IBKR Pro also supports pre-market and post-market trading from 4:00 AM ET and 8:00 PM ET. IBKR Lite pays zero commission with no minimum but uses PFOF, which makes it unsuitable for serious algo trading (IBKR Pricing, September 2026).
| Cost component | IBKR Pro | IBKR Lite |
|---|
| US stocks | $0 + $1 min/order | $0 (PFOF) |
| US options | $0.65 / contract | $0.65 / contract |
| Futures | $0.25-$1.00 / contract | $0.25-$1.00 / contract |
| Margin rate (above $1M) | 4.83% | 5.83% |
| Direct routing | Yes | No (PFOF) |
| Pre/post-market | Yes | Limited |
Source: IBKR Pricing page, September 2026.
Connecting, Placing Orders, and Requesting Market Data
The canonical ib_insync pattern in 2026 is `IB.connect()`, contract qualification via `qualifyContracts()`, market order via `MarketOrder`, and `placeOrder()`.
# ib_insync 2026 - place a market order on AAPL
from ib_insync import *
ib = IB()
ib.connect('127.0.0.1', 7497, clientId=1) # TWS paper: 7497; live: 7496
contract = Stock('AAPL', 'SMART', 'USD')
ib.qualifyContracts(contract)
ticker = ib.reqMktData(contract, '', False, False)
ib.sleep(2) # wait for tick snapshot
order = MarketOrder('BUY', 100)
trade = ib.placeOrder(contract, order)
print(f'order placed: id={trade.order.orderId}, status={trade.orderStatus.status}')
ib.disconnect()
This sequence connects to TWS on `127.0.0.1:7497` (paper) or `7496` (live), qualifies the AAPL contract (converts a partial symbol spec into a fully qualified Contract), requests a market data tick, places a 100-share market buy, and prints the order id. The `ib.sleep(2)` line is needed to allow the market data tick to arrive before placing the order. For a 200-line starter with bracket orders, historical bars, and event handlers, see the ib_insync notebook on GitHub (ib_insync docs, September 2026).
Historical Bars, Options Chains, and Real-Time Streaming
The IBKR API supports historical bars via `reqHistoricalData`, options chains via `reqSecDefOptParams`, and real-time streaming via `reqMktData` with `RTVolume` or `AllLast` tick types.
The historical data API returns bar series as numpy arrays or pandas DataFrames with date, open, high, low, close, volume, average volume, bar count, and trade count fields. Bar duration strings range from `1 secs` to `1 yr`. Options chains are returned as strikes + expirations via `reqSecDefOptParams` with the full chain for an underlying; Greeks are computed client-side using Black-Scholes or via the live `reqMktData` Greeks tick. Real-time streaming supports tick types including `Bid`, `Ask`, `Last`, `BidSize`, `AskSize`, `Volume`, `RTVolume` (last trade with cumulative volume), and `AllLast` (real-time consolidated last). Common subscriptions cost $1-$30 per month per exchange (IBKR Market Data Subscriptions, September 2026).
Common Failure Modes and the ib_async Migration
The most common IBKR API failures in 2026 are connection drops (TWS auto-disconnects after 5 minutes of idle), pacing violations (max 50 historical data requests per 10 minutes), and contract qualification errors.
TWS auto-disconnects after 5 minutes of no API activity; the workaround is to send a `reqCurrentTime` heartbeat every 60-120 seconds via `ib.reqCurrentTime()` or use `ib_insync`'s `ib.timeout` setting. Historical data is rate-limited to 50 requests per 10 minutes per account, with a hard cap of 60 simultaneous streaming ticks. For new projects in 2026, consider `ib_async`, the modern asyncio-native successor to `ib_insync` released in 2024 with stricter typing, a Pydantic-based contract model, and built-in retry backoff (ib_async GitHub, September 2026).
FAQs
What is the minimum account size for the IBKR Python API?
The IBKR Python API does not require a minimum account size. The minimum funding requirement for a Pro account is $0 to open, but pattern day trader rules require $25,000 in equity for unlimited-day-trade margin accounts.
Does the IBKR API support short selling in 2026?
Yes - the IBKR API supports short selling via the order `action='SSHORT'` for shortable shares or `action='SSHORTX'` for short sale exempt. Locate fees apply on hard-to-borrow inventory at 0.25%-3% annualized.
Can the IBKR API be used on Raspberry Pi?
Yes - IB Gateway runs on Raspberry Pi 4+ with Ubuntu or Raspberry Pi OS, and supports all of the ibapi and ib_insync commands. Memory footprint is 1-2 GB; storage is 4-8 GB.
Does IBKR offer paper trading via the API?
Yes - IBKR paper trading uses TWS Paper port 7497 (vs. live 7496) or the dedicated paper account in IB Gateway. Paper trading supports all order types, market data (free), and account features with simulated fills at real prices.
Resources and Next Steps
For developers getting started with the Interactive Brokers Python API in 2026, start with the TWS API documentation on GitHub and the ib_insync README for the fastest ramp. ib_async is the recommended choice for new projects in 2026; ib_insync remains the most-deployed wrapper on production systems. IBKR Pro is the right tier for algo trading because it avoids PFOF and supports direct order routing. Market data subscriptions are billed monthly per exchange ($1-$30 per month) and start with delayed free data for the first month.