top of page

IBKR API Comparison: Web, TWS, FIX or Excel?

4 hours ago
17 min read
IBKR API comparison: Web API, TWS API, FIX or Excel cover

AI Summary: Interactive Brokers offers four developer APIs: a REST-based Web API with WebSocket streaming, the socket-based TWS API, FIX for institutional order routing, and an Excel API that sits on top of TWS. This IBKR API comparison covers how each one connects, how you authenticate, what it can and cannot do, and which option fits a retail algo trader, an RIA, a fintech app, an institution or a spreadsheet workflow. IBKR’s own wording is that the Web API offers “access to our largest breadth of capabilities”, including account opening, funding and reporting as well as trading, with WebSocket streaming for market data and notifications. The TWS API is the trading-oriented socket interface with nearly full TWS order and market-data parity. FIX is for high-speed order routing, not market data, and carries equity and monthly commission minimums. Excel is for Windows spreadsheet users and is not a separate broker protocol.


Clients often ask which Interactive Brokers API they should build on. The answer is not one product. IBKR publishes four: a REST-based Web API, which it describes as offering “access to our largest breadth of capabilities” with WebSocket streaming, plus FIX, the TWS API and an Excel API. This IBKR API comparison walks through how each one connects, what it covers, where the limits are, and which option fits which kind of client. The facts below are taken from IBKR’s API solutions page and its current API documentation.


If you already know you need the TWS API in Python, start with ib_insync vs ib_async. If the question is how to run the Gateway unattended, see our headless IB Gateway in Docker guide. Advisors allocating one order across many accounts should read IBKR FA allocation. A worked example of those pieces together is in our IBKR options trading automation case study.


The four IBKR APIs, in brief


IBKR’s documentation presents four first-party APIs, and says you can use features from one API or several, depending on the job.


  • Web API. A REST API over HTTPS, with JSON responses and WebSocket streaming. IBKR’s trading page says it offers access to the firm’s “largest breadth of capabilities”: account opening, account management, funding, banking, reporting and trading, including advisor sub-account structures. Authentication is documented as OAuth 2.0 on the docs home page, with three practical methods: the Client Portal Gateway for individual accounts, OAuth 1.0a, and OAuth 2.0. Account management features for advisors and introducing brokers live here, not on the TWS API.

  • TWS API. A TCP socket protocol that talks to Trader Workstation or IB Gateway. Official libraries are Python, Java, C++, C# and VB.NET (C# and VB.NET on Windows only). IBKR describes it as built for fast, data-intensive trading, with nearly full parity with TWS functionality, order types and market data, and positions it for retail traders, professional traders, financial advisors and third-party platform developers. The current TWS API is released as open source under the GPL.

  • FIX. The Financial Information eXchange protocol, used for electronic order transmission. IBKR’s FIX Engineering team runs onboarding. Institutional and enterprise clients need dedicated connectivity (VPN, extranet, leased line or cross-connect). Other clients may run FIX over the internet through IB Gateway. FIX is for order routing. It does not provide market data.

  • Excel API. Not a separate broker protocol. It is a Windows bridge from Microsoft Excel to TWS or IB Gateway, built on the same TWS API socket, via DDE, ActiveX or RTD. IBKR says it offers the same order types, order conditioning and market data availability as the TWS API, aimed at retail and professional traders who prefer a spreadsheet to a fully automated programme.


Two companion services sit next to these APIs and are easy to confuse with them. The Account Management part of the Web API is how eligible advisors and brokers handle client registration, maintenance, funding and reporting while keeping their own interface. The Flex Web Service automates Flex Query reports and is a reporting channel, not a live execution API.


IBKR API comparison at a glance



Web API

TWS API

FIX

Excel API

How it connects

HTTPS REST + WebSocket to IBKR, or via the Client Portal Gateway on localhost

TCP socket to a logged-in TWS or IB Gateway

FIX session: dedicated line for institutions, or IB Gateway over the internet for others

DDE, ActiveX or RTD from Excel to TWS or IB Gateway (Windows)

