Broker API HubMenu

Broker API

Interactive Brokers API

TWS API (socket via TWS or IB Gateway), and a single IBKR Web API that IBKR is folding Client Portal Web API, Digital Account Management and the Flex Web Service into.

Independent and unofficialNewest reading Official documentation

Risk warning: CFDs and spread bets are complex instruments and come with a high risk of losing money rapidly due to leverage. You can lose money on these products, and each provider publishes its own loss figure under FCA rules. You should consider whether you understand how they work and whether you can afford to take the high risk of losing your money. Automated and API trading can amplify losses through bugs, connectivity failures and runaway orders.

Quickstart: key to first call23 endpoints511 error codes

Interactive Brokers API rate limits and allowances

One record per limit. The scope is part of the limit: a figure without its scope is not a figure you can pace against.

LimitValueScopeSource
Global requests a second (Web API)10Per authenticated username, that is per Web API sessionibkrcampus.comchecked corroborated by interactivebrokers.com/docs/web-api/trading/usage-and-availability/pacing-limitations
Historical market data requestsEither 10 req/s or 50 req/minute, as the page words itGET /iserver/marketdata/history onlyinteractivebrokers.comchecked corroborated by ibkrcampus.com/campus/ibkr-api-page/webapi-doc/
Market data snapshot requests a second10GET /iserver/marketdata/snapshot onlyinteractivebrokers.comchecked corroborated by ibkrcampus.com/campus/ibkr-api-page/webapi-doc/
Order and trade list requests1 req/5 sGET /iserver/orders and GET /iserver/trades, each counted on its owninteractivebrokers.comchecked corroborated by ibkrcampus.com/campus/ibkr-api-page/webapi-doc/
Session validation requests a minute1GET /sso/validate onlyinteractivebrokers.comchecked corroborated by ibkrcampus.com/campus/ibkr-api-page/webapi-doc/
Session keep alive requests a second1GET /tickle onlyinteractivebrokers.comchecked corroborated by ibkrcampus.com/campus/ibkr-api-page/webapi-doc/

Interactive Brokers API rate limits in full, with pacing advice and the related error codes.

Access, authentication and streaming

API types listed in the record: TWS API (TCP socket), REST (Client Portal Web API), WebSocket.

How you get a key

No key: run TWS or IB Gateway (TWS API) or the Client Portal Gateway and log in via browser (Web API).

IBKR TWS API documentation, the IB Gatewaychecked IBKR Web API documentation, Client Portal Gateway installation and authenticationchecked

Who can use it

Open, funded IBKR Pro account. The Web API supports only IBKR Pro accounts, and the TWS API lists a funded and opened IBKR Pro account among its requirements.

IBKR Web API v1.0 documentation, requirements and limitationschecked IBKR Web API v1.0 documentation, introductionchecked IBKR TWS API documentation, requirementschecked

Demo

Partial: paper trading accounts are supported and the Web API is logged in to with a separate paper username; demo accounts cannot subscribe to data.

IBKR Web API documentation, using a paper accountchecked IBKR Web API v1.0 documentation, requirements and limitationschecked

Authentication

TWS API: local socket to a TWS or IB Gateway the user has logged in to by hand. Web API: Client Portal Gateway with a browser login on the same machine; the Web API also lists OAuth 1.0a, OAuth 2.0 and SSO, and IBKR's older use cases page gives OAuth as the route for institutional clients.

IBKR TWS API documentation, the IB Gatewaychecked IBKR Web API documentation, limitations of the Client Portal Gatewaychecked IBKR Web API v1.0 documentation, introductionchecked Client Portal API documentation, use cases (IBKR GitHub pages)checked

Streaming

