# Get Competition Filter Options

filter_competition(category=None, tag=None)

  • Description

    Get the competition filter options of event contracts, returning available competition name lists and all play scopes by top-level category (category) and sub-category (tag), for filtering by the competition dimension when subsequently querying Series/Event/contracts.

  • Parameters

    Parameter Type Description
    category str Top-level category, e.g. 'Sports'
    tag str Sub-category, e.g. 'Baseball'
  • Return

    Parameter Type Description
    ret RET_CODE API call result
    data pd.DataFrame When ret == RET_OK, returns competition filter option data
    str When ret != RET_OK, returns error description

    The returned DataFrame fields are as follows:

    Field Type Description
    category str Top-level category identifier
    tag str Sub-category identifier (e.g. 'Football', 'Soccer')
    competition list Competition name list (e.g. ['Pro Football', 'EPL'])
    scope list All available play scopes under this tag (e.g. ['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

Interface Limitations

  • A maximum of 10 requests per 30 seconds for the competition filter options interface