Skip to content

Latest commit

 

History

History
221 lines (161 loc) · 6.86 KB

File metadata and controls

221 lines (161 loc) · 6.86 KB

Method Reference

This page contains the method reference that previously lived in the README.

For detailed return-object and model documentation, follow the linked Wiki pages. For the stable 1.x public API contract and current async endpoint coverage, see public-api.md.

Jump to: People · Teams · Stats · Games · Schedules · Venues · Sports · Leagues · Divisions · Seasons · Standings · Draft · Awards · Gamepace

People, Person, Players, Coaches

Wiki: People

Method Description
get_people_id() Return person ID(s) from a full name
get_person() Return a person from an ID
get_people() Return all players for a sport
Mlb.get_people_id(fullname: str, sport_id: int = 1, search_key: str = 'fullName', **params)
Mlb.get_person(player_id: int, **params)
Mlb.get_people(sport_id: int = 1, **params)

Teams

Wiki: Team

Method Description
get_team_id() Return team ID(s) from a name
get_team() Return a team from a team ID
get_teams() Return all teams for a sport
get_team_coaches() Return the coaching roster for a team
get_team_roster() Return the player roster for a team
Mlb.get_team_id(team_name: str, search_key: str = 'name', **params)
Mlb.get_team(team_id: int, **params)
Mlb.get_teams(sport_id: int = 1, **params)
Mlb.get_team_coaches(team_id: int, **params)
Mlb.get_team_roster(team_id: int, **params)

Stats

Wiki: Stats · Stats Guide

Method Description
get_player_stats() Return stats for a player
get_team_stats() Return stats for a team
get_stats() Return stats by stat type and group
get_players_stats_for_game() Return player stats for a game
Mlb.get_player_stats(person_id: int, stats: list, groups: list, **params)
Mlb.get_team_stats(team_id: int, stats: list, groups: list, **params)
Mlb.get_stats(stats: list, groups: list, **params: dict)
Mlb.get_players_stats_for_game(person_id: int, game_id: int, **params)

The Stats Guide includes runnable Mlb and AsyncMlb examples and explains the nested stats[group][type] return structure.

Games

Wiki: Game

Method Description
get_game() Return a game for a game ID
get_game_play_by_play() Return play-by-play data for a game
get_game_line_score() Return a linescore for a game
get_game_box_score() Return a boxscore for a game
Mlb.get_game(game_id: int, **params)
Mlb.get_game_play_by_play(game_id: int, **params)
Mlb.get_game_line_score(game_id: int, **params)
Mlb.get_game_box_score(game_id: int, **params)

Schedules

Wiki: Schedule

Method Description
get_schedule() Return a schedule from a date or date range
get_scheduled_games_by_date() Return scheduled games from dates
Mlb.get_schedule(date: str = None, start_date: str = None, end_date: str = None, sport_id: int = 1, team_id: int = None, **params)
Mlb.get_scheduled_games_by_date(date: str = None, start_date: str = None, end_date: str = None, sport_id: int = 1, **params)

Venues

Wiki: Venue

Method Description
get_venue_id() Return venue ID(s) from a name
get_venue() Return a venue from an ID
get_venues() Return all venues
Mlb.get_venue_id(venue_name: str, search_key: str = 'name', **params)
Mlb.get_venue(venue_id: int, **params)
Mlb.get_venues(**params)

Sports

Wiki: Sport

Method Description
get_sport() Return a sport from an ID
get_sports() Return all sports
get_sport_id() Return sport ID(s) from a name
Mlb.get_sport(sport_id: int, **params)
Mlb.get_sports(**params)
Mlb.get_sport_id(sport_name: str, search_key: str = 'name', **params)

Leagues

Wiki: League

Method Description
get_league() Return a league from an ID
get_leagues() Return all leagues
get_league_id() Return league ID(s) from a name
Mlb.get_league(league_id: int, **params)
Mlb.get_leagues(**params)
Mlb.get_league_id(league_name: str, search_key: str = 'name', **params)

Divisions

Wiki: Division

Method Description
get_division() Return a division from an ID
get_divisions() Return all divisions
get_division_id() Return division ID(s) from a name
Mlb.get_division(division_id: int, **params)
Mlb.get_divisions(**params)
Mlb.get_division_id(division_name: str, search_key: str = 'name', **params)

Seasons

Wiki: Season

Method Description
get_season() Return a season
get_seasons() Return all seasons
Mlb.get_season(season_id: str, sport_id: int = 1, **params)
Mlb.get_seasons(sport_id: int = 1, **params)

Standings

Wiki: Standings

Method Description
get_standings() Return standings for a league and season
Mlb.get_standings(league_id: int, season: str, **params)

Draft

Wiki: Draft

Method Description
get_draft() Return a draft for a given year
Mlb.get_draft(year_id: int, **params)

Awards

Wiki: Award

Method Description
get_awards() Return award recipients for an award
Mlb.get_awards(award_id: str, **params)

Gamepace

Wiki: Gamepace

Method Description
get_gamepace() Return pace-of-game metrics for a sport, league, or team
Mlb.get_gamepace(season: str, sport_id=1, **params)