创建自选股分组
创建自选股分组
SDK Links
Python |
Rust |
Go |
Node.js |
Request
HTTP Method | POST |
HTTP URL | /v1/watchlist/groups |
Parameters
Content-Type: application/json; charset=utf-8
Name | Type | Required | Description |
---|---|---|---|
name | string | YES | 分组名称,例如 信息产业组 |
securities | string[] | NO | 股票列表,例如 ["BABA.US","AAPL.US"] 分组下股票的展示顺序,与此列表的顺序一致 如果不传此参数,则创建一个空的分组 |
Request Example
from longport.openapi import QuoteContext, Config
config = Config.from_env()
ctx = QuoteContext(config)
group_id = ctx.create_watchlist_group(name = "Watchlist1", securities = ["700.HK", "AAPL.US"])
print(group_id)
Response
Response Headers
- Content-Type: application/json
Response Example
{
"code": 0,
"data": {
"id": 10086
}
}
Response Status
Status | Description | Schema |
---|---|---|
200 | 返回成功 | create_group_response |
500 | 内部错误 | None |
Schemas
create_group_response
Name | Type | Required | Description |
---|---|---|---|
id | integer | false | 分组 ID |