Before you start
- A Tradier account (free signup; funding only for live trading)
- Access to dash.tradier.com
Create your Tradier API key
- 1
Sign up or log in
Create an account at tradier.com or log in to the dashboard at
dash.tradier.com. - 2
Open API settings
Click your name at the top right and choose API Access, or go directly to
dash.tradier.com/settings/api. - 3
Generate the sandbox token
Scroll to Sandbox Account Access and generate a token. Note the sandbox account number shown beside it.
- 4
Reveal and copy
Click the eye icon to reveal the token and the copy icon to copy it. Save it as
TRADIER_ACCESS_TOKENand the account number asTRADIER_ACCOUNT_ID. - 5
Production later
Once your brokerage account is open and funded, generate the production token in the same page and use your live account number.
Test the key
Before wiring the key into a strategy, make one request by hand. It separates “the key is wrong” from “my code is wrong”.
curl -s -H "Authorization: Bearer $TRADIER_ACCESS_TOKEN" \
-H "Accept: application/json" \
https://sandbox.tradier.com/v1/user/profileprofile object listing your account means the token works. Use api.tradier.com for a production token.Add the key to your AlgoGP project
- 1
Open your project’s APIs & keys tab
Open the strategy project, select APIs & keys, and under Platforms choose Tradier (Pro).
- 2
Paste each value
Paste the values into
TRADIER_ACCESS_TOKENandTRADIER_ACCOUNT_IDand click Save. Values are encrypted at rest, never shown again and never written into code or exports. - 3
Run locally with the same names
Exported projects read the same names from
.env(copy.env.example). Keep.envout of version control.
TRADIER_ACCESS_TOKEN=paste-your-value-here
TRADIER_ACCOUNT_ID=paste-your-value-hereTroubleshooting
401 Invalid Access Token- A sandbox token on the production host (or the reverse), or a regenerated token.
- XML instead of JSON
- Send
Accept: application/json. - Order rejected outside hours
- Equity market orders only fill in the regular session; use
duration=dayand run during market hours.
Frequently asked questions
Do Tradier access tokens expire?
Personal API tokens from the dashboard stay valid until regenerated. OAuth tokens issued to third-party apps expire and must be refreshed.
Can one token trade several accounts?
Yes, a production token covers the accounts under your login; the account number in the URL picks which one.
Build a Tradier trading bot in minutes
Describe the strategy in plain English, backtest it on years of data, then export Python that already talks to Tradier: paper, sandbox and live modes, keys handled for you.
- Generated adapter for Tradier orders and balances
- Backtests with costs, slippage and walk-forward checks
- Paper first; live trading only after you opt in
Free plan, no card required. Tradier is included with Pro.
AlgoGP is not affiliated with Tradier. Menus get renamed from time to time; if a label differs, the official documentation has the current path.