> For the complete documentation index, see [llms.txt](https://docs.infoway.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.infoway.io/en-docs/getting-started/api-limitation/websocket-limitation.md).

# WebSocket Limitation

HTTP rate limits: [REST API Limitation](/en-docs/getting-started/api-limitation/rest-api-limitation.md). Error codes: [WebSocket Error Codes](/en-docs/getting-started/error-codes/websocket-error-codes.md). Heartbeat: [Heartbeat](/en-docs/websocket/heartbeat.md). Addresses: [Endpoints](/en-docs/getting-started/endpoints.md).

#### Connection limits

| Plan        | Limits                                                                                                                   |
| ----------- | ------------------------------------------------------------------------------------------------------------------------ |
| Free        | 1 connection allowance (see market channels below). At most 10 symbols in total, subject to Free-plan symbol permissions |
| Basic       | 1 connection. At most 200 symbols in total                                                                               |
| Premium     | 2 connections. 600 unique symbols per connection; 800 in total                                                           |
| Pro         | 9 connections. 600 unique symbols per connection; 5,000 in total                                                         |
| Market plan | Connections = ceil(market symbol count / 600); 600 symbols per connection                                                |
| Custom      | HTTP rate and symbol cap are configurable. Connection math matches the market plan                                       |

#### Request-rate limit

* Business text frames on one connection (subscribe, unsubscribe, application heartbeat) are limited to **60 per calendar minute**. Protocol Ping/Pong frames do not count toward this text-frame budget. Connection initialization also consumes one count in its opening minute.
* Exceeding the limit disconnects the socket.

#### Total subscription capacity

The plan cap limits subscribed products. On one connection, the same symbol counts once across trade, depth, and multiple candlestick intervals. Subscribing that symbol on another connection consumes capacity again. A per-connection excess returns `505`; a total excess across connections returns `516`.

The Free plan also restricts which symbols may be subscribed. Staying below the count limit does not grant access to every symbol; use the scope available to your account. If a request contains a symbol without permission, the entire subscription request is rejected with a `521` error prefixed by `Subscribe fail:` . Adjust the symbols or plan before retrying.

Standard paid and custom plans can subscribe across asset classes within their entitlements. Equity-only plans can subscribe only to the selected market (for example an All A-shares plan can subscribe A-shares only).

#### How connections are allocated

The system allocates enough connections for the plan cap. Each connection holds up to 600 subscriptions.

Examples:

* 200 subscriptions → 1 connection
* 800 subscriptions → 2 connections
* 5,000 subscriptions → 9 connections

You may split symbols across connections as long as no connection exceeds 600 and the plan total is respected.

#### Multiple quote market channels

Open a separate WebSocket connection for each `business` below and send subscriptions to the matching market. Connection allowances and total subscription capacity both apply; multiple market connections are separate physical sockets:

* Equities: `wss://data.infoway.io/ws?business=stock`
* Crypto: `wss://data.infoway.io/ws?business=crypto`
* Forex and commodity futures: `wss://data.infoway.io/ws?business=common`
* Japan: `wss://data.infoway.io/ws?business=japan`
* India: `wss://data.infoway.io/ws?business=india`
* Korea: `wss://data.infoway.io/ws?business=korea`
* Taiwan: `wss://data.infoway.io/ws?business=taiwan`

Pass `apikey` on the query string.

#### News is a separate connection

```
wss://data.infoway.io/news?apikey=<your-api-key>
```

News needs its own entitlement. Without it the handshake is HTTP 401. One key typically keeps one news socket. **News entitlement and connection limits are separate from the market-data channels above.**

Protocols: subscribe `10020` → ack `10021` → push `10022`; unsubscribe `11020`.

#### After connect

`business=stock` may send a plaintext greeting, then:

```json
{"code":200,"msg":"ws connect success"}
```

`code=200` means the socket is up. It is not an error.

#### Wrong `business`

`10001` / `10004` / `10007` `ok` only means the frame was accepted. A market mismatch can ack and then push nothing.
