Skip to content

Function: latest_season

Todd Roberts edited this page Aug 10, 2022 · 1 revision

Get data about the latest season for a given sportId. (Added in v1.5)

statsapi.latest_season(sportId=1)

Example

Get the latest season for MLB, sportId=1 (default)

season_data = statsapi.latest_season()
print(season_data['seasonId'])

Output

2022