跳到主要內容

获取自选股分组

获取自选股分组

Request

HTTP MethodGET
HTTP URL/v1/watchlist/groups

Request Example

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

{
"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关注时间