Guide
BrokerMarket dataStocksETFsOptionsFutures API key

TradeStation API guide

TradeStation is a US broker known for its desktop platform and EasyLanguage, and its v3 Web API exposes the same accounts to code. It is one of few retail APIs covering stocks, options and futures with a simulated environment, at the cost of OAuth and a manual key request.

Last verified

Quick answer

The TradeStation v3 API is a REST and streaming API for US stocks, options and futures, with OAuth 2.0 authentication (20-minute access tokens, refresh tokens via offline_access) and a simulated account. Documented limits include 500 bar/quote requests per 5 minutes and up to 57,600 intraday bars per request.

TradeStation API at a glance

Pricing
API free; funded account needed for a key
Availability
US residents and some international clients
Paper trading
Simulated (SIM) trading account
Integration type
OAuth login
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Base URL
https://api.tradestation.com/v3 (SIM: https://sim-api.tradestation.com/v3)
Auth
OAuth 2.0; access tokens last 20 minutes
Markets
US stocks, ETFs, options, futures
Bars
Up to 57,600 intraday bars per request
Limits
Accounts/orders 320 per 5 min; bars/quotes 500 per 5 min

What the v3 API covers

AreaExamples
BrokerageAccounts, balances, positions, orders, executions
Order executionMarket, limit, stop, OCO/bracket order groups
Market dataQuotes, bar charts, tick bars, option chains, market depth
StreamingHTTP chunked streams for quotes, bars and orders

Rate limits

  • Accounts, orders, balances and positions: 320 requests per 5 minutes.
  • Quotes, bar charts and tick bars: 500 requests per 5 minutes.
  • Option endpoints: 90 per minute; market depth: 30 per minute.

Exceeding a limit returns 429; quotas are per user per resource category.

OAuth and keeping a bot logged in

TradeStation uses the OAuth 2.0 authorization-code flow. Request the offline_access scope to receive a refresh token; access tokens last 20 minutes and are refreshed in the background. Refresh tokens do not expire by default unless rotation is configured for your key.

Build a TradeStation strategy with AlgoGP

AlgoGP does not connect to TradeStation natively yet. TradeStation 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 TradeStation

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

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

TradeStation API: frequently asked questions

How do I get a TradeStation API key?

With a funded TradeStation account, request a WebAPI key from Client Experience; it comes as a client id and secret.

Does TradeStation have paper trading via API?

Yes. The SIM environment at sim-api.tradestation.com mirrors the live API with simulated accounts.

Can I trade futures through the TradeStation API?

Yes, futures and futures options are supported alongside stocks and equity options.

Is the TradeStation API free?

There is no separate API fee; account, commission and market-data costs apply.

Design and backtest your TradeStation strategy first

AlgoGP turns an idea into Python and tests it on years of history before you connect it to TradeStation. 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 TradeStation

Free plan, no card required.

TradeStation alternatives

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