[Bug]: How to get the list of in season tournament games?
NBA API Version
1.4.1
Issue
How can I use the leaguegamefinder endpoint to get the list of in-season tournament games? The following code snippet does not work. Also, are the valid values for season_type_nullable parameter documented?
Code
from nba_api.stats.endpoints import leaguegamefinder
gamefinder = leaguegamefinder.LeagueGameFinder(season_nullable='2023-24', league_id_nullable='00', season_type_nullable='IST', # what are the valid values? 'Regular Season', 'IST', 'PlayIn', 'Playoffs' player_or_team_abbreviation='T')
@jaratec - Will get this look at this weekend.
@jaratec - Will get this look at this weekend.
Was a solution ever found by any chance?
@jaratec / @sebasdarius - What are you looking for out of these calls? A PR was merged last year for In Season Tournaments (#363).
Notes:
- The NBA is retiring some endpoints (this could be one that is targeted, and thus not updated)
- Usually, I can find these endpoints used throughout the UI on stats.nba.com. I wasn't able to locate this one. If you have a link, please post it. That'll help verify if IST is supported or not.
I saw that on a few areas of the NBA with drop-down fields on stats, the "NBA Cup" (aka In Season Tournament) wasn't present. That gives me an indication that it may not be supported in all cases.
Here's a Postman call I use. When I used IST if obviously failed.
https://stats.nba.com/stats/leaguegamefinder?Conference=&DateFrom=&DateTo=&Division=&DraftNumber=&DraftRound=&DraftTeamID=&DraftYear=&EqAST=&EqBLK=&EqDD=&EqDREB=&EqFG3A=&EqFG3M=&EqFG3_PCT=&EqFGA=&EqFGM=&EqFG_PCT=&EqFTA=&EqFTM=&EqFT_PCT=&EqMINUTES=&EqOREB=&EqPF=&EqPTS=&EqREB=&EqSTL=&EqTD=&EqTOV=&GameID=&GtAST=&GtBLK=&GtDD=&GtDREB=&GtFG3A=&GtFG3M=&GtFG3_PCT=&GtFGA=&GtFGM=&GtFG_PCT=&GtFTA=&GtFTM=&GtFT_PCT=&GtMINUTES=&GtOREB=&GtPF=&GtPTS=&GtREB=&GtSTL=&GtTD=&GtTOV=&LeagueID=00&Location=&LtAST=&LtBLK=&LtDD=&LtDREB=&LtFG3A=&LtFG3M=&LtFG3_PCT=&LtFGA=&LtFGM=&LtFG_PCT=&LtFTA=&LtFTM=&LtFT_PCT=&LtMINUTES=&LtOREB=&LtPF=&LtPTS=&LtREB=&LtSTL=&LtTD=&LtTOV=&Outcome=&PORound=&PlayerID=&PlayerOrTeam=T&RookieYear=&Season=2023-24&SeasonSegment=&SeasonType=Regular Season&StarterBench=&TeamID=&VsConference=&VsDivision=&VsTeamID=&YearsExperience=
from nba_api.stats.library.parameters import SeasonTypeAllStar
from nba_api.stats.endpoints import leaguegamefinder, playbyplayv2, boxscoretraditionalv2
def get_game_ids(start_date, end_date):
# Get all games for the specified season
gamefinder = leaguegamefinder.LeagueGameFinder(
season_nullable='2023-24', season_type_nullable=SeasonTypeAllStar.regular
)
games = gamefinder.get_data_frames()[0]
This code worked for me still if it helps anyone