API Rate Limits

How many API requests you can send, at the user and account level, and how to stay within the limits.

ReferenceAutomated trading429 errors
In short

Every API action (placing an order, reading the orderbook, reading positions, and so on) counts as one request. We limit requests per user and per pseudo account. Each pseudo account has two separate allowances: one for orders and API reads, and one for portfolio reads by the AmiBroker, MetaTrader and Excel libraries. Cross any limit and you get a 429 Too Many Requests error. A breach usually means your code sends more requests than it needs.

API stands for Application Programming Interface. In simple words, every action you do (placing an order, reading the orderbook or positionbook, and so on) creates one request per account. Each request talks to your stock broker’s server to place an order, read portfolio data, and similar tasks. Too many requests in a short time can affect a server’s performance. So both we and your brokers set limits on how many requests can be sent.

These API limits apply to API users doing automated trading. The website has its own, separate limits (see Manual trading below). If a manual trader hits a limit, they should report it to support.

Why rate limits exist

There are two main reasons for rate limits:

  • Bad code written by a user that calls API functions continuously in a loop
  • A malicious user trying a DOS attack

As an API user, you need to understand that this is the most important feature for you as well. An API breach is almost always caused by a bug in the user’s strategy code. API limits help you safeguard yourself. We have seen users suffer heavy losses because their rogue code kept firing orders, when they used APIs that do not have such limits.

Admin

Limits

If your system crosses any of the limits below, you will receive a server error: 429 Too Many Requests.

User level

This applies at the user level, so requests for all your accounts are counted together.

LimitTime interval
750 requestsper 5 seconds
3000 requestsper 1 minute

Pseudo / trading account level

This applies to one pseudo/trading account at a time. Each pseudo account has two separate allowances:

  • Orders and API reads. Placing, modifying and cancelling orders, square-offs, and portfolio reads through the API (for example our Python, Java and C# libraries, and the Desktop Client).
  • Library portfolio reads. Orders, positions, margins and holdings read by the AmiBroker (version 2), MetaTrader and Excel libraries, which talk to AutoTrader Web directly.

Because the two are separate, heavy portfolio reads by a library can never use up the allowance your orders need. Orders placed from a library count under orders.

Each allowance has these limits:

LimitTime interval
75 requestsper 5 seconds
150 requestsper 1 minute
300 requestsper 5 minutes

The 5-minute limit is the one to plan for. It works out to about 1 request per second on average, for each allowance.

How limits are calculated

Every API request made to the AutoTrader Server counts as 1 unit, even when it is answered from a recent copy of your data. The common requests are:

  • Place Order
  • Modify Order
  • Cancel Order
  • Read Positions
  • Read Orders
  • Read Margins
  • Read Holdings

Charting and spreadsheet libraries

The AmiBroker, MetaTrader and Excel libraries read your portfolio only when your strategy asks for a value, and they keep a short-lived copy of what they read. So a strategy that reads twenty different fields on one bar makes one request per dataset, not twenty. In the same way, checking the status of 60 orders costs one request, not 60.

How long that copy is re-used is set in the library’s own settings file. By default, orders are refreshed every 2 seconds, positions every 5 seconds, margins every 30 seconds, and holdings every 5 minutes. At these settings one library uses at most about three quarters of its allowance.

On AmiBroker, all charts on one account share one copy. On MetaTrader each chart that runs the library keeps its own copy, and in Excel each workbook does. So two strategies on one account there make twice the requests.

The AmiBroker library also writes down every request it makes, so you do not have to guess where your requests are going. It keeps one file per day in the Logs folder of your AmiBroker folder, and each line says which chart, which symbol, which account and what was asked for. Count the lines that say NETWORK and you have your request count.

Guidelines for staying within API limits

Manual trading (website users)

The limits on this page are for the API. The AutoTrader Web website has its own limits, separate from these and set well above normal use.

If the website ever shows a 429 Too Many Requests error, the usual cause is a screen that keeps refreshing on its own, or many tabs of the website open at once. Close the extra tabs and wait a minute. If it keeps happening, contact support.

Automated trading (API users)

The limits are set to a reasonable value. If your code is breaking them, check that it is not doing something wrong or redundant.

  • Keep only those pseudo accounts live that your strategy actually uses.
  • If you are using the AmiBroker, MetaTrader or Excel library:
    • Leave the refresh settings alone unless you have a reason. Lowering them does not get you fresher data. Your data is refreshed from the broker about once a second at most, so a lower setting only adds requests.
    • Raise them if you trade slowly and want less traffic.
    • For a live price, use your platform’s own price feed instead of reading positions often. It is faster and costs no requests.
    • Close charts you are not using. On MetaTrader and Excel each chart or workbook reads for itself.
    • If you have moved to version 2 of the AmiBroker library, close the Desktop Client. Its reads count against the allowance your orders use.
    • On AmiBroker, open the library’s own request log before changing anything. It tells you which chart, which symbol and which call are causing the requests, so you fix the right thing. See Find out how many requests you make.
  • If you write your own code:
    • Read the whole order book once and look up each order in it. There is no request that returns just one order, so reading the order book once per order uses up the limit very quickly.
    • Cache the portfolio in your strategy and refresh it periodically, or only when needed.
    • If your strategy creates many orders in a short time, add some delay in your code to avoid hitting the limits.

Breach of limit

A breach is a serious issue. It puts load on our servers and affects other clients. Worse, if a broker’s RMS (Risk Management System) has bugs, a breach could send too many orders to the exchange, which in rare cases can cause far bigger problems. The load from one user’s badly written code can affect all of our clients if we do not keep API rate limits in place.

Whenever a breach happens, the extra requests are rejected with a 429 Too Many Requests error and we send you an email about it. Your user account stays active, so you can keep trading. The user is expected to explain the cause and the fixes to avoid hitting API limits again. If a user keeps breaching the limits or fails to cooperate with the support team, their access will be permanently revoked.

Admin

Note: If we ever have to disable your AutoTrader Web user, it does not mean you cannot trade. You can always log in to your stock broker’s trading terminal and operate your trading account.

API limits protect stock exchanges and their systems, stock brokers and their systems, our own systems, and all market participants (traders and investors). So we have a zero-tolerance policy for users who fail to cooperate when a breach happens.

Industry standards

API rate limits are a standard practice in the industry, though not every user is aware of it. Most major brokers and trading platforms publish similar order and request rate limits in their own API documentation.

Frequently asked questions

What happens if I breach the API rate limits?▾

The extra requests are rejected with a `429 Too Many Requests` error, and we send you an email so you know it happened. Your user account stays active and you can keep trading. You are expected to find the cause in your code and fix it. If breaches keep happening, or you do not cooperate with support, your access can be revoked.

Will my user be disabled if I hit the API limits?▾

No. Hitting a limit only rejects the extra requests for a short time; it does not disable your user. If your user is ever disabled, it is a separate action and support will tell you why.

API Key is wrong or user disabled →

Can portfolio reads by my AmiBroker, MetaTrader or Excel library block my orders?▾

No. Portfolio reads by these libraries have their own allowance for each pseudo account, separate from the one your orders use. Reading a lot can never use up what your orders need. Portfolio reads through the API (our Python, Java and C# libraries, or the Desktop Client) share the allowance with your orders.

How do I check the status of many orders without breaching the limits?▾

Read the whole order book once, then look up each order in it. Do not send one request per order. In the AmiBroker, MetaTrader and Excel libraries, getOrderStatus already works this way: every call within the refresh time is answered from one read, so checking 60 orders costs one request.

Next steps

Was this page helpful?

Last updated 22 September 2026