Guide
PlatformStocksETFsOptions No key needed

TD Ameritrade API guide

TD Ameritrade had one of the most-used retail APIs. After the Schwab merger it is gone, but the migration path is clear.

Last verified · Also known as TD Ameritrade API, TDA API, tda-api

Quick answer

The TD Ameritrade API was shut down in 2024 when accounts moved to Charles Schwab. Its replacement is the Schwab Trader API (developer.schwab.com), which keeps a similar shape: OAuth 2.0, price history, quotes, option chains and orders. Libraries such as tda-api were superseded by schwab-py.

TD Ameritrade API at a glance

Pricing
Discontinued (2024)
Availability
Discontinued (accounts moved to Schwab)
Paper trading
Not applicable (data only)
Integration type
No public API
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Status
Retired (2024)
Replacement
Schwab Trader API
Python
tda-api → schwab-py

Build a TD Ameritrade strategy with AlgoGP

AlgoGP does not connect to TD Ameritrade natively yet. TD Ameritrade has no supported public trading or data API.

  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 TD Ameritrade

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

Built-in data sources for the same markets: Alpaca, Yahoo Finance, Alpha Vantage, Tradier.

TD Ameritrade API: frequently asked questions

Does the TD Ameritrade API still work?

No. Register an app on developer.schwab.com instead.

Is the Schwab API the same as TD Ameritrade’s?

Similar endpoints and OAuth flow, but new hosts, new app keys and seven-day refresh tokens.

Automate the strategy you would run on TD Ameritrade

Describe your rules, backtest them on years of stock, crypto or forex data, and export Python for a broker that has a real API.

  • No API key needed to start
  • Built-in Alpaca, Tradier, OANDA, Binance and more
  • Free plan, no card

Free plan, no card required.

TD Ameritrade alternatives

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

Build a strategy