Skip to content

Data Types: Awards

KCNilssen edited this page Dec 16, 2022 · 9 revisions

Usage that returns Award objects

get_awards

Description: Return a list of awards

Parameters:

Name Type Required Description Default
award_id string Yes Insert a awardId to return a directory of players for a given award. None

Other Parameters:

Name Type Required Description Default
sportId string/int No Insert a sportId to return a directory of players for a given award in a specific sport. None
leagueId string/int No Insert leagueId(s) to return a directory of players for a given award in a specific league. Format '103,104' None
season string/int No Insert year(s) to return a directory of players for a given award in a given season. Format '2016,2017' None

Award Structure

Attributes are expandable and collapsable - Link to award dataclass

id : str
  • Award id
name : str
  • Name of the award
date : str
  • Date of when award was given
season : str
  • Season award is for/from
team : Team
  • Team award was to/ Player is from. Dataclass: Team
id : int
  • id number of the team
link : str
  • The API link for the team
player : Person
  • Person award is for. Dataclass: Person
id : int
  • id number of the person
link : str
  • link to person
primaryPosition : Position
code: str
  • code number of the Position
name: str
  • the name of the Position
type: str
  • the type of the Position
abbreviation: str
  • the abbreviation of the Position
namefirstlast : str
  • The first and last name of the Person
notes : str None
  • Any notes associated with award

Example output from MLB stats api endpoint

Mlb stats api Query:

https://statsapi.mlb.com/api/v1/awards/MLBHOF/recipients?sportId=1&season=2017&leagueId=103

Equivelant with python-mlb-statsapi:

import mlbstatsapi

mlb = mlbstatsapi.Mlb()

mlb.get_awards(award_id = MLBHOF, sportId = 1, season = 2017, leagueId = 103)

Clone this wiki locally