Games & Game Logs
Game Endpoints
The purpose of these endpoints is to pull game-specific information, such as start times and status
- Client.get_games(start: int = 0, limit: int = 100, league: Optional[str] = None, include_count: bool = False) Union[List[jockmkt_sdk.objects.Game], Tuple[List[jockmkt_sdk.objects.Game], int]]
provides a list of teams for all or chosen leagues that have team structure the user will have to paginate.
- Parameters
start (int, optioanl) – page at which the user wants to start their search, default: 0 (first page of games)
limit (int, optional) – number of entities the user wants to display, default: 100 (displays 100 recent and upcoming games)
league (str, optional) – filter by league, must be one of: [‘nba’, ‘nfl’, ‘nhl’, ‘pga’, ‘mlb’, ‘nascar’]
include_count (bool, optional) – include the count of available games for this request as part of a tuple in the return value
- Returns
A list of
objects.Gameobjects- Return type
- Client.get_game(game_id: str) jockmkt_sdk.objects.Game
fetch a specific entity based on their entity id
- Parameters
game_id (str, required) – a string of the game id (e.g. “game_60bb686586eaf95a5e8dafa3823d89cb”)
- Returns
a
objects.Gameobject, containing the relevant fields- Return type
GameLog Endpoint
Fetch player-specific game log from a single game, such as stats and projections
- Client.get_game_logs(start: int = 0, limit: int = 100, log_id: Optional[str] = None, entity_id: Optional[str] = None, game_id: Optional[str] = None, include_ent: bool = True, include_game: bool = False, include_team: bool = False, include_count: bool = False) Union[List[jockmkt_sdk.objects.GameLog], Tuple[List[jockmkt_sdk.objects.GameLog], int]]
fetch game logs
- Parameters
start (int, optional) – Page at which the user wants to start their search, default: 0 (first page of game_logs)
limit (int, optional) – Number of entities the user wants to display, default: 100 (displays 100 game_logs)
log_id (str or list of str, optional) – Filter for a specific log or list of logs (e.g. “gl_60cde7f973f9e00674785e5e144a802b”)
entity_id (str, optional) – Filter all game logs for a specific player, (e.g. “en_67c8368a3905f8beee69393ccec854e5”)
game_id (str, optional) – filter all game logs for all players in a specific game, (e.g. “game_60cde69ee06e791b99ed71e6013fc4a7”)
include_ent (bool, optional) – Returns entity information attached to the game log (entity name, team, etc.)
include_game (bool, optional) – Returns game information (game name, teams, status)
include_team (bool, optional) – Returns team information (team name, location, league, etc.)
include_count (bool, optional) – include the count of available game logs for this request as part of a tuple in the return value
- Returns
a list of
objects.GameLogs, containing scoring information for a player in a specific game.
If include_count == True, it will be at tuple of the list of logs and an integer for count of game logs available. :rtype: objects.GameLog | Tuple[objects.GameLog, int]
Game and GameLog objects
- class jockmkt_sdk.objects.Game(game: dict)
Games differ significantly, and you can expect significantly different information under “state” depending on the league. See docs for more info, or use self.print_game to get an idea of what the keys are.
use Game.available_attributes to see available attributes.
- Variables
game_id – Jock MKT’s id for this game
game_name – game’s name (e.g. Lakers vs Warriors)
league – which league the game applies to
start – what time the game is supposed to start
venue – a dict containing venue location, such as whether it is to be played outdoors or venue name
status – is the game scheduled, in_progress or final
amount_completed – percentage of the game that has been completed
state – a dict containing information such as the clock, period/quarter/inning, length, etc.
weather – information about the weather, only applies to some sports & outdoor venues
home_info – information about the home team, such as score, runs, hits, etc.
away_info – information about the away team, such as score, runs, hits, etc.
- class jockmkt_sdk.objects.GameLog(game_log: dict)
different leagues will return different dictionaries of stats/projected. There is currently no league identifier.
use GameLog.available_attributes() to see what attributes can be called.
- Variables
id – Jock MKT’s unique identifier for this game log
entity_id – entity_id for the player to which this game log applies
game_id – game_id to which this game log applies
team_id – team that this player is one
scheduled_start – time that the game was scheduled to start
updated_at – when this log was last updated
projected_stats – a dictionary of stat projections, which will be unique for each league
actual_stats – a dictionary of actual, scored stats, unique by league
league – league to which this game log applies
entity –
objects.Entityinformation about the entity to which this log appliesgame –
objects.Gameinformation about the game to which this log appliesteam –
objects.Teaminformation about the team this player is on