TWS API is event driven over the socket. The Web API websocket is at /v1/api/ws (wss://localhost:5000/v1/api/ws through the gateway): the number of market data subscriptions depends on the account's market data lines, 100 by default, a market data stream ends after 15 minutes unless it is requested again, and at most 5 historical data requests run at once.

IBKR Web API v1.0 documentation, websockets introductionchecked IBKR Web API v1.0 documentation, websocket market data requestchecked IBKR Web API v1.0 documentation, websocket historical market data requestchecked IBKR Campus: Web API documentationchecked

History depth

Bars of 30 seconds or less are not available beyond six months, and expired futures not beyond two years from expiry. IBKR's current TWS API documentation, read on 12 Oct 2026, counts three pacing violations for bars of 30 seconds or less: an identical historical data request within 15 seconds, six or more requests for the same contract, exchange and tick type within two seconds, and more than 60 requests in any ten minute period, with a BID_ASK request counted twice. The Web API endpoint /iserver/marketdata/history has its own published pacing of 10 requests a second or 50 a minute. Executions: since midnight by default, up to 7 days in TWS if its Trade Log setting is changed, and the current day only in IB Gateway.

IBKR TWS API documentation, unavailable historical datachecked IBKR TWS API documentation, pacing violations for small barschecked IBKR TWS API documentation, execution detailschecked IBKR Web API v1.0 documentation, pacing limitationschecked

Rate limits, as worded

Web API: 10 requests a second for each authenticated username, which IBKR equates with each Web API session, and the same figure through the Client Portal Gateway. Some endpoints carry their own limit: /iserver/marketdata/snapshot 10 a second; /iserver/marketdata/history 10 a second or 50 a minute, with 5 concurrent requests; /iserver/orders and /iserver/trades 1 per 5 seconds; /iserver/scanner/params 1 per 15 minutes; /tickle 1 a second; /sso/validate 1 a minute. A breach returns HTTP 429. The two IBKR pages cited first, read on 12 Oct 2026, say a violating IP address may be put in a penalty box for 10 minutes and that repeat violators may be blocked permanently until the issue is resolved. IBKR's Web API v1.0 pacing page, read the same day, says 15 minutes. TWS API, read again on 12 Oct 2026: the maximum is market data lines divided by two, per second, so the default 100 lines gives 50 requests a second, and for more than that IBKR suggests its FIX API.

IBKR Web API, pacing limitationschecked IBKR Campus, Web API documentationchecked IBKR Web API v1.0 documentation, pacing limitationschecked IBKR TWS API: pacing limitationschecked

Interactive Brokers API endpoints

23 documented endpoints. Grouped by what they do

Interactive Brokers API error codes

511 decoded error codes. All Interactive Brokers errors

The list is too long to repeat on this page. By kind:

Every Interactive Brokers error code, grouped by kind, with a filter

Platform APIs an account here can reach

Platform APIOfferedNoteSource
MetaTrader 4 (MQL4)NoIBKR docs warn 'MetaTrader 4 may be no longer supported'; BrokerChooser also says IBKR does not offer MT4.MetaTrader 5, Interactive Brokers documentationchecked
MetaTrader 5 (Python package and MQL5)Not verifiedIBKR docs say 'You can connect your Interactive Brokers account to MetaTrader 5' but link out to a third-party guide; it reads as a third-party bridge, not a broker-hosted MT5 server. Entity and UK availability not stated.UnverifiedMetaTrader 5, Interactive Brokers documentationchecked
cTrader Open APINocTrader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedMetaTrader 5, Interactive Brokers documentationchecked
TradeLocker APINoTradeLocker not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedMetaTrader 5, Interactive Brokers documentationchecked
Match-Trader Platform APINoMatch-Trader not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedMetaTrader 5, Interactive Brokers documentationchecked
DXtrade APIsNoDXtrade not listed on the broker's UK platforms page; absence from an overview page is not proof, so unverified.UnverifiedMetaTrader 5, Interactive Brokers documentationchecked

Interactive Brokers API SDKs and wrappers

LibraryLanguageOfficialNoteSource
TWS API (ibapi)Python, Java, C++, C#, VBOfficialNot recordedinteractivebrokers.comchecked
ib_asyncPythonCommunityCommunity successor to ib_insync; 2.1.0 released Dec 2025. Migration note. ib_insync has been archived since March 2024 and ib_async is its maintained successor, but the archived package is still the more installed of the two: 640,258 against 556,555 over the same rolling 30 days to 23 Sep 2026, both from the pypistats.org /recent last_month counter. The 755,366 reading this page carried was taken on 20 Sep 2026 and is superseded by the 23 Sep reading above, not by a correction to it. If a tutorial tells you to install ib_insync, install ib_async instead: pip uninstall ib_insync, pip install ib_async, then change the import from ib_insync to ib_async. The class and method names are kept, so most scripts run unchanged.pypi.orgchecked
ibeamPython (Docker)CommunityCommunity headless re-auth tool for the Client Portal Gateway; 155 forks, 10 open issues; release date not checked.github.comchecked
IBKR MCP public endpointAny MCP clientOfficialHosted by IBKR at https://api.ibkr.com/v1/api/mcp-public and open to any MCP client. Connector 1.1.5 of 1 Sep 2026 is reported as the release that opened it. IBKR's AI integrations page carries no connector version and no such date, so that version and date are unverified, checked 19 Sep 2026. Read only: instructions never become orders automatically. Credentials are never passed to the AI application, and consent is revoked in Client Portal under Settings, Manage Third-Party Consents. Not available in India or Japan.ibkrguides.comchecked

Interactive Brokers API: questions and answers

Each answer is read from the record on this page, not written separately. Where the record is unverified, the answer says so.

Does Interactive Brokers have an API?

Yes. This register records Interactive Brokers as having its own API (TWS API (TCP socket), REST (Client Portal Web API) and WebSocket), with availability marked as active. TWS API (socket via TWS or IB Gateway), and a single IBKR Web API that IBKR is folding Client Portal Web API, Digital Account Management and the Flex Web Service into.

IBKR TWS API documentation, introductionchecked

Interactive Brokers API key: how do I get one?

No key: run TWS or IB Gateway (TWS API) or the Client Portal Gateway and log in via browser (Web API).

IBKR TWS API documentation, the IB Gatewaychecked IBKR Web API documentation, Client Portal Gateway installation and authenticationchecked

Who can use the Interactive Brokers API?

Open, funded IBKR Pro account. The Web API supports only IBKR Pro accounts, and the TWS API lists a funded and opened IBKR Pro account among its requirements.

IBKR Web API v1.0 documentation, requirements and limitationschecked IBKR Web API v1.0 documentation, introductionchecked IBKR TWS API documentation, requirementschecked

Interactive Brokers API demo: is there a demo or sandbox?

Partial: paper trading accounts are supported and the Web API is logged in to with a separate paper username; demo accounts cannot subscribe to data.

IBKR Web API documentation, using a paper accountchecked IBKR Web API v1.0 documentation, requirements and limitationschecked

What are the Interactive Brokers API rate limits?

Global requests a second (Web API): 10 requests per second. Scope: Per authenticated username, that is per Web API session. Historical market data requests: Either 10 req/s or 50 req/minute, as the page words it. Scope: GET /iserver/marketdata/history only. Market data snapshot requests a second: 10 requests per second. Scope: GET /iserver/marketdata/snapshot only. Order and trade list requests: 1 req/5 s. Scope: GET /iserver/orders and GET /iserver/trades, each counted on its own. Session validation requests a minute: 1 requests per minute. Scope: GET /sso/validate only. Session keep alive requests a second: 1 requests per second. Scope: GET /tickle only. As the record words it: Web API: 10 requests a second for each authenticated username, which IBKR equates with each Web API session, and the same figure through the Client Portal Gateway.

ibkrcampus.comchecked interactivebrokers.comchecked IBKR Web API v1.0 documentation, pacing limitationschecked IBKR TWS API: pacing limitationschecked

How does Interactive Brokers API authentication work?

TWS API: local socket to a TWS or IB Gateway the user has logged in to by hand.

IBKR TWS API documentation, the IB Gatewaychecked IBKR Web API documentation, limitations of the Client Portal Gatewaychecked IBKR Web API v1.0 documentation, introductionchecked Client Portal API documentation, use cases (IBKR GitHub pages)checked

Does the Interactive Brokers API support streaming?

TWS API is event driven over the socket.

IBKR Web API v1.0 documentation, websockets introductionchecked IBKR Web API v1.0 documentation, websocket market data requestchecked IBKR Web API v1.0 documentation, websocket historical market data requestchecked IBKR Campus: Web API documentationchecked

How much history does the Interactive Brokers API return?

Bars of 30 seconds or less are not available beyond six months, and expired futures not beyond two years from expiry.

IBKR TWS API documentation, unavailable historical datachecked IBKR TWS API documentation, pacing violations for small barschecked IBKR TWS API documentation, execution detailschecked IBKR Web API v1.0 documentation, pacing limitationschecked

Is there a Python library for the Interactive Brokers API?

This register lists these Python libraries for the Interactive Brokers API. TWS API (ibapi) (official, Python, Java, C++, C#, VB). ib_async (community, Python): Community successor to ib_insync; 2.1.0 released Dec 2025. Migration note. ib_insync has been archived since March 2024 and ib_async is its maintained successor, but the archived package is still the more installed of the two: 640,258 against 556,555 over the same rolling 30 days to 23 Sep 2026, both from the pypistats.org /recent last_month counter. The 755,366 reading this page carried was taken on 20 Sep 2026 and is superseded by the 23 Sep reading above, not by a correction to it. If a tutorial tells you to install ib_insync, install ib_async instead: pip uninstall ib_insync, pip install ib_async, then change the import from ib_insync to ib_async. The class and method names are kept, so most scripts run unchanged. ibeam (community, Python (Docker)): Community headless re-auth tool for the Client Portal Gateway; 155 forks, 10 open issues; release date not checked.

TWS API (ibapi)checked ib_asyncchecked ibeamchecked

Which platform APIs work with an account at Interactive Brokers?

Recorded as not offered, with a source: MetaTrader 4. Not verified either way: MetaTrader 5, cTrader, TradeLocker, Match-Trader and DXtrade.

MetaTrader 5, Interactive Brokers documentationchecked

Interactive Brokers API questions, each answered in a sentence or two.

The capability tables read one feature at a time across every broker and platform record, Interactive Brokers included.

Everything this site records for Interactive Brokers, as one JSON file. Each section of the file states its own licence. About the files. This page as Markdown.

Interactive Brokers API guides and reference

Interactive Brokers API compared

The same fields from two records, side by side. No winner is picked.

What changed recently for the Interactive Brokers API

The newest entries are shown. Every dated change, all brokers and platforms. Follow Interactive Brokers changes by RSS

Sample apps that use the Interactive Brokers API

Every app and sample

Open source repositories for Interactive Brokers

Read from GitHub's own records and ordered by stars as read. A listing is not a recommendation.

The full repository list

Partner programme

No published figure. The Interactive Brokers partner programme record. The programme register holds every record. This site carries no affiliate links.

How to cite this

Interactive Brokers API. Broker API Hub, https://openbrokerapi.com/brokers/ibkr, newest check .

Where you rely on a single figure, cite the source and the checked date printed beside it as well.

Sections