Create watched group
Create watched group
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 | Group name, for example Information Technology Group . |
securities | string[] | NO | Security list, for example ["BABA.US", "AAPL.US"] . Display order of securities in the group, in the same order as this list. If this parameter is not passed, create an empty group. |
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 | Success | create_group_response |
500 | Internal error | None |
Schemas
create_group_response
Name | Type | Required | Description |
---|---|---|---|
id | integer | false | Group ID |