Skip to Content

Create Watchlist Group

Create watched group

Request ​

HTTP MethodPOST
HTTP URL/v1/watchlist/groups

Parameters ​

Content-Type: application/json; charset=utf-8

NameTypeRequiredDescription
namestringYESGroup name, for example Information Technology Group.
securitiesstring[]NOSecurity 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 ​

python
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 ​

json
{
  "code": 0,
  "data": {
    "id": 10086
  }
}

Response Status ​

StatusDescriptionSchema
200Successcreate_group_response
500Internal errorNone

Schemas ​

create_group_response ​

NameTypeRequiredDescription
idintegerfalseGroup ID