GUIDES

Schwab API Setup Guide — Connect Charles Schwab for Automated Trading

Contents
Connect a Charles Schwab account to TraderWe for US equity market data and order routing. Schwab is the only connection here that uses a browser login, so the first setup takes a few extra minutes. After that it renews itself.

1. What you need

- A Schwab brokerage account. - A developer app at developer.schwab.com, approved for the Trader API. Approval is not instant — Schwab reviews new apps, so create it before the day you want to trade. - TraderWe installed on the PC that will trade.

2. Create the developer app

- Sign in at developer.schwab.com and create an app. - Ask for the Trader API (accounts and trading). Market data alone will not let you place orders. - Set a redirect URL. https://127.0.0.1 works and is the default TraderWe expects. - When the app is approved you get an App Key and an App Secret. The redirect URL has to match exactly on both sides. A trailing slash or http instead of https is enough to make the login fail with an unhelpful message.

3. Log in — the three-step flow

Settings → Exchange connections → Schwab. Fill the first three fields:
FieldWhat to put
App KeyFrom your developer app
App SecretFrom your developer app
Redirect URLExactly what you registered — https://127.0.0.1 by default
Then: 1. Press ① Schwab login (browser auth). Your browser opens Schwab's login page.

2. Sign in and approve the account you want to link.

3. Schwab redirects to your redirect URL. The page will look broken — that is expected, nothing is listening on 127.0.0.1. What matters is the address bar. 4. Copy the entire address from the address bar and paste it into ② Paste redirect URL.

5. Press Connect.

TraderWe exchanges that address for a token pair and confirms the account is reachable. The status line then tells you how many accounts it found. You only do this once. TraderWe refreshes the token in the background from then on. Schwab's refresh token does expire eventually, and when it does the badge tells you to re-authenticate, repeat steps 1 to 5.

4. What TraderWe does with your credentials

The App Secret and the tokens are encrypted on your own machine with Windows DPAPI, scoped to your user account. They are never sent to us and never returned to the screen. Reopening Settings shows blank fields, not your secret. The authorisation code in step 4 is single-use and short-lived. If you paste an old one you get an authentication error; just run step 1 again.

5. Orders

TraderWe routes four order types to Schwab:
TypeSent asNeeds
MarketMARKET
LimitLIMITlimit price
StopSTOPstop price
Stop limitSTOP_LIMITboth prices
Time in force maps to Schwab's duration: DAY, GTC, IOC and FOK. A value Schwab does not accept is refused with a message rather than quietly changed. Extended hours: Schwab controls this with the order's session rather than a flag. When a limit order goes out while the regular session is closed, TraderWe sends it as a seamless-session order so it can fill in pre-market or after-hours. Market orders are not sent outside the session — a market order in a thin book has no price control. One Schwab-specific thing worth knowing: orders are addressed to an account hash, not your account number. TraderWe looks the hash up for you on the first order and remembers it. If you re-authenticate, it looks it up again. If you have more than one Schwab account, TraderWe uses the first one the API returns. Check the account count on the status line before you arm live routing. Order routing stays locked until you arm it. Until then, strategies run in paper mode and fill inside TraderWe against live Schwab prices.

6. Market data and the universe scanner

Quotes arrive over Schwab's Streamer. You can stream up to 30 symbols at once on this connection. The universe scanner uses Schwab's movers endpoint, ranked either by turnover or by percent change depending on your setting. One limitation to plan around: movers returns only a few dozen names, not the whole market. If your strategy needs to consider hundreds of candidates, this connection will not feed it — IBKR or Alpaca with a SIP subscription will.

7. Check it worked

- The badge reads "OAuth authorized" with the number of accounts found. - Quotes tick during market hours. - The account list on the status line matches the account you meant to link.

8. Common problems

The login page loads but the redirect fails. The redirect URL in TraderWe does not match the one registered on the developer app. They must be character-for-character identical. "Authorization failed" right after pasting the address. The authorisation code was already used or has expired. Press ① again for a fresh login and paste the new address. Connected, but every order is rejected. Your developer app may be approved for market data only. Trading needs the Trader API scope on the app itself — check on developer.schwab.com. It worked for weeks and then asked me to log in again. The refresh token expired. This is normal on Schwab; repeat the login steps. Limitations - Schwab's app approval is a manual review on their side and can take days. That is outside TraderWe. - The movers scanner returns a small set of names, so broad universe strategies are a poor fit for this connection. - Fills of resting limit orders are learned by asking rather than being pushed, so a late fill can take a moment to appear. - This guide covers US equities. Options and futures are not routed by TraderWe today.

Related reading

← All guides

Originally published by TraderWe on July 16, 2026. You may quote and link to this page. Republishing the full text without a link back to the original is not permitted.

3 replies

GrandpaGrizzly· Jul 2026 ago
Learned this one the hard way back when every broker rolled their own login — the redirect string has to match character for character, and the error message will never tell you that's the problem. Wrote mine down on paper and pasted from there instead of retyping. Also glad the guide says to file for approval early; I've waited on broker paperwork long enough to know it never comes back the day you need it. Stay humble.
C
CoffeeAndCharts· Jul 2026 ago
Good heads up on the approval wait, I would have absolutely tried to set this up the night before and been annoyed. Question though - after the browser step, does the renewal happen quietly or do I need to have the PC awake at some point for it? Doing my setup this weekend with coffee in hand either way.
I
IndicatorSkeptic· Aug 2026 ago
post cuts off at "Schwab's refresh token does " — does what, exactly? that's the one line I actually wanted, since I vaguely recall the refresh token having a hard expiry that no amount of background renewing gets around. Anyway, love that step 3 is officially "the page will look broken, this is fine". Best broker UX of our time.
Sign in to reply →