> 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 WebSocket connection (quote market channels share one connection; see below). At most 10 symbols across all connections |
| 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

* All frames on one connection (subscribe, unsubscribe, heartbeat) are limited to **60 per minute**.
* Exceeding the limit disconnects the socket.

#### Total subscription capacity

The plan cap is the number of symbols you may subscribe to. 100 subscriptions = 100 symbols.

Standard and custom plans can subscribe across asset classes. 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 markets count as one connection

These `/ws?business=...` channels together usually count as **one** plan connection:

* 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` is not covered by “several markets = one connection”.**

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.
