Does Interactive Brokers Have an API?
Yes, Interactive Brokers has an application programming interface (API), and it’s one of the most capable API offerings we’ve come across at retail brokers. If you write code, this is a big reason to pick IBKR.
Christian Harris
Christian is a seasoned analyst, leveraging his expertise in stocks, forex, and crypto to evaluate brokers worldwide. With hands-on trading experience and a strong focus on risk management, he helps traders find reliable platforms. Christian's work for BrokerListings.com has been cited in the Financial Times.
Christian Harris Profile PageTobias Robinson
Tobias is committed to helping traders find the right brokerage for their needs. He has tested 200+ brokers, spent 2,600+ hours using different platforms, and placed 2,100+ trades.
Tobias Robinson Profile PageJames Barra
James is an experienced broker analyst with a background in financial services. He has spent 2,500+ hours testing brokers, used 35+ different platforms and apps, audited 120+ broker T&Cs, and verified 300+ regulatory licenses.
James Barra Profile PageJuly 24, 2026
There are several routes in:
- TWS API — a TCP socket connection with official libraries for Python, Java, C++, C# and VB.NET. It mirrors what TWS itself can do, so if an action exists in the platform, you can usually script it. It needs TWS or IB Gateway running in the background.
- Client Portal Web API — a REST and websocket interface using OAuth, good for web apps and lighter integrations. Note a username can hold just one brokerage session at a time.
- FIX — for institutions and high-volume order flow.
- Excel API — DDE, ActiveX and RTD connections for people who’d rather work in spreadsheets (Windows only for some variants).
| API | Best for | Requires TWS/Gateway? |
|---|---|---|
| TWS API | Trading bots and desktop applications | Yes — TWS or IB Gateway |
| Client Portal Web API | Lightweight web integrations | Yes for individual clients using Client Portal Gateway |
| Unified IBKR Web API | OAuth-based web and institutional integrations | No local TWS/Gateway, subject to eligibility and implementation |
| FIX | Institutional order routing | Not necessarily |
| Excel API | Spreadsheet-based trading and data | Yes — uses the TWS API connection |
The broker has been rolling these into a single unified IBKR Web API with OAuth 2.0, while keeping the existing endpoints alive. A couple of practical notes from setting it up:
- Two-factor authentication is required, the docs assume real programming knowledge
- You can (and should) test everything against an Interactive Brokers paper account before going live
Developer Practicalities
- The Daily Authentication: IB Gateway requires daily restarts/re-authentication for security, which trips up headless server deployments. Some users opt for tools like ib-gateway-docker or automated 2FA workarounds.
- Third-Party Community Libraries: ib_async (or ib_insync) is the asynchronous Python library almost every developer actually uses instead of IBKR’s raw, event-driven official ibapi C++ wrapper.
- Rate Limits & Pacing Violations: IBKR’s has strict pacing rules (e.g., maximum 50 messages/sec on TWS API, and strict rate limits on historical data requests that cause temporary bans if breached).
- Market Data Subscriptions: API access doesn’t automatically give free live data streaming – users still need active market data subscriptions on IBKR to stream real-time quotes through the API.