Authentication

Client Portal Gateway (individuals), OAuth 1.0a, or OAuth 2.0. OAuth 1.0a is the method IBKR documents for third-party developers

Log in to TWS or IB Gateway, then connect with a client ID. IBKR does not support automatic login

Onboarding and certification with FIX Engineering; a production TWS user is converted to a dedicated FIX session user

Same login as the TWS API: TWS or IB Gateway must already be signed in

Session rules

One brokerage session per username across all IBKR platforms. Authenticated for up to 24 hours, resetting at midnight in New York, Zug or Hong Kong. Times out if unused for about five minutes

TWS or IB Gateway must stay running. Daily auto-restart is available; weekly reauthentication can require a manual login

Persistent FIX session after certification

Same process lifetime as TWS or IB Gateway

Streaming

WebSocket. Market data streams end after 15 minutes; resubscribe before 10 minutes to keep them going. Watchlist updates are documented at 500 ms

Streaming continues until you cancel or disconnect. Only the initial subscribe counts toward pacing

No market data

RTD is market-data only (250 ms refresh in IBKR’s Excel overview). DDE and ActiveX can place orders; ActiveX refreshes market data at 1 second, DDE at 250 ms

Languages

Any stack that can call HTTPS/JSON and WebSockets

Official: Python (3.11+), Java 21, C++14, C# and VB.NET

Standard FIX, integrated with IBKR’s FIX Engineering team

Windows Excel, with VB.NET; DDE is Java underneath, ActiveX and RTD are C#

Coverage

Trading, market data, scanners, portfolio updates, plus account opening, funding, banking and reporting for eligible account types

Nearly full TWS order-type and market-data parity. Does not include Web API account-opening or funding flows

Order placement and related FIX messages only

Same TWS API functions through Excel, with RTD limited to streaming market data

Documented rate limits

10 requests per second per authenticated username, plus tighter per-endpoint limits (for example, open orders and trades once every five seconds). A 429 can put the IP in a 10-minute penalty box

Default 50 requests per second (market data lines ÷ 2; 100 lines by default). Subsequent streaming updates do not count. IBKR suggests FIX if you would send more than 50 requests per second

250 messages per second if you use FIX through IB Gateway. No message-per-second cap is documented for a direct FIX connection, with the note that “less is better”

The same 50 messages per second TWS API cap applies to RTD subscriptions and cancellations

Who it is for

Individuals (via the Client Portal Gateway), advisors, brokers, funds and third-party developers (via OAuth). Best when you need account management or a REST-first product

Retail and professional traders, advisors and platform developers building automated trading systems

Professional traders, organisations and institutions that need high-speed order routing

Retail and professional traders who want to trade or watch data from a spreadsheet

To get started

Funded IBKR Pro account. Individuals can start with the Client Portal Gateway. Some OAuth methods and account-management features need approval or configuration

Funded and open IBKR Pro account, current TWS or IB Gateway, and the TWS API. No separate onboarding for the API itself

USD 10,000 minimum equity to apply, then certification. Monthly minimum commissions: USD 1,500 for the first FIX session and USD 1,000 for each additional session

Windows, Excel, and a running TWS or IB Gateway with the API enabled


Web API: REST, OAuth and WebSockets


The Web API is the one to choose when the product is a web or mobile app, when advisors or brokers need account opening and funding in their own interface, or when a third-party platform must connect many IBKR users through OAuth.


