# 獲取賽事篩選項

filter_competition(category=None, tag=None)

  • 介紹

    獲取事件合約的賽事篩選項,按一級分類(category)與二級分類(tag)返回可用賽事名稱列表與玩法全集,用於後續查詢 Series/Event/合約時的賽事維度過濾。

  • 參數

    參數 類型 說明
    category str 一級分類,如 'Sports'
    tag str 二級分類,如 'Baseball'
  • 返回

    參數 類型 說明
    ret RET_CODE 介面呼叫結果
    data pd.DataFrame 當 ret == RET_OK,返回賽事篩選項數據
    str 當 ret != RET_OK,返回錯誤描述

    返回的 DataFrame 欄位如下:

    欄位 類型 說明
    category str 一級分類標識
    tag str 二級分類標識(如 'Football''Soccer'
    competition list 賽事名稱列表(如 ['Pro Football', 'EPL']
    scope list 該標籤下所有可用玩法全集(如 ['Game', 'Future', 'Awards']
  • Example

from moomoo import *

quote_ctx = OpenQuoteContext(host='127.0.0.1', port=11111)
ret, data = quote_ctx.filter_competition(category='Sports')
if ret == RET_OK:
    print(data)
else:
    print('error:', data)
quote_ctx.close()
1
2
3
4
5
6
7
8
9
  • Output
   category         tag                                         competition                              scope
0    Sports    Baseball  [Pro Baseball, Home Run Derby, All-Star, Japan NPB, Korea KBO]  [Game, Future, Awards, Divisions, Season Milestones, Trades, Player Debut]
1    Sports  Basketball  [Pro Basketball (M), Pro Basketball (W), College Basketball (M), ...]  [Future, Awards, Draft, Next Team, Mid-Season Cup, Game, Conference Tournament]
2    Sports      Boxing  [Mayweather vs Pacquiao, Alvarez vs Mbilli, Boxing, La Velada del Año VI]  [Game]
...
1
2
3
4
5

介面限制

  • 每 30 秒內最多請求 10 次獲取賽事篩選項介面