The short answer
- Alpaca is the quickest route for a coded US stock, ETF, options or crypto bot: an API-first broker with REST and streaming APIs and free paper trading on the same API.
- Interactive Brokers (IBKR) is the route when you need futures, forex, more order types or markets outside the US. It is the most capable of the three and the most work to run reliably.
- Charles Schwab makes sense when your account and history are already at Schwab. Its Trader API replaced the old TD Ameritrade API; access needs an approved app and a fresh browser login every 7 days.
Whichever you choose, the bot only automates the strategy you define. No broker API makes a strategy profitable, and trading stocks and options carries a real risk of loss.
Side-by-side comparison
| Alpaca | Interactive Brokers | Schwab | |
|---|---|---|---|
| APIs | Trading API (REST) and market data API (REST and WebSocket) | TWS API (socket API through Trader Workstation or IB Gateway) and the Client Portal Web API (REST) | Schwab Trader API: Accounts and Trading, and Market Data (REST plus streaming) |
| Markets | US stocks and ETFs, options, crypto | Stocks, options, futures, forex and bonds in many countries | US stocks, ETFs and options |
| Getting access | Sign up and create API keys in minutes | Open an IBKR account, enable API access, run TWS or IB Gateway on a server | Register on the Schwab Developer Portal, create an app and wait for approval (usually days) |
| Authentication | API key and secret | Logged-in TWS or IB Gateway session; the gateway restarts daily, so the bot must reconnect | OAuth: access token about 30 minutes, refresh token 7 days, then a browser login |
| Paper trading | Free paper accounts on the same API | Paper account for account holders, same API | No API paper account we rely on; we use our own simulator and small live orders |
| Market data | Free Basic plan (IEX real-time, 30 streaming symbols); Algo Trader Plus $99/month for all US exchanges | Paid per-exchange subscriptions for most real-time data | Included for Schwab account holders through the Market Data API |
| Libraries we use | alpaca-py, or plain REST from Node.js | ib_async (formerly ib_insync) or the official ibapi in Python; Java or C# clients | schwab-py, or plain REST |
| Who can open an account | Clients from many countries; check eligibility | Clients in most countries | Designed for US residents |
| Main headache | Free data is IEX only, which can differ from the consolidated price | Gateway hosting, daily restarts, contract details and data permissions | Weekly re-login and app approval |
Market data figures are from Alpaca's documentation as of November 2026; Schwab token lifetimes are as widely documented by developers using the Trader API. Broker APIs, prices and eligibility change often, so we re-check the current terms with you before writing code.
How the choice usually goes
- Futures, forex or non-US?You need markets beyond US stocks and options: Interactive Brokers
- Account already at Schwab?You want to keep it there and accept the weekly login: Schwab
- New US stock bot?You want the fastest path from paper to live: Alpaca
- Same strategy on several?Run one strategy core with a small adapter per broker: custom multi-broker bot
We write the strategy and risk engine once and put each broker behind a thin adapter, so moving broker later is a few days of work, not a rewrite.
Testing a bot on each broker
Every bot we build goes through the same stages: a backtest on historical data with fees and realistic fills, then paper trading, then small live size, then full size. The broker changes how stage two works:
- Alpaca: the paper account uses the same endpoints as live, with separate keys. Switching to live is a configuration change, which also means it is easy to do by mistake, so we add a clear live-mode switch and a startup warning.
- Interactive Brokers: the paper account runs on its own login through TWS or IB Gateway. Paper accounts can use the market data subscriptions of the live account, but some order types and fills behave differently from live.
- Schwab: because we do not rely on an API paper account, the bot gets a dry-run mode that logs the orders it would send, and the first live week runs at the smallest size your strategy allows.
The 2026 day-trading rule change and your bot
Until this year, US margin accounts under $25,000 were limited to three day trades in five business days, and many bots had that count built in. The SEC approved FINRA's amendments to Rule 4210 on 14 April 2026, effective 4 June 2026. The pattern day trader designation, the four-trades-in-five-days test and the $25,000 minimum are replaced by intraday margin buying power that each broker calculates from your positions. Brokers have until 20 October 2027 to implement it, and they may check in real time or once at the end of the day.
For a bot this means two things. First, do not hard-code the old count or the new rules: read buying power and account status from the broker's API before each order and stop if they say no. Second, check what your own broker applies today, because during the changeover different brokers may still be on different rules. This is general information, not legal or financial advice.
Cost: planning ranges at $50/hour
| Project | Typical hours | Typical cost |
|---|---|---|
| Rule-based bot on Alpaca paper trading, one strategy, alerts | 30–60 h | $1,500–$3,000 |
| TradingView alert or signal bot to Alpaca or Interactive Brokers, with risk limits | 40–80 h | $2,000–$4,000 |
| Schwab Trader API bot with token handling, weekly re-login reminder and dry-run mode | 50–100 h | $2,500–$5,000 |
| Interactive Brokers bot with hosted IB Gateway, reconnection and contract handling | 60–120 h | $3,000–$6,000 |
| Moving an existing bot from one broker to another | 20–60 h | $1,000–$3,000 |
| Multi-broker bot with backtesting and a dashboard | 120–250 h | $6,000–$12,500 |
Building on IBKR? See hire an Interactive Brokers API developer for gateway, pacing and order-state details.
Running costs are usually a small cloud server ($5 to $40 per month) plus market data: $0 or $99 per month on Alpaca, and per-exchange subscriptions on Interactive Brokers. For your own mix of features, use the bot cost calculator or see our trading bot development service.
What we avoid
- Unofficial libraries that log in to a broker's website or app as you. They break without warning and may break your broker's terms; we build on official APIs only.
- Storing your broker password. We use API keys or OAuth tokens kept on your own server or cloud account.
- Bots without a hard risk engine. Every order passes position caps, a daily loss limit and a kill switch, whatever the broker.
Risks that apply to all three
- A good backtest is not a forecast. Fees, slippage, outages and changing markets all show up live; paper trade first.
- Broker outages and API changes happen. The bot needs alerts, safe restarts and a way for you to close positions by hand.
- You are responsible for following your broker's terms and the laws where you live, including tax.
Questions clients ask
Which broker API is best for a stock trading bot?
There is no single best one. Alpaca is the easiest start for US stocks, options and crypto with free paper trading. Interactive Brokers suits bots that need futures, forex or markets outside the US. Schwab suits traders who already hold their account there and want to keep it. We usually pick the broker your money is already with unless its API cannot do what the strategy needs.
Can I paper trade my bot before using real money?
On Alpaca, yes: paper accounts use the same API as live accounts. Interactive Brokers gives account holders a paper account that works with the TWS API and IB Gateway. For Schwab we do not rely on an API paper account, so we test with our own simulator and then with very small live orders. On every broker, paper fills are kinder than real fills, so judge results with that in mind.
Is the $25,000 pattern day trader rule still a limit for my bot?
The SEC approved FINRA's change to Rule 4210 on 14 April 2026, effective 4 June 2026. It removes the $25,000 pattern day trader minimum and the day-trade count and replaces them with intraday margin buying power set by each broker. Brokers have until 20 October 2027 to switch over, so check what your own broker applies today. We build the bot to read buying power from the API instead of hard-coding a rule.
Can I use these broker APIs from outside the US?
Interactive Brokers accepts clients in most countries. Alpaca accepts clients from many countries; check its current list for yours. Schwab's brokerage is designed for US residents. Whether you may trade a market also depends on the laws where you live, which you need to confirm.
Do I need to pay for market data?
Often, yes, for serious use. Alpaca's free Basic plan gives real-time IEX data and 30 streaming symbols; Algo Trader Plus at $99 per month adds all US exchanges and unlimited streaming symbols (Alpaca docs, November 2026). Interactive Brokers charges per exchange subscription for most real-time feeds. Budget this along with a $5 to $40 per month server.
Why does a Schwab bot need a fresh login every week?
Schwab's Trader API uses OAuth: the access token lasts about 30 minutes and is refreshed automatically, but the refresh token expires after 7 days, after which someone must log in through a browser again. We build a reminder and a safe pause into the bot so it never trades on an expired session.