獲取關注分組
獲取關注分組
SDK Links
Python  | longport.openapi.QuoteContext.watchlist | 
Rust  | longport::quote::QuoteContext#watchlist | 
Go  | QuoteContext.Watchlist | 
Node.js  | QuoteContext#watchlist | 
Request 
| HTTP Method | GET | 
| HTTP URL | /v1/watchlist/groups | 
Request Example 
python
from longport.openapi import QuoteContext, Config
config = Config.from_env()
ctx = QuoteContext(config)
resp = ctx.watchlist()
print(resp)Response 
Response Headers 
- Content-Type: application/json
 
Response Example 
json
{
  "code": 0,
  "data": {
    "groups": [
      {
        "id": 28020,
        "name": "all",
        "securities": [
          {
            "symbol": "700.HK",
            "market": "HK",
            "name": "騰訊控股",
            "watched_price": "364.4",
            "watched_at": 1652855022
          }
        ]
      }
    ]
  }
}Response Status 
| Status | Description | Schema | 
|---|---|---|
| 200 | 返回成功 | groups_response | 
| 500 | 內部錯誤 | None | 
Schemas 
groups_response 
| Name | Type | Required | Description | 
|---|---|---|---|
| groups | object[] | false | 分組 | 
| ∟ id | integer | true | 分組 ID | 
| ∟ name | string | true | 名稱 | 
| ∟ securities | object[] | true | 股票 | 
| ∟∟ symbol | string | true | 代碼 | 
| ∟∟ market | string | true | 市場 | 
| ∟∟ name | string | true | 名稱 | 
| ∟∟ watched_price | string | true | 關注時的價格 | 
| ∟∟ watched_at | integer | true | 關注時間 |