Skip to content

獲取自選股分組

GET /api/v1.0/quote/user-security-group

獲取用戶自選股的分組列表(含系統預置分組與用戶自定義分組)。獲取分組下的自選股請用 user-security;增加/移出自選請用 modify-user-security

請求參數

參數類型位置必填說明
group_typestring查詢分組類型過濾,默認 ALL。取值:ALL=全部 / SYSTEM=系統預置 / CUSTOM=用戶自定義。

請求示例

bash
curl "https://webapi.moomoo.com/api/v1.0/quote/user-security-group?group_type=ALL" | jq

響應字段

字段類型說明
group_listobject[]分組列表。
group_list[].group_namestring分組名稱。系統分組為英文(All / US / HK / Favorites 等),自定義分組為用戶原名。
group_list[].group_typestring分組類型:SYSTEM / CUSTOM

限制範圍

  • 僅返回用戶當前可見的分組(用戶已隱藏的分組不返回)。
  • 持倉、外匯、基金分組不在返回範圍內。
  • 系統分組(group_type=SYSTEM)完整名稱集(最多 19 個):All、Favorites、HK、US、CN、HK Options、US Options、Options、Futures、Index、Bonds、Notes、Crypto、SG、JP、MY、AU、CA。

錯誤碼

ret_codeerror.code觸發條件處理建議
-3invalid_parametergroup_type 取值不在 [ALL, CUSTOM, SYSTEM](大小寫敏感)。修正 group_type 後重試。
-9permission_denied用戶身份缺失/無效。補齊用戶身份後重試。
-5internal_error後端自選服務調用失敗。稍後重試,持續失敗請聯繫服務方。

響應示例

json
{
  "ret_code": 0,
  "ret_msg": "success",
  "data": {
    "group_list": [
      { "group_name": "All", "group_type": "SYSTEM" },
      { "group_name": "Favorites", "group_type": "SYSTEM" },
      { "group_name": "HK", "group_type": "SYSTEM" },
      { "group_name": "US", "group_type": "SYSTEM" },
      { "group_name": "Options", "group_type": "SYSTEM" },
      { "group_name": "我的自選", "group_type": "CUSTOM" }
    ]
  }
}