IBKR documents three authentication methods, and the right one depends on the account type:


  • Client Portal Gateway (CPGW) is the standard method for individual, joint, IRA and trust accounts. It is a Java programme that reverse-proxies login through SSO. You start it locally, sign in through a browser on the same machine (the default in IBKR’s quick start is https://localhost:5000), and send API calls from that same machine. IBKR does not support automating that browser login, and clients must reauthenticate daily. Endpoints under `/gw/api`, `/oauth` and `/oauth2` are not available through the gateway.

  • OAuth 1.0a authenticates fully in code with a live session token derived from private keys. IBKR lists it for advisor, broker and FCM, proprietary trading group, hedge and mutual fund, institutional hedge-fund investor, and third-party developer accounts, and says it is the only supported authentication method for third-party developers.

  • OAuth 2.0 is documented as a programmatic method for advisor, broker and FCM, proprietary trading group, hedge and mutual fund, and institutional hedge-fund investor accounts. Account Management endpoints are available only through OAuth 2.0, and only for advisor and broker accounts. The docs home page states that Web API authorisation and authentication are managed using OAuth 2.0, and that IBKR supports `private_key_jwt` client authentication as described in RFC 7521 and RFC 7523.


A successful login is not enough to trade. Web API sessions are two-tiered: a read-only session that can call non-`/iserver` endpoints, and a brokerage session that unlocks trading, market data and everything under `/iserver`. A username may have only one brokerage session at a time across TWS, Client Portal, IBKR Mobile and the Web API. If you need two IBKR products open at once, IBKR’s documented path is a second username, with a separate market-data subscription.


Keep the brokerage session alive. IBKR says it is terminated when unused for longer than five minutes, recommends calling the `/tickle` endpoint about once a minute, and notes that a session can remain authenticated for up to 24 hours, resetting at midnight in New York, Zug or Hong Kong, depending on the nearest connection. Daily server maintenance can cut that short.


Two trading details are easy to miss. After you initialise a brokerage session, IBKR tells you to wait two seconds and confirm `GET /iserver/accounts` returns a non-empty list before you trade. Order-reply messages often ask for an extra confirmation; without a response, the order is not accepted. You can suppress those prompts with `POST /iserver/questions/suppress` if you intend to submit orders unattended.


Pacing is tighter than on the TWS API. The global cap is 10 requests per second per authenticated username. Some endpoints are slower still: `/iserver/orders` and `/iserver/trades` may be called once every five seconds, and historical market data is also capped at 50 requests per minute. Exceeding a limit returns HTTP 429. Repeat offenders can have their IP placed in a 10-minute penalty box, and IBKR says repeat violators may be blocked until the issue is resolved.


For live data, prefer the WebSocket `smd` topic over snapshot HTTP calls. IBKR documents watchlist updates on the Web API at 500 ms, and states that market data streams terminate after 15 minutes, so you should send a new subscription before 10 minutes have elapsed if you need a continuous stream.


Paper testing uses a separate paper username and password, not a live/paper slider. You look those up under Account Configuration → Paper Trading Account in Client Portal, then log into the Client Portal Gateway with that paper username.


Which IBKR API is best suited to your trading needs?

  • Web API

  • TWS API

  • FIX API

  • Excel API


TWS API: the socket interface behind most trading systems


The TWS API is the one most algo traders and internal trading engines should start with. Your programme opens a TCP socket to a running TWS or IB Gateway, after you have enabled “ActiveX and Socket Clients”, turned off “Read-Only API” if you need to place orders, and confirmed the socket port in Global Configuration. IBKR’s own connection examples use port 7497; always use the port shown in your settings. The connection is ready only after the `nextValidId` callback arrives. Earlier messages can be dropped.


IB Gateway is the usual host for unattended systems: it is a lighter Java application than TWS, with a minimal interface used only for API settings. It is not the same programme as the Client Portal Gateway. Mixing them up is a common first mistake. Running IB Gateway reliably on a server, including the daily restart and weekly two-factor login, is the subject of our headless IB Gateway in Docker article.


Session limits matter as much as code. A username can hold only one brokerage session across IBKR’s platforms, so logging into TWS on a laptop can knock a Gateway session offline. In Global Configuration → Lock and Exit, IBKR recommends “Never lock Trader Workstation” and “Auto restart” for API users (IBHK users have a narrower set of options and are directed to IB Gateway). The weekly authentication cycle starts every Monday; a soft-token error is the signal that you need to log in again by hand. IBKR’s FAQ is explicit: it does not support automatic login into TWS or IB Gateway.


Pacing is more generous than the Web API, which is why IBKR points high-volume traders here, and then to FIX. The cap is your maximum market data lines divided by two, per second: 50 requests per second at the default 100 lines, 100 requests per second at 200 lines, and so on. Starting a market-data subscription counts as one request; the stream that follows does not. If you plan to send more than 50 requests per second, IBKR says some orders may be queued and delayed, and asks you to consider FIX. Breaking the cap three times, when “reject messages above maximum allowed message rate” is enabled, disconnects the API session (error 100, then a broken pipe).


Each connection has a client ID. Client ID 0 can also see trades placed in TWS or through FIX. A Master Client ID, set in Global Configuration, can retrieve orders and executions from other API connections. Use distinct client IDs if several programmes attach to the same Gateway.


Official language versions currently documented are Python 3.11 or later, Java 21 and C++14. C# and VB.NET are Windows-only. If you are in Python, ib_async is the maintained library to use in place of ib_insync. Financial advisors who need one order split across client accounts can do that on the TWS API with `faGroup`; we cover the details in IBKR FA allocation.


One regulatory limit is easy to miss: Interactive Brokers Canada does not allow clients to submit orders programmatically through the API, including third-party platforms, for products traded on a Canadian exchange or marketplace.


FIX: institutional order routing, not a market-data feed


Choose FIX when order rate, not feature breadth, is the constraint. IBKR presents FIX as the path for institutions that want high-speed order routing and broad market depth, and its TWS pacing page points here once you would otherwise exceed 50 requests per second.


What FIX does not do is equally important. IBKR’s FAQ states that FIX/CTCI is only for order placement and cannot be used to receive market data. You still need the TWS API or the Web API, or a market-data vendor, for quotes, account values and reports.


Getting a session is a process, not a download. You contact fixengineering@ibkr.com, and IBKR checks that the account meets its published minimums: USD 10,000 equity to apply, then a monthly minimum commission of USD 1,500 for the first FIX session and USD 1,000 for each additional session. If actual trading commissions fall short, IBKR assesses the difference. After a test session, a supervised certification (including unsolicited cancels, simulated trade busts and line-failure recovery) and a small production checkout, FIX Engineering converts an existing production TWS user into a dedicated FIX session user.


Connectivity depends on the client type. Institutional and enterprise clients must arrange dedicated connectivity: VPN, extranet, leased line or cross-connect. Non-institutional clients may use FIX over the internet through IB Gateway, where IBKR documents a limit of 250 messages per second. A direct FIX connection has no documented messages-per-second cap, with the guidance that “less is better”.


Excel API: DDE, ActiveX and RTD


The Excel API is the right choice when the trader’s book already lives in a spreadsheet and they want quotes, positions or orders in the same workbook. It is the wrong choice if you are building a service, a mobile app or an unattended engine.


All three variants require Windows, a running TWS or IB Gateway, and the same API enablement as the TWS API. They share the TWS API’s 50-message-per-second cap.


  • DDE exposes the full TWS API and can be driven with Excel macros, with a 250 ms market-data refresh. Under the hood it uses Java and VB.NET.

  • ActiveX also exposes the full TWS API, with a 1-second market-data refresh. Cell assignment is not something you can do with macros alone; you need some VB.NET. IBKR notes that it is harder to programme than the other Excel APIs and less robust than a non-Excel socket client, and suggests considering the C# API directly.

  • RTD is built for larger real-time market-data requests without dragging Excel down, also at a 250 ms refresh. IBKR is explicit: it can only retrieve streaming market data. There is no established utility in RTD for placing orders or pulling account data.


IBKR’s sample workbooks are demonstrations, not production trading tools, and Excel must use US number conventions (comma for grouping, period for decimals).


Which IBKR API fits you?


Retail or professional algo trader. Start with the TWS API through IB Gateway. You get the wider order-type coverage, higher default pacing, streams that run until you cancel them, and official Python, Java, C++ or C# libraries. Plan for the daily restart and the weekly manual login. Use a paper account before you trade live. If your working environment is a spreadsheet, use Excel DDE or ActiveX against the same Gateway, and move to a proper TWS API client when the workbook becomes the system.


RIA or financial advisor running multiple client accounts. Use the TWS API or the Web API for trading, and put allocation groups at the centre of the design so one block order is split fairly. That workflow is covered in IBKR FA allocation and in our multi-account options automation case study. If you also need client registration, account maintenance, funding or reporting inside your own portal, that is the Web API’s Account Management surface, and those endpoints are documented as available only through OAuth 2.0 for advisor and broker accounts.


Fintech app that embeds brokerage. Use the Web API. Third-party developers are directed to OAuth 1.0a. Design for a single brokerage session per username, token handling, competing sessions, WebSocket renewal and the 10-request-per-second cap. Do not put client secrets in the app. Account-opening and funding features are not automatic: IBKR says some account-management functions require configuration by its Sales Engineering team and are not available to every account type.


Institution or broker-dealer with a FIX mandate. Use FIX for order routing, after you have confirmed the equity and monthly commission minimums and completed certification. Pair it with the TWS API or the Web API for market data, positions and reports, because FIX will not supply those. Institutional and enterprise firms should budget for dedicated connectivity, not only for the session fees.


Spreadsheet-led trader or analyst. Use the Excel API. Pick RTD if you only need streaming quotes, DDE if you want full TWS functions with macros, and ActiveX if you are prepared to write VB.NET for the full function set. Stay on Windows, and treat the official sample sheets as examples, not a production desk.


Migration notes


IBKR’s own API page says you can use features from one API or many. That is usually better than a full rewrite.


  • Excel to the TWS API is the most natural move, because Excel already speaks the TWS API. You keep the same Gateway, ports, client IDs and order model, and replace spreadsheet logic with a Python, Java, C++ or C# client.

  • TWS API to Web API, or the reverse, is a rewrite of session handling, authentication and order confirmation, not a library swap. Pacing, streaming lifetime and the “one brokerage session per username” rule all change. Budget time to retest every order type you rely on.

  • Adding FIX is an on-ramp for order volume, not a replacement for market data or account APIs. Keep TWS or the Web API beside it.

  • Reporting can stay on the Flex Web Service next to any of the trading APIs, so you do not have to pull statements out of the live session.

  • Libraries are not APIs. ib_insync and ib_async wrap the TWS API, not the Web API. See ib_insync vs ib_async if that is the migration you actually have.


Always retest in a paper account first. The paper environment is simulated and, as IBKR notes, order execution can differ from live.


Common pitfalls


  • Confusing the two gateways. IB Gateway hosts the TWS API (and can host FIX for non-institutional clients). The Client Portal Gateway hosts the Web API for individual accounts. They are different Java programmes, with different login models and ports.

  • Competing brokerage sessions. Logging into TWS, Client Portal or IBKR Mobile with the same username will contend with your API session. IBKR allows one brokerage session per username.

  • Assuming login can be fully automated. IBKR does not support automatic login for TWS, IB Gateway or the Client Portal Gateway. Individuals using the Web API should plan for a daily browser login on the gateway machine. TWS and IB Gateway users should plan for a weekly manual reauthentication.

  • Letting the Web API session go idle. Without `/tickle` or other `/iserver` traffic, the brokerage session times out in about five minutes. WebSocket market-data subscriptions also need to be renewed before the 15-minute cut-off.

  • Ignoring order-reply prompts on the Web API. If you do not confirm or suppress them, IBKR will not accept the order.

  • Expecting market data from FIX. You will not get it. Pair FIX with another API or a data vendor.

  • Treating Excel RTD as a trading API. It streams quotes only.

  • Overrunning pacing. 10 requests per second on the Web API, 50 on the TWS API by default. A Web API 429 can isolate your IP for 10 minutes. A repeated TWS pacing breach can drop the socket.

  • Building for IBKR Lite. IBKR’s TWS API and Web API getting-started guides call for a funded IBKR Pro account.

  • Skipping Canada’s API restriction if you or your clients would send programmatic orders in Canadian-listed products through Interactive Brokers Canada.


How FintegrationFS can help


We design and build Interactive Brokers integrations for trading firms, advisors and fintech products: choosing the API, wiring authentication and sessions, running IB Gateway unattended, allocating orders across advisor accounts, and putting risk controls around live order flow. We do not claim a single API is always right, When the work is a Python TWS API client, we start from ib_async rather than the archived ib_insync library.


If you want a sense of how those pieces look in production, read the IBKR options trading automation case study. If you already know which API you need and want a hand implementing it, talk to us.


FAQ


Which IBKR API should I use?

It depends on the job. Use the TWS API through IB Gateway for automated trading that needs broad order types and higher request rates. Use the Web API for REST- and OAuth-based products, advisor or broker account management, and third-party apps. Use FIX when you need institutional-scale order routing and can meet IBKR’s equity and monthly commission minimums. Use the Excel API when the workflow is a Windows spreadsheet. This IBKR API comparison is a starting point; the constraints that usually decide it are authentication, session model, pacing and whether you need market data or account opening on the same connection.

For non-trading features, yes. IBKR says the Web API offers “access to our largest breadth of capabilities”, including account opening, account management, funding, banking, reporting and trading. The TWS API is documented as having nearly full parity with TWS trading, order types and market data, but it does not replace those account-management flows. For pure trading, the TWS API still has the higher default pacing and streams that do not have to be renewed every few minutes.

IB Gateway is a lightweight alternative to TWS. Your TWS API (or, for some clients, FIX) programme connects to it over a local socket after you log in. The Client Portal Gateway is a Java reverse proxy used to authenticate individual accounts to the Web API in a browser on the same machine. Choosing a gateway is choosing an API.

Not with the same username for trading. IBKR allows only one brokerage session per username across TWS, Client Portal, IBKR Mobile and the Web API. You can keep a Web API read-only session while a brokerage session runs elsewhere, or create a second username if you need two trading platforms at once, with a separate market-data subscription.

IBKR’s getting-started material presents the trading Web API as available to IBKR clients free of cost, and clients with a fully open and funded account may use the Web API and the TWS API without a separate onboarding process. Some Web API authentication methods and account-management features do need approval or configuration. FIX is different: it has a USD 10,000 equity requirement to apply and monthly minimum commissions of USD 1,500 for the first session and USD 1,000 for each additional session. Market-data subscriptions are charged separately.

Check pacing first. The Web API allows 10 requests per second per username, with some endpoints slower than that, and may return 429. The TWS API allows 50 requests per second by default. FIX through IB Gateway is documented at 250 messages per second. Also check that your brokerage session is still authenticated, that Web API order-reply prompts have been confirmed or suppressed, and that a second login has not taken the session.

No. IBKR’s FAQ states that FIX/CTCI is only for order placement and cannot be used to receive market data. Use the TWS API, the Web API or another market-data source alongside FIX.

It can be, if the trader works in Excel on Windows and accepts the same TWS or IB Gateway session limits as the TWS API. DDE and ActiveX can place orders. RTD cannot: it only streams market data. For an unattended or multi-user system, a TWS API or Web API client is the more robust path, which is also IBKR’s own comparison between ActiveX and a non-Excel socket application.

We help trading firms, advisors and fintech teams choose and implement the right Interactive Brokers API. If you are deciding between the Web API, TWS API, FIX or Excel, book a call with our team.



imgi_48_Arpan Desai Profile Photo (1).png

About Author 

Arpan Desai

CEO & FinTech Expert

Arpan brings 14+ years of experience in technology consulting and fintech product strategy.
An ex-PwC technology consultant, he works closely with founders, product leaders, and API partners to shape scalable fintech solutions.

 

He is connected with 300+ fintech companies and API providers and is frequently involved in early-stage architectural decision-making.

Rectangle 6067.png

Contact Us

Are you looking to build a robust, scalable & secure Fintech solution?
bottom of page