# 获取赛事筛选选项

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 次获取赛事筛选选项接口