tastytrade API Intro

New users should start by following the steps below. They will walk you through some of the key features of the tastytrade API such as logging in, submitting an order, viewing your positions, and closing a position.

For an overview of API rules and patterns, you can head to the API Overview page.

For an overview of some core tastytrade concepts, head to the High-level Concepts section of our Api Overview.

If you just want to see the docs, head to the API Docs page.

1. Create a Sandbox Account

You should start by creating an account in our sandbox environment using the Sandbox page. We have a whole working test environment that you will be able to build your application and test in prior to hooking up your production account.

2. Login to Your Sandbox Account

Every request you make needs an Authorization header with a valid session token. You can generate a session token by hitting our Create Session endoint.

Head to our Auth Patterns Overview more info about sessions and the Authorization header.

3. Submit a Trade

Submit a trade by hitting our Submit Order endpoint.

You can find detailed instructions about how to structure an order on our Order Submission page.

Our Sandbox environment has custom logic around order submission that makes it easy to simulate an order fill, partial fill, or a live order. Head to our Sandbox Page for more info.

4. Fetch Your Account Balance and Positions

Once your order fills, a new position will be created in your account. Your account balance will also be updated to reflect the cost of the order.

Hit our List Account Positions endpoint to fetch your account positions.

Hit our List Account Balances endpoint to view your account balance.

5. Stream Market Data

Our Streaming Market Data page has all the info you need to fetch quotes. The quotes will be delayed in our Sandbox environment. Production environment quotes are real-time.

6. Stream Account Updates

To get real time updates regarding your account, head to our Streaming Account Data page.

7. Close a Position

Closing a position is done by submitting an order in the opposite direction as the position. For example, if you are long 100 shares of AAPL, you can submit a Sell to Close order for 100 shares of AAPL. When this order fills, your position will be zeroed out.

For more information on closing and opening, head to our Leg Attributes section of the Order Submission page.

8. Fetch an Option Chain

If you want to see a full option chain for a ticker symbol, head to our List Nested Option Chains section. This will list every put and call symbol for every expiration that tastytrade supports for the given ticker symbol. It also includes the streamer-symbol, which is the symbol to use when subscribing to quote data from DxLink.

Running into issues or have questions?

Head to our FAQ page to see if your question can be answered there.

We also have a dedicated Service Desk ready to assist you. Please submit an email to api.support@tastytrade.com in order to create a ticket, and a member of our team will be in touch.