Direct answer
Choose Alpaca for automation on US stocks, ETFs, options or crypto when a fast start matters: API keys over HTTP, SDKs and a free paper account anyone can open with an email address. Choose Interactive Brokers when the strategy needs global markets or products such as futures and currencies, and accept running TWS, IB Gateway or Client Portal Gateway, or qualifying for OAuth. Then check the rate limit, the paid market data and the paper account rules that apply to you.
Alpaca vs IBKR at a glance: interfaces, limits and testing
Official documentation checked on 12 October 2026. These are documented integration facts, not an IMRYN execution benchmark or a fee comparison.
| Decision point | Alpaca | Interactive Brokers |
|---|---|---|
| Interface | Trading API with SDKs. The same API spec for paper and live accounts. | Web API: REST over HTTPS with JSON. TWS API: TCP socket to Trader Workstation or IB Gateway. |
| Authentication | API keys. The paper account has its own key and base URL. | Individual accounts use Client Portal Gateway on the calling machine. OAuth for third-party developers and institutional types. |
| Rate limits | Market data: 200 historical calls per minute on Basic, 10,000 on Algo Trader Plus. | Web API: 10 requests per second per session, HTTP 429 above it. TWS API: 50 requests per second with 100 data lines. |
| Paper trading | Free paper-only account for anyone, $100k default balance. No market impact, latency slippage, queue position or dividends. | Requires an approved and funded regular account. Order execution may vary from live trading. |
| Market data | Basic is free with IEX only for equities. Algo Trader Plus, $99 a month, adds all US exchanges and OPRA. | Paid subscription required except delayed watchlist data. Data type: live, frozen, delayed or delayed frozen. |
| Session upkeep | Keep X-Request-ID for support. Extended hours accept limit orders only. | Auto restart recommended. The weekly reauthentication can require a manual login. |
The short verdict: Alpaca or Interactive Brokers?
Pick Alpaca when your automation trades US stocks, ETFs, options or crypto and you want working code quickly. Its Trading API comes with SDKs, a paper-only account needs only an email address, and Alpaca states that the API spec is the same for paper and live accounts.
Pick Interactive Brokers when the strategy needs more than that. IBKR describes trading global stocks, options, futures, currencies and more from a single platform, and notes that not every product is available in every country or to every client. The price is a heavier connection model: a running TWS or IB Gateway for the TWS API, or Client Portal Gateway or OAuth for the Web API.
Neither API decides whether a strategy is sound. This page compares documented integration facts checked on 12 October 2026. It is not a test of execution quality, fees or returns.
How each API connects your code to the broker
Alpaca authenticates Trading API calls with API keys, and your paper account has a different key from your live account. Moving to paper means replacing the key and the base URL, for example https://paper-api.alpaca.markets. Every Trading API response carries an X-Request-ID header, which Alpaca asks for in support requests, so log it with each order call.
The IBKR Web API is a REST interface over HTTPS with JSON messages. Individual accounts authenticate through Client Portal Gateway, a Java client that reverse-proxies the login through SSO. You log in from a browser on the same machine, and every API call must come from the machine where the gateway was authenticated. OAuth 1.0a is the only method for third-party developers, and OAuth 2.0 serves advisor, broker and institutional account types.
The TWS API is a TCP socket protocol that talks to Trader Workstation or IB Gateway, so one of them must be running. IBKR provides code in Python, Java, C++, C# and Visual Basic, and lists a funded and opened IBKR Pro account as a requirement, with Python 3.11 as the minimum Python release. It also warns that a feature missing from TWS is missing from the API.
Rate limits that shape an automated loop
On the IBKR Web API, the global limit is 10 requests per second for each authenticated username, which means each Web API session. Some endpoints are tighter: /iserver/orders and /iserver/trades allow 1 request every 5 seconds. Going over returns HTTP 429, and the offending IP address can be put in a penalty box for 10 minutes.
On the TWS API, the request limit per second equals your market data lines divided by 2. With the default 100 lines, that is 50 requests per second. IBKR points heavier users to its FIX API, limited to 250 messages per second through IB Gateway.
Alpaca publishes call limits by market data plan: 200 historical API calls per minute on the free Basic plan and 10,000 per minute on Algo Trader Plus. Size polling, retries and backoff for the plan or session you actually use, not for the best case.
Paper trading: who can test, and what it hides
Alpaca paper trading is free, and anyone globally can open a paper-only account. It starts with a $100k balance by default and can be reset. Fills are simulated from real-time quotes, and Alpaca lists what the simulation leaves out: market impact, information leakage, slippage due to latency, queue position for non-marketable limit orders, regulatory fees and dividends.
An IBKR paper account opens once your regular account has been approved and funded. It offers the full range of trading facilities in a simulated environment, but IBKR says it relies on more simulated technologies than live trading, so order execution may vary. The Web API has no live or paper switch: you log in to Client Portal Gateway with your separate paper username.
In both cases, a paper result validates the plumbing, not the strategy. Test the order states and error paths you expect to meet live.
Market data: what is free and what you pay for
Alpaca’s Basic plan is free. It serves real-time equities from IEX only, an indicative feed for options, 30 symbols on the stock WebSocket, and historical data that excludes the latest 15 minutes. Algo Trader Plus, at $99 a month, covers all US stock exchanges and the OPRA options feed.
IBKR states that a paid data subscription is required for all API market data except delayed watchlist data. In the TWS API you set the data type for a request: live, frozen, delayed or delayed frozen. Check which type you received before an automated rule uses the price.
Keeping an automated session alive
TWS and IB Gateway shut down at a time set under Lock and Exit. For API users, IBKR recommends Never lock Trader Workstation and Auto restart. The weekly authentication cycle starts every Monday, and a Soft token=0 login failure means you must log in again manually. Decide in advance who handles that step.
IBKR also notes that Interactive Brokers Canada does not allow your own application to submit orders through the API for products traded on a Canadian marketplace. On Alpaca, extended hours accept only limit orders with a day or gtc time in force, and the overnight session runs from 8:00pm to 4:00am ET, Sunday to Friday.
Checklist before you automate with either API
Run these checks against your own account and jurisdiction before the first live order.
- List the instruments and markets the strategy needs, then confirm each one is available to your account and country.
- Write down the rate limit of your session or plan, and keep polling and retries below it.
- Decide where the session lives: an always-on gateway for IBKR, or keys stored as secrets for Alpaca.
- Run the full order lifecycle in paper trading, including rejections, partial fills and cancels.
- Confirm which feed or data type each price comes from before a rule acts on it.
- Log every request with its timestamp and identifier, including Alpaca’s X-Request-ID.
- Keep a manual stop that still works when the API or the gateway is down.
Where IMRYN fits
IMRYN is systematic trading infrastructure in development, built around risk limits, real-time alerts, emergency stops and continuous human oversight. A broker API sits underneath that layer. It carries orders, it does not decide whether an order should exist.
IMRYN does not rank brokers or promise results. Execution events and model decisions are recorded so they can be inspected. This is not investment advice, and trading involves risk, including loss of capital.
Frequently asked questions
Is Alpaca or Interactive Brokers better for algorithmic trading?
Alpaca is usually the faster start for US stocks, ETFs, options and crypto, with a free paper account anyone can open. Interactive Brokers fits strategies that need global markets or products such as futures and currencies, at the price of running TWS, IB Gateway or Client Portal Gateway, or qualifying for OAuth.
Does the Interactive Brokers API need TWS or IB Gateway running?
The TWS API does, because it connects over a TCP socket to Trader Workstation or IB Gateway. The Web API does not use TWS, but individual accounts authenticate through Client Portal Gateway on the same machine that makes the calls. OAuth is reserved for third-party developers and for advisor, broker and institutional account types.
Can I paper trade without funding an account?
With Alpaca, yes: anyone globally can open a paper-only account with an email address. With Interactive Brokers, the paper account is opened from Account Management once your regular account is approved and funded.
What are the API rate limits?
IBKR Web API: 10 requests per second per session, tighter limits on some endpoints, and HTTP 429 when exceeded. TWS API: market data lines divided by 2 per second, so 50 with the default 100 lines. Alpaca market data: 200 historical calls per minute on Basic and 10,000 on Algo Trader Plus.
Is real-time market data included?
Not in full on either. Alpaca’s free Basic plan covers IEX only for real-time equities, and full US coverage comes with Algo Trader Plus at $99 a month. IBKR requires a paid subscription for API market data other than delayed watchlist data.
Sources and further reading
These resources provide the wider reference frame. Product statements on this page are limited to the public information provided by IMRYN.
- Alpaca: Trading API overview
- Alpaca: getting started and X-Request-ID
- Alpaca: paper trading and simulation limits
- Alpaca: market data plans and API calls
- Alpaca: orders and extended hours
- Alpaca: options trading
- IBKR: Web API introduction
- IBKR: Web API authentication by account type
- IBKR: Client Portal Gateway limitations
- IBKR: using a paper account with the Web API
- IBKR: Web API pacing limitations
- IBKR: TWS API introduction
- IBKR: TWS API requirements
- IBKR: TWS API limitations, paper trading and Canada
- IBKR: TWS API pacing limitations
- IBKR: live data limitations
- IBKR: requesting market data
- IBKR: daily and weekly reauthentication
- IBKR: products, exchanges and contracts
- IMRYN: execution with explicit control
- Alpaca API documentation
- Interactive Brokers API