Rate Limiting
The TradeStation API Rate Limits on the number of requests a given user &
client can make to the API in order to ensure fairness between users and
prevent abuse to our network. Each API Key is allocated quota settings upon
creation. These settings are applied on a per-user basis. If the quota is
exceeded, an HTTP response of 429 Too Many Requests
will be
returned. Quotas are reset on a 5-minute interval based on when the user
issued the first request.
We recommend using streaming services if available.
Resource Categories
The rate limit applies to the following resource-categories:
Resource-Category | Quota | Interval |
---|---|---|
Accounts | 250 | 5-minute |
Order Details | 250 | 5-minute |
Balances | 250 | 5-minute |
Positions | 250 | 5-minute |
Quote Change Stream | 500 | 5-minute |
Barchart Stream | 500 | 5-minute |
TickBar Stream | 500 | 5-minute |
Each Option Endpoint | 90 | 1-minute |
Quote Snapshot | 30 | 1-minute |
MarketDepth Stream* | 30 | 1-minute |
MarketDepth Stream* | 10 | concurrent |
Option Quote Stream | 10 | concurrent |
Option Chain Stream | 10 | concurrent |
Order Stream | 40 | concurrent |
Order Stream by Order Id | 40 | concurrent |
Positions Stream | 40 | concurrent |
*The MarketDepth rate limit is a combined amount that applies to Quotes and Aggregate streams.
Intervals
Quotas have "Windows" that last for a limited time interval
(generally 5-minutes). Once the user has exceeded the maximum request count,
all future requests will fail with a 429
error until the interval expires.
Rate Limit intervals do not slide based upon the number of requests, they are
fixed at a point in time starting from the very first request for that
category of resource. After the interval expires, the cycle will
start over at zero and the user can make more requests.
Example A
A user logs into the TradeStation WebAPI with their application and issues a
request to /v3/brokerage/accounts
. As a result, the request
quota is incremented by one for the Accounts
resource-category. The user
then issues 250 more requests immediately to /v3/brokerage/accounts
.
The last request fails with 429 Too Many Requests
. All subsequent requests
continue to fail until the 5-minute interval expires from the time of the
very first request.
Example B
A user logs into the TradeStation WebAPI with their application and issues a
request to /v3/brokerage/accounts/123456782/positions
. As a result, the
request quota is incremented by one for the Positions
resource-category. The user then immediately issues the same request 250 more
times. The last request fails with 429 Too Many Requests
. All
subsequent requests continue to fail until the 5-minute interval expires
from the time of the first request.
Example Throttled Request
GET https://api.tradestation.com/v3/brokerage/accounts/123456782/positions HTTP/1.1
Host: api.tradestation.com
Authorization: bearer eE45VkdQSnlBcmI0Q2RqTi82SFdMSVE0SXMyOFo5Z3dzVzdzdk
Accept: application/json
Example Failed Response
HTTP/1.1 429 Too Many Requests
Content-Length: 55
Date: Thu, 04 Feb 2021 21:18:07 GMT
{"Error":"TooManyRequests","Message":"Rate quota exceeded"}