> ## Documentation Index
> Fetch the complete documentation index at: https://polymarketcn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WebSocket 認證

> WebSocket 連接認證方法

<Callout type="success">
  還沒有帳號？[點擊這裡註冊 Polymarket](https://polymarket.com/?r=2026VIP) 並完成入金，才能用錢包私鑰為訂單籤名、實際成交。
</Callout>

<Warning>
  **法律合規提醒**：在使用 Polymarket 服務或 API 前，請確認您所在地區的法律規定。Polymarket 目前不支援比利時、法國、新加坡、泰國、中國大陸等地區，政策可能隨時變化。
</Warning>

某些 WebSocket 頻道需要認證。

## 認證流程

1. 創建 API 憑據
2. 連接到 WebSocket
3. 發送認證消息
4. 訂閱頻道

## 認證示例

```python theme={null}
# Python
auth_msg = {
    "type": "auth",
    "api_key": "YOUR_API_KEY",
    "api_secret": "YOUR_API_SECRET",
    "api_passphrase": "YOUR_API_PASSPHRASE"
}
ws.send(json.dumps(auth_msg))
```

## 下一步

<CardGroup cols={2}>
  <Card title="用戶頻道" icon="user" href="/api-tutorial/websocket/user-channel">
    訂閱用戶頻道
  </Card>

  <Card title="市場頻道" icon="chart-line" href="/api-tutorial/websocket/market-channel">
    訂閱市場頻道
  </Card>
</CardGroup>
