Guide
BrokerMarket dataStocksETFsOptions API key

Questrade API guide

Questrade is the go-to Canadian discount broker, and its API is the main official route into a Canadian brokerage account.

Last verified · Also known as Questrade API, Questrade App Hub

Quick answer

Questrade’s REST API gives Canadian investors accounts, positions, balances, quotes, candles and option chains for Canadian and US listings. You generate a manual refresh token in the App Hub; each refresh returns a new access token, a new refresh token and the API server to call. Order placement is restricted to approved partner apps, so personal scripts are mostly read-only.

Questrade API at a glance

Pricing
API free; order placement limited to partner apps
Availability
Canadian residents
Paper trading
Practice account
Integration type
OAuth login
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Auth
OAuth2; manual refresh token from the App Hub
Rotation
Each refresh invalidates the old refresh token
Orders
Partner apps only; personal apps read data
Practice
Practice account via practicelogin.questrade.com

Handling rotating refresh tokens

Call https://login.questrade.com/oauth2/token?grant_type=refresh_token&refresh_token=…. The response includes access_token, a new refresh_token and api_server. Persist the new refresh token immediately, or the next run fails and you must generate one again in the App Hub.

Build a Questrade strategy with AlgoGP

AlgoGP does not connect to Questrade natively yet. Questrade authenticates with a browser OAuth login and refreshable tokens, so it needs a one-time manual login step that generated code cannot do on its own.

  1. 1

    Design and backtest in AlgoGP

    Describe the strategy to the copilot and backtest it on years of normalized history. The result does not depend on any vendor.

  2. 2

    Export the Python project

    Every project exports strategy.py, market_data.py, brokers.py and live.py. The strategy only sees bars, cash, positions and orders, never a vendor’s wire format.

  3. 3

    Plug in Questrade

    Implement the four adapter methods (account, positions, submit_market_order and a candle fetcher) with Questrade’s SDK, or keep a built-in platform for paper trading and add Questrade when you go live.

Built-in brokers for the same markets: Alpaca, Tradier, Interactive Brokers, OKX.

Questrade API: frequently asked questions

Can I place trades with the Questrade API?

Order entry is limited to Questrade-approved partners; individual apps get account and market data.

For automated trading in Canada, what should I use?

Interactive Brokers Canada offers full order entry through its APIs.

Design and backtest your Questrade strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to Questrade. The exported code keeps the broker behind four small adapter methods.

  • AI copilot writes and revises the rules
  • Backtests with realistic costs
  • Exported Python ready to wire to Questrade

Free plan, no card required.

Questrade alternatives

Independent guide. AlgoGP is not affiliated with Questrade. Limits, prices and availability change; confirm them in the official documentation. Nothing here is investment advice.

Build a strategy