跳轉到內容

獲取關注分組

獲取關注分組

Request

HTTP MethodGET
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

StatusDescriptionSchema
200返回成功groups_response
500內部錯誤None

Schemas

groups_response

NameTypeRequiredDescription
groupsobject[]false分組
∟ idintegertrue分組 ID
∟ namestringtrue名稱
∟ securitiesobject[]true股票
∟∟ symbolstringtrue代碼
∟∟ marketstringtrue市場
∟∟ namestringtrue名稱
∟∟ watched_pricestringtrue關注時的價格
∟∟ watched_atintegertrue關注時間