United States
We review brokers fairly and independently. Learn how we make money and why you can trust our ratings.

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.

Author Image Written By
Christian Harris
Fact Checker Image Fact Checked By
Tobias Robinson
Editor Image Edited By
James Barra
Updated
July 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).
Make Full Width
Interactive Brokers API Options
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
Show Full Table

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:

  1. Two-factor authentication is required, the docs assume real programming knowledge
  2. 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.