Guide
BrokerMarket dataStocksETFsOptionsFuturesCrypto API key

tastytrade API guide

tastytrade (formerly tastyworks) is built around options traders, and its API reflects it: multi-leg orders, futures options and a quote stream are all first-class.

Last verified · Also known as tastyworks, tastytrade API, tastyworks API

Quick answer

The tastytrade API is an official REST API with a DXLink WebSocket for streaming quotes, covering US stocks, ETFs, options, futures and crypto. Since the legacy session login was retired in February 2026 every program authenticates with OAuth2: create an OAuth application, make a personal grant to get a long-lived refresh token, and exchange it for 15-minute access tokens. A certification sandbox mirrors production.

tastytrade API at a glance

Pricing
API free with an account; commissions apply
Availability
US and selected international residents
Paper trading
Certification (sandbox) environment at api.cert.tastyworks.com
Integration type
OAuth login
In AlgoGP
Design and backtest in AlgoGP, connect the exported code
Auth
OAuth2 (refresh token → 15-minute access token)
Production
https://api.tastyworks.com
Sandbox
https://api.cert.tastyworks.com
Streaming
DXLink WebSocket (quote token from /api-quote-tokens)
Python
Community tastytrade package

Authentication after the session API was retired

The old POST /sessions username-and-password login was decommissioned on 11 February 2026. For your own account you skip the browser redirect: under Manage → My Profile → API → OAuth Applications create an application, then Create Grant to receive a refresh token that does not expire. Exchange it at /oauth/token with your client id and secret for an access token, and refresh roughly every 15 minutes.

import json, os, urllib.parse, urllib.request
body = urllib.parse.urlencode({
    "grant_type": "refresh_token",
    "refresh_token": os.environ["TASTYTRADE_REFRESH_TOKEN"],
    "client_id": os.environ["TASTYTRADE_CLIENT_ID"],
    "client_secret": os.environ["TASTYTRADE_CLIENT_SECRET"],
}).encode()
token = json.load(urllib.request.urlopen("https://api.tastyworks.com/oauth/token", body))
print(token["expires_in"], "seconds")
Refresh an access token with the standard library.

Orders and accounts

  • GET /customers/me/accounts lists account numbers; balances and positions hang off /accounts/{number}.
  • POST /accounts/{number}/orders/dry-run validates an order and returns buying-power effect and fees without sending it.
  • Orders carry legs, so a vertical spread or iron condor is one request with an overall net price.

Build a tastytrade strategy with AlgoGP

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

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

Built-in brokers for the same markets: Alpaca, Binance, Kraken, Bybit.

tastytrade API: frequently asked questions

Is the tastytrade API free?

Yes, with a funded account. Normal commissions apply to orders.

Does the tastytrade session login still work?

No. It was retired in February 2026; use OAuth2 refresh tokens.

Does tastytrade have a paper trading API?

The certification environment (api.cert.tastyworks.com) is a separate sandbox with its own login for testing integrations.

Design and backtest your tastytrade strategy first

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

Free plan, no card required.

tastytrade alternatives

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

Build a strategy