# Rate Limits

## [REST API Rate Limits](https://docs.sfox.com/rest-api/rate-limits)

The REST API rate limits requests by IP address **AND**, in some cases, by route.

* **IP Address:** 250 requests per 10 seconds.&#x20;
  * If you exceed this, a `429` error is thrown and you have to wait 60 seconds before resuming.
* **Route-specific limits:** Routes with unique rate limits are specified in the route details within this documentation. e.g. [Get All Done Orders](https://docs.sfox.com/rest-api/orders/get-all-done-orders).
  * If the route details do NOT specify a rate limit then the route does not have a specific rate limit.
  * If you exceed this, a `429` error is thrown and you have to wait 10 seconds before resuming **requests to this specific route.**

{% hint style="info" %}
sFOX recommends using the [**WebSocket API**](https://docs.sfox.com/websocket-api) for retrieving data as much as possible as this will not count towards the request limit.

**Note:** sFOX typically enforces route-specific rate limits on routes that return data that is available via the [**WebSocket API**](https://docs.sfox.com/websocket-api) e.g. account balances.
{% endhint %}

## [WebSocket API Rate Limits](https://docs.sfox.com/websocket-api/rate-limits)

The WebSocket API rate limits requests and connections by IP address. If you exceed a rate limit, an error is thrown and your requests will be blocked for 2 minutes. Rate limits for the WebSocket API are as follows:

<table><thead><tr><th width="147">Type</th><th>Limit</th></tr></thead><tbody><tr><td><strong>Connections</strong></td><td><strong>10 active connections</strong> per IP address.</td></tr><tr><td><strong>Requests</strong></td><td><strong>40 requests per 1 minute</strong> per IP address. Requests are counted, in total, across your active connections.</td></tr></tbody></